-
Notifications
You must be signed in to change notification settings - Fork 309
Use of new taxonomy tools and introduction of postinstall django app commands management #11136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nastasi-oq
wants to merge
19
commits into
engine-3.23
Choose a base branch
from
b3.23-pre5
base: engine-3.23
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
6e332fa
update URL_STANDALONE for b3.23-pre5 branch
nastasi-oq f97eeca
set STANDALONE_APP_NAME_MAP in settings.py directly
nastasi-oq 6dc82aa
add 'django-gem-taxonomy' as new standalone app
nastasi-oq 764d14a
manage properly 'openquake' namespace: remove 'openquake/__init__.py'…
nastasi-oq 98df5f5
introduce post installation command management for standalone applica…
nastasi-oq 7d6f24a
some cleanup
nastasi-oq 5c26159
differentiate 'django-admin' command for different OS
nastasi-oq 1740d83
modify environment to be able to run django-admin with the proper set…
nastasi-oq 93a2a0f
wheelhouse link to engine-3.23 folder
nastasi-oq 0c9140b
more clear if condition
nastasi-oq e681d0b
actualize template before run oq-engine install script to avoid error…
nastasi-oq d94714d
add '--keepvenv' argument to 'install.py' to preserve previous virtua…
nastasi-oq a0795da
from keepvenv to no_env argument
nastasi-oq 925a0e8
manage VENV path for no_venv case
nastasi-oq 313847f
rename install argument
nastasi-oq 153e6e1
add '--noupgrade' argument to install.py command
nastasi-oq d7808fd
wrong default argparse default values fixed
nastasi-oq 947e2d4
fix operators precedence order
nastasi-oq 9b0bd35
add a docker_latest workflow to be able to run it in the current gith…
nastasi-oq File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
57 changes: 57 additions & 0 deletions
57
openquake/server/management/commands/openquake_engine_postinstall.py
This file contains hidden or 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,57 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # vim: tabstop=4 shiftwidth=4 softtabstop=4 | ||
| # | ||
| # oq-geoviewer | ||
| # Copyright (C) 2018-2019 GEM Foundation | ||
| # | ||
| # oq-geoviewer is free software: you can redistribute it and/or modify | ||
| # it under the terms of the GNU Affero General Public License as published by | ||
| # the Free Software Foundation, either version 3 of the License, or | ||
| # (at your option) any later version. | ||
| # | ||
| # oq-geoviewer is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU Affero General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU Affero General Public License | ||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| # import subprocess | ||
| from django.apps import apps as django_apps | ||
| from django.core.management import call_command, get_commands | ||
| import sys | ||
| from django.core.management.base import BaseCommand | ||
|
|
||
| class Command(BaseCommand): | ||
| help = ("Command that run a '<app_name>_postinstall' command if it exists") | ||
|
|
||
| def add_arguments(self, parser): | ||
| parser.add_argument('django_app', | ||
| help='django application name') | ||
|
|
||
| def handle(self, *args, **options): | ||
| found = False | ||
| for app in django_apps.get_app_configs(): | ||
| label = app.label | ||
| if options['django_app'] == label: | ||
| found = True | ||
| break | ||
|
|
||
| if not found: | ||
| self.stdout.write( | ||
| self.style.ERROR( | ||
| "No django app '%s' found." % (options['django_app'],)) | ||
| ) | ||
| sys.exit(1) | ||
|
|
||
| postinstall_cmd = options['django_app'] + '_postinstall' | ||
| django_cmds = get_commands() | ||
| if postinstall_cmd not in django_cmds: | ||
| self.stdout.write( | ||
| self.style.WARNING( | ||
| "No 'postinst' action needed for app %s, skipped." % (options['django_app'],)) | ||
| ) | ||
| sys.exit(0) | ||
|
|
||
| call_command(postinstall_cmd) |
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename
is_installasinstalled