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
36e73189
Commit
36e73189
authored
Oct 27, 2016
by
Max Rothman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make migration artifact names more sensible
parent
2fe26491
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
playbooks/continuous_delivery/run_migrations.yml
+8
-8
No files found.
playbooks/continuous_delivery/run_migrations.yml
View file @
36e73189
...
...
@@ -18,8 +18,8 @@
# - HIPCHAT_URL - URL of the hipchat API (defaults to v1 of the api)
#
# Other variables:
# -
unapplied_migrations_output
- the filename where the unapplied migration YAML output is stored
# - migration_
outpu
t - the filename where the migration output is saved
# -
migration_plan
- the filename where the unapplied migration YAML output is stored
# - migration_
resul
t - the filename where the migration output is saved
# - SUB_APPLICATION_NAME - used for migrations in edxapp {lms|cms}, must be specified
# when APPLICATION_NAME is edxapp
# - EDX_PLATFORM_SETTINGS - The settings to use for the edx platform {aws|devstack} DEFAULT: aws
...
...
@@ -34,8 +34,8 @@
-
hosts
:
all
vars
:
unapplied_migrations_output
:
unapplied_migrations
.yml
migration_
output
:
migration_outpu
t.yml
migration_plan
:
migration_plan
.yml
migration_
result
:
migration_resul
t.yml
HIPCHAT_URL
:
https://api.hipchat.com/v2/
EDX_PLATFORM_SETTINGS
:
"
aws"
COMMAND_PREFIX
:
"
.
{{
APPLICATION_PATH
}}/{{
APPLICATION_NAME
}}_env;
DB_MIGRATION_USER={{
DB_MIGRATION_USER
}}
DB_MIGRATION_PASS={{
DB_MIGRATION_PASS
}}
/edx/bin/python.{{
APPLICATION_NAME
}}
/edx/bin/manage.{{
APPLICATION_NAME
}}"
...
...
@@ -51,23 +51,23 @@
register
:
temp_output_dir
-
name
:
generate list of unapplied migrations
shell
:
'
{{
COMMAND_PREFIX
}}
show_unapplied_migrations
--output_file
"{{
temp_output_dir.stdout
}}/{{
unapplied_migrations_output
}}"'
shell
:
'
{{
COMMAND_PREFIX
}}
show_unapplied_migrations
--output_file
"{{
temp_output_dir.stdout
}}/{{
migration_plan
}}"'
become_user
:
"
{{
APPLICATION_USER
}}"
when
:
APPLICATION_NAME != "edxapp"
-
name
:
generate list of edxapp unapplied migrations
shell
:
'
{{
COMMAND_PREFIX
}}
{{
SUB_APPLICATION_NAME
}}
show_unapplied_migrations
--database
"{{
item
}}"
--output_file
"{{
temp_output_dir.stdout
}}/{{
item
}}_{{
unapplied_migrations_output
}}"
--settings
"{{
EDX_PLATFORM_SETTINGS
}}"'
shell
:
'
{{
COMMAND_PREFIX
}}
{{
SUB_APPLICATION_NAME
}}
show_unapplied_migrations
--database
"{{
item
}}"
--output_file
"{{
temp_output_dir.stdout
}}/{{
item
}}_{{
migration_plan
}}"
--settings
"{{
EDX_PLATFORM_SETTINGS
}}"'
become_user
:
"
{{
APPLICATION_USER
}}"
when
:
APPLICATION_NAME == "edxapp" and item != "read_replica"
with_items
:
edxapp_databases.keys()
-
name
:
migrate to apply any unapplied migrations
shell
:
'
{{
COMMAND_PREFIX
}}
run_migrations
"{{
temp_output_dir.stdout
}}/{{
unapplied_migrations_output
}}"
--output_file
"{{
temp_output_dir.stdout
}}/{{
migration_outpu
t
}}"'
shell
:
'
{{
COMMAND_PREFIX
}}
run_migrations
"{{
temp_output_dir.stdout
}}/{{
migration_plan
}}"
--output_file
"{{
temp_output_dir.stdout
}}/{{
migration_resul
t
}}"'
become_user
:
"
{{
APPLICATION_USER
}}"
when
:
APPLICATION_NAME != "edxapp"
-
name
:
migrate to apply any edxapp unapplied migrations
shell
:
'
{{
COMMAND_PREFIX
}}
{{
SUB_APPLICATION_NAME
}}
run_migrations
"{{
temp_output_dir.stdout
}}/{{
item
}}_{{
unapplied_migrations_output
}}"
--database
"{{
item
}}"
--settings
"{{
EDX_PLATFORM_SETTINGS
}}"
--output_file
"{{
temp_output_dir.stdout
}}/{{
migration_outpu
t
}}"'
shell
:
'
{{
COMMAND_PREFIX
}}
{{
SUB_APPLICATION_NAME
}}
run_migrations
"{{
temp_output_dir.stdout
}}/{{
item
}}_{{
migration_plan
}}"
--database
"{{
item
}}"
--settings
"{{
EDX_PLATFORM_SETTINGS
}}"
--output_file
"{{
temp_output_dir.stdout
}}/{{
migration_resul
t
}}"'
become_user
:
"
{{
APPLICATION_USER
}}"
when
:
APPLICATION_NAME == "edxapp" and item != "read_replica"
with_items
:
edxapp_databases.keys()
...
...
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