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
OpenEdx
configuration
Commits
e224d111
Commit
e224d111
authored
Aug 02, 2016
by
Brian Beggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GoCD migrations automation for edxapp
parent
5eb17c87
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletions
+22
-1
playbooks/continuous_delivery/run_migrations.yml
+22
-1
No files found.
playbooks/continuous_delivery/run_migrations.yml
View file @
e224d111
...
...
@@ -20,6 +20,9 @@
# Other variables:
# - unapplied_migrations_output - the filename where the unapplied migration YAML output is stored
# - migration_output - 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
#
# Example command line to run this playbook:
# ansible-playbook -vvvv -i "localhost," -c local \
...
...
@@ -28,12 +31,16 @@
#
-
hosts
:
all
vars
:
unapplied_migrations_output
:
unapplied_migrations.yml
migration_output
:
migration_output.yml
HIPCHAT_URL
:
https://api.hipchat.com/v2/
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
}}
"
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
}}"
vars_files
:
-
roles/edxapp/defaults/main.yml
gather_facts
:
False
tasks
:
...
...
@@ -45,10 +52,24 @@
-
name
:
generate list of unapplied migrations
shell
:
'
{{
COMMAND_PREFIX
}}
show_unapplied_migrations
--output_file
"{{
temp_output_dir.stdout
}}/{{
unapplied_migrations_output
}}"'
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
}}/{{
unapplied_migrations_output
}}"
--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_output
}}"'
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
}}/{{
unapplied_migrations_output
}}"
--database
"{{
item
}}"
--settings
"{{
EDX_PLATFORM_SETTINGS
}}"
--output_file
"{{
temp_output_dir.stdout
}}/{{
migration_output
}}"'
become_user
:
"
{{
APPLICATION_USER
}}"
when
:
APPLICATION_NAME == "edxapp" and item != "read_replica"
with_items
:
edxapp_databases.keys()
-
name
:
Transfer artifacts to the proper place.
fetch
:
...
...
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