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
d14ca0a7
Commit
d14ca0a7
authored
Jun 23, 2016
by
John Eskew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use temporary file for storage of migration output.
Transfer output artifacts after completion to preserve them.
parent
093da1e6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
playbooks/continuous_delivery/run_migrations.yml
+19
-7
No files found.
playbooks/continuous_delivery/run_migrations.yml
View file @
d14ca0a7
...
@@ -8,8 +8,10 @@
...
@@ -8,8 +8,10 @@
# Required variables for this playbook:
# Required variables for this playbook:
#
#
# - 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
# - unapplied_migrations_path - the path where the unapplied migration YAML output is stored
# NOTE: It is assumed that edx-django-release-util is one of its INSTALLED_APPS.
# - migration_output_path - the path where the migration output is saved
# - unapplied_migrations_output - the filename where the unapplied migration YAML output is stored
# - migration_output - the filename where the migration output is saved
# - artifact_path - the path where the migration artifacts should be copied after completion
# - hipchat_token - API token to send messages to hipchat
# - hipchat_token - API token to send messages to hipchat
# - hipchat_room - ID or name of the room to send the notification
# - hipchat_room - ID or name of the room to send the notification
# - hipchat_url - URL of the hipchat API (defaults to v1 of the api)
# - hipchat_url - URL of the hipchat API (defaults to v1 of the api)
...
@@ -23,24 +25,34 @@
...
@@ -23,24 +25,34 @@
-
hosts
:
all
-
hosts
:
all
vars
:
vars
:
application_path
:
/usr/src/myapp
application_path
:
/usr/src/my
_django_
app
unapplied_migrations_
path
:
/tmp/
unapplied_migrations.yml
unapplied_migrations_
output
:
unapplied_migrations.yml
migration_output
_path
:
/tmp/
migration_output.yml
migration_output
:
migration_output.yml
hipchat_url
:
https://api.hipchat.com/v2/
hipchat_url
:
https://api.hipchat.com/v2/
gather_facts
:
False
gather_facts
:
False
connection
:
local
connection
:
local
tasks
:
tasks
:
-
name
:
Create a temporary directory for the migration output.
command
:
mktemp -d
register
:
temp_output_dir
-
name
:
generate list of unapplied migrations
-
name
:
generate list of unapplied migrations
command
:
python manage.py show_unapplied_migrations --output_file "{{
unapplied_migrations_path
}}"
command
:
python manage.py show_unapplied_migrations --output_file "{{
temp_output_dir.stdout }}/{{ unapplied_migrations_output
}}"
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 "{{
unapplied_migrations_path }}" --output_file "{{ migration_output_path
}}"
command
:
python manage.py run_migrations "{{
temp_output_dir.stdout }}/{{ unapplied_migrations_output }}" --output_file "{{ temp_output_dir.stdout }}/{{ migration_output
}}"
args
:
args
:
chdir
:
"
{{
application_path
}}"
chdir
:
"
{{
application_path
}}"
-
name
:
Transfer artifacts to the proper place.
copy
:
src
:
"
{{
temp_output_dir.stdout
}}/"
dest
:
"
{{
artifact_path
}}"
mode
:
0700
-
name
:
Send Hipchat notification cleanup has finished
-
name
:
Send Hipchat notification cleanup has finished
hipchat_2_0_0_1
:
hipchat_2_0_0_1
:
api
:
"
{{
hipchat_url
}}"
api
:
"
{{
hipchat_url
}}"
...
...
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