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
ebe3811c
Commit
ebe3811c
authored
Jul 16, 2018
by
Joseph Mulloy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add maintenance playbook wrapper script OPS-3164
parent
4f78d469
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
util/maintenance.sh
+42
-0
No files found.
util/maintenance.sh
0 → 100755
View file @
ebe3811c
#!/bin/bash
usage
()
{
echo
"Usage:
$0
environment-deploy (enable|disable)"
echo
echo
"Examples:"
echo
" Turn on maintenance page for stage-edx:
$0
stage-edx enable"
echo
" Turn off maintenance page for stage-edx:
$0
stage-edx disable"
exit
1
}
ED
=
$1
ENABLE_ARG
=
$2
case
$ED
in
loadtest-edx|stage-edx|prod-edx|prod-edge
)
;;
*
)
echo
"ERROR: environment-deploy must be one of loadtest-edx, stage-edx, prod-edx or prod-edge"
echo
usage
;;
esac
case
$ENABLE_ARG
in
enable
)
ENABLE
=
"True"
;;
disable
)
ENABLE
=
"False"
;;
*
)
echo
"ERROR: must specify enable or disable"
echo
usage
;;
esac
INVENTORY
=
$(
aws ec2 describe-instances
--filter
"Name=tag:Name,Values=
${
ED
}
-edxapp,
${
ED
}
-studio,
${
ED
}
-worker"
--query
'Reservations[].Instances[].PrivateIpAddress'
--output
text | tr
'\t'
','
)
ENABLE_EXTRA_VAR
=
"{
\"
ENABLE_MAINTENANCE
\"
:
${
ENABLE
}
}"
ansible-playbook ./edx_maintenance.yml
-i
"
${
INVENTORY
}
,"
-e
"
${
ENABLE_EXTRA_VAR
}
"
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