Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
6d67d77d
Commit
6d67d77d
authored
Jun 24, 2016
by
John Eskew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to change user which runs migration.
parent
d14ca0a7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
playbooks/continuous_delivery/run_migrations.yml
+6
-0
No files found.
playbooks/continuous_delivery/run_migrations.yml
View file @
6d67d77d
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#
#
# - application_path - the path where the Django application with potential migrations is installed
# - application_path - the path where the Django application with potential migrations is installed
# NOTE: It is assumed that edx-django-release-util is one of its INSTALLED_APPS.
# NOTE: It is assumed that edx-django-release-util is one of its INSTALLED_APPS.
# - application_user - user which is meant to run the application
# - unapplied_migrations_output - the filename where the unapplied migration YAML output is stored
# - unapplied_migrations_output - the filename where the unapplied migration YAML output is stored
# - migration_output - the filename where the migration output is saved
# - migration_output - the filename where the migration output is saved
# - artifact_path - the path where the migration artifacts should be copied after completion
# - artifact_path - the path where the migration artifacts should be copied after completion
...
@@ -26,6 +27,7 @@
...
@@ -26,6 +27,7 @@
-
hosts
:
all
-
hosts
:
all
vars
:
vars
:
application_path
:
/usr/src/my_django_app
application_path
:
/usr/src/my_django_app
application_user
:
appuser
unapplied_migrations_output
:
unapplied_migrations.yml
unapplied_migrations_output
:
unapplied_migrations.yml
migration_output
:
migration_output.yml
migration_output
:
migration_output.yml
hipchat_url
:
https://api.hipchat.com/v2/
hipchat_url
:
https://api.hipchat.com/v2/
...
@@ -39,11 +41,15 @@
...
@@ -39,11 +41,15 @@
-
name
:
generate list of unapplied migrations
-
name
:
generate list of unapplied migrations
command
:
python manage.py show_unapplied_migrations --output_file "{{ temp_output_dir.stdout }}/{{ unapplied_migrations_output }}"
command
:
python manage.py show_unapplied_migrations --output_file "{{ temp_output_dir.stdout }}/{{ unapplied_migrations_output }}"
become
:
true
become_user
:
"
{{
application_user
}}"
args
:
args
:
chdir
:
"
{{
application_path
}}"
chdir
:
"
{{
application_path
}}"
-
name
:
migrate to apply any unapplied migrations
-
name
:
migrate to apply any unapplied migrations
command
:
python manage.py run_migrations "{{ temp_output_dir.stdout }}/{{ unapplied_migrations_output }}" --output_file "{{ temp_output_dir.stdout }}/{{ migration_output }}"
command
:
python manage.py run_migrations "{{ temp_output_dir.stdout }}/{{ unapplied_migrations_output }}" --output_file "{{ temp_output_dir.stdout }}/{{ migration_output }}"
become
:
true
become_user
:
"
{{
application_user
}}"
args
:
args
:
chdir
:
"
{{
application_path
}}"
chdir
:
"
{{
application_path
}}"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment