-
Notifications
You must be signed in to change notification settings - Fork 537
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the whole concept of development/production mounts
- Loading branch information
Showing
18 changed files
with
78 additions
and
127 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
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
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 |
---|---|---|
|
@@ -57,3 +57,5 @@ tmp/* | |
!private/README.md | ||
!storage/.gitignore | ||
!deps/.gitkeep | ||
!site-static/.gitkeep | ||
!static-build/.gitkeep |
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
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
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
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,59 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import shutil | ||
import subprocess | ||
|
||
def clean_dir(dir_path): | ||
if not os.path.exists(dir_path): | ||
return | ||
|
||
for item in os.listdir(dir_path): | ||
item_path = os.path.join(dir_path, item) | ||
if os.path.isdir(item_path): | ||
shutil.rmtree(item_path) | ||
|
||
|
||
def main(): | ||
""" | ||
Update the static assets served by addons-server for production. | ||
""" | ||
DOCKER_TARGET = os.environ.get('DOCKER_TARGET', '') | ||
HOME = os.environ.get('HOME') | ||
|
||
if DOCKER_TARGET != 'production': | ||
print('Skipping update_assets as we are not in production') | ||
return | ||
|
||
for dir in ['static-build', 'site-static']: | ||
path = os.path.join(HOME, dir) | ||
clean_dir(path) | ||
os.makedirs(path, exist_ok=True) | ||
|
||
script_prefix = ['python3', 'manage.py'] | ||
|
||
environment = os.environ.copy() | ||
environment['DJANGO_SETTINGS_MODULE'] = 'olympia.lib.settings_base' | ||
|
||
subprocess.run( | ||
script_prefix + ['compress_assets'], | ||
check=True, | ||
env=environment, | ||
capture_output=False, | ||
) | ||
subprocess.run( | ||
script_prefix + ['generate_jsi18n_files'], | ||
check=True, | ||
env=environment, | ||
capture_output=False, | ||
) | ||
subprocess.run( | ||
script_prefix + ['collectstatic', '--noinput'], | ||
check=True, | ||
env=environment, | ||
capture_output=False, | ||
) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
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
Empty file.
Empty file.
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
Oops, something went wrong.