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
21bd55dc
Commit
21bd55dc
authored
Nov 22, 2017
by
John Eskew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replce 'migrate --list' with 'showmigrations'.
parent
be6982f9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
10 deletions
+44
-10
playbooks/roles/automated/tasks/main.yml
+5
-5
playbooks/roles/edx_django_service/defaults/main.yml
+1
-1
playbooks/roles/edxapp/defaults/main.yml
+1
-1
playbooks/roles/edxapp/templates/edx/bin/edxapp-migrate-cms.j2
+18
-1
playbooks/roles/edxapp/templates/edx/bin/edxapp-migrate-lms.j2
+18
-1
playbooks/roles/supervisor/files/pre_supervisor_checks.py
+1
-1
No files found.
playbooks/roles/automated/tasks/main.yml
View file @
21bd55dc
...
...
@@ -26,9 +26,9 @@
# EDXAPP_AUTOMATED_USERS:
# ecom:
# sudo_commands:
# - command: "/edx/app/edxapp/venvs/edxapp/bin/python /edx/app/edxapp/edx-platform/manage.py lms
migrate --list
--settings=aws"
# - command: "/edx/app/edxapp/venvs/edxapp/bin/python /edx/app/edxapp/edx-platform/manage.py lms
showmigrations
--settings=aws"
# sudo_user: "edxapp"
# - command: "/edx/app/edxapp/venvs/edxapp/bin/python /edx/app/edxapp/edx-platform/manage.py cms
migrate --list
--settings=aws"
# - command: "/edx/app/edxapp/venvs/edxapp/bin/python /edx/app/edxapp/edx-platform/manage.py cms
showmigrations
--settings=aws"
# sudo_user: "edxapp"
# authorized_keys:
# - 'ssh-rsa <REDACTED> ecom+admin@example.com'
...
...
@@ -62,7 +62,7 @@
mode
:
"
0440"
validate
:
'
visudo
-cf
%s'
with_dict
:
"
{{
AUTOMATED_USERS
}}"
-
name
:
Create .ssh directory
file
:
path
:
"
/home/{{
item.key
}}/.ssh"
...
...
@@ -71,7 +71,7 @@
owner
:
"
{{
item.key
}}"
group
:
"
{{
item.key
}}"
with_dict
:
"
{{
AUTOMATED_USERS
}}"
-
name
:
Build authorized_keys file
template
:
src
:
"
home/automator/.ssh/authorized_keys.j2"
...
...
@@ -80,7 +80,7 @@
owner
:
"
{{
item.key
}}"
group
:
"
{{
item.key
}}"
with_dict
:
"
{{
AUTOMATED_USERS
}}"
-
name
:
Build known_hosts file
file
:
path
:
"
/home/{{
item.key
}}/.ssh/known_hosts"
...
...
playbooks/roles/edx_django_service/defaults/main.yml
View file @
21bd55dc
...
...
@@ -191,7 +191,7 @@ edx_django_service_config: '{{ edx_django_service_config_default|combine(edx_dja
edx_django_service_automated_users
:
automated_user
:
sudo_commands
:
-
command
:
'
{{
edx_django_service_venv_dir
}}/python
{{
edx_django_service_code_dir
}}/manage.py
migrate
--list
'
-
command
:
'
{{
edx_django_service_venv_dir
}}/python
{{
edx_django_service_code_dir
}}/manage.py
showmigrations
'
sudo_user
:
'
{{
edx_django_service_user
}}'
authorized_keys
:
-
'
SSH
authorized
key'
...
...
playbooks/roles/edxapp/defaults/main.yml
View file @
21bd55dc
...
...
@@ -412,7 +412,7 @@ EDXAPP_SANDBOX_ENFORCE: true
EDXAPP_AUTOMATED_USERS
:
automated_user
:
sudo_commands
:
-
command
:
"
{{
edxapp_venv_bin
}}/python
{{
edxapp_code_dir
}}/manage.py
lms
migrate
--list
--settings={{
edxapp_settings
}}"
-
command
:
"
{{
edxapp_venv_bin
}}/python
{{
edxapp_code_dir
}}/manage.py
lms
showmigrations
--settings={{
edxapp_settings
}}"
sudo_user
:
"
edxapp"
authorized_keys
:
-
"
SSH
authorized
key"
...
...
playbooks/roles/edxapp/templates/edx/bin/edxapp-migrate-cms.j2
View file @
21bd55dc
...
...
@@ -4,8 +4,25 @@ if [[ -z "${NO_EDXAPP_SUDO:-}" ]]; then
SUDO='sudo -E -u {{ edxapp_user }} env "PATH=$PATH"'
fi
remove_unwanted_args () {
ARGS=("")
args_to_remove="(--list|--noinput)"
for var in "$@"; do
# Ignore known unneeded arguments
if [[ "$var" =~ $args_to_remove ]]; then
continue
fi
ARGS+=("$var")
done
}
{% for db in cms_auth_config.DATABASES.keys() %}
{%- if db != 'read_replica' %}
${SUDO:-} {{ edxapp_venv_bin }}/python manage.py cms migrate --database {{ db }} --noinput --settings $EDX_PLATFORM_SETTINGS $@
if [[ $@ =~ .*--list.* ]]; then
remove_unwanted_args $@
${SUDO:-} {{ edxapp_venv_bin }}/python manage.py cms showmigrations --database {{ db }} --settings $EDX_PLATFORM_SETTINGS ${ARGS[@]}
else
${SUDO:-} {{ edxapp_venv_bin }}/python manage.py cms migrate --database {{ db }} --noinput --settings $EDX_PLATFORM_SETTINGS $@
fi
{% endif %}
{% endfor %}
playbooks/roles/edxapp/templates/edx/bin/edxapp-migrate-lms.j2
View file @
21bd55dc
...
...
@@ -4,8 +4,25 @@ if [[ -z "${NO_EDXAPP_SUDO:-}" ]]; then
SUDO='sudo -E -u {{ edxapp_user }} env "PATH=$PATH"'
fi
remove_unwanted_args () {
ARGS=("")
args_to_remove="(--list|--noinput)"
for var in "$@"; do
# Ignore known unneeded arguments
if [[ "$var" =~ $args_to_remove ]]; then
continue
fi
ARGS+=("$var")
done
}
{% for db in lms_auth_config.DATABASES.keys() %}
{%- if db != 'read_replica' %}
${SUDO:-} {{ edxapp_venv_bin }}/python manage.py lms migrate --database {{ db }} --noinput --settings $EDX_PLATFORM_SETTINGS $@
if [[ $@ =~ .*--list.* ]]; then
remove_unwanted_args $@
${SUDO:-} {{ edxapp_venv_bin }}/python manage.py lms showmigrations --database {{ db }} --settings $EDX_PLATFORM_SETTINGS ${ARGS[@]}
else
${SUDO:-} {{ edxapp_venv_bin }}/python manage.py lms migrate --database {{ db }} --noinput --settings $EDX_PLATFORM_SETTINGS $@
fi
{% endif %}
{% endfor %}
playbooks/roles/supervisor/files/pre_supervisor_checks.py
View file @
21bd55dc
...
...
@@ -13,7 +13,7 @@ import time
MIGRATION_COMMANDS
=
{
'lms'
:
"/edx/bin/edxapp-migrate-lms --noinput --list"
,
'cms'
:
"/edx/bin/edxapp-migrate-cms --noinput --list"
,
'xqueue'
:
"SERVICE_VARIANT=xqueue sudo -E -u xqueue {python} {code_dir}/manage.py
migrate --noinput --list
--settings=xqueue.aws_settings"
,
'xqueue'
:
"SERVICE_VARIANT=xqueue sudo -E -u xqueue {python} {code_dir}/manage.py
showmigrations
--settings=xqueue.aws_settings"
,
'ecommerce'
:
". {env_file}; sudo -E -u ecommerce {python} {code_dir}/manage.py showmigrations"
,
'insights'
:
". {env_file}; sudo -E -u insights {python} {code_dir}/manage.py showmigrations"
,
'analytics_api'
:
". {env_file}; sudo -E -u analytics_api {python} {code_dir}/manage.py showmigrations"
,
...
...
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