Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added in deployment options to various CDNs.
- Loading branch information
Showing
21 changed files
with
859 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
*.pyo | ||
Thumbs.db | ||
build | ||
www |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env python3 | ||
""" | ||
Deploy script for the html5media project. | ||
This needs to be run after the build to push the new version of the app onto the relevant CDNs. | ||
""" | ||
|
||
import subprocess, os | ||
|
||
from build import MEDIA_BUILD_ROOT, API_BUILD_ROOT, HTML_ROOT, CDN_ROOT | ||
|
||
|
||
MEDIA_DEPLOY_ROOT = os.environ["HTML5MEDIA_MEDIA_DEPLOY_ROOT"] | ||
|
||
HTML_DEPLOY_ROOT = os.environ["HTML5MEDIA_HTML_DEPLOY_ROOT"] | ||
|
||
CDN_EMAIL = os.environ["HTML5MEDIA_CDN_EMAIL"] | ||
|
||
CDN_PASSWORD = os.environ["HTML5MEDIA_CDN_PASSWORD"] | ||
|
||
|
||
def main(): | ||
# Upload the media files. | ||
print("Uploading media files...") | ||
subprocess.call("rsync -r --exclude=.DS_Store {}/ {}".format(MEDIA_BUILD_ROOT, MEDIA_DEPLOY_ROOT), shell=True) | ||
# Uploading the HTML files. | ||
print("Uploading html files...") | ||
subprocess.call("rsync -r {}/*.html {}".format(HTML_ROOT, HTML_DEPLOY_ROOT), shell=True) | ||
# Deploy the CDN. | ||
print("Deploying CDN...") | ||
subprocess.call("echo {} | appcfg.py update {} --email={} --passin".format(CDN_PASSWORD, CDN_ROOT, CDN_EMAIL), shell=True) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.