forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes OUT-2367 There are now two scripts: - docker_dev_setup.sh: will create / recreate the service and all databases locally - docker_dev_update.sh: can be used to migrate the local master branch. Will also pull plugin changes and run the relevant migrations. Both scripts now directly use parts of canvas_update under the hood, which will hopefully make future workflow changes less painful. Test Plan: - With docker: - optional: create a new canvas checkout (you can use a different directory name to avoid destroying your current database) - git fetch - check out this gerrit, and use `git checkout -b 2367` to create a branch for it - git checkout origin/master~200 - git checkout 2367 -- script - ./script/docker_dev_setup.sh (follow all prompts) - docker-compose up -d - login, accept the terms of use - docker-compose down - git checkout master - ./script/docker_dev_update.sh -n code - docker-compose up -d - login, verify you are not asked for terms of use and the school name is the same as before. - docker-compose down - ./script/docker_dev_setup.sh again (nuke the old database, change the root account name) - docker-compose up -d - login, accept the terms of use, verify the new account name Change-Id: Ie40600d7ea1e90633d9139b4cc1cf853695ac8f8 Reviewed-on: https://gerrit.instructure.com/151547 Tested-by: Jenkins Reviewed-by: Michael Brewer-Davis <mbd@instructure.com> Reviewed-by: Augusto Callejas <acallejas@instructure.com> QA-Review: Dariusz Dzien <ddzien@instructure.com> Product-Review: Neil Gupta <ngupta@instructure.com>
- Loading branch information
1 parent
6390aa0
commit 4159e09
Showing
4 changed files
with
137 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash -e | ||
|
||
usage () { | ||
echo "usage: $0 [-f] [-h] [-n phase]" | ||
} | ||
|
||
bad_usage () { | ||
usage | ||
exit 1 | ||
} | ||
|
||
while getopts ":fhn:" opt | ||
do | ||
case $opt in | ||
n ) | ||
case $OPTARG in | ||
build ) | ||
SKIP_BUILD=true;; | ||
code ) | ||
SKIP_CODE=true;; | ||
* ) | ||
bad_usage;; | ||
esac | ||
echo "Skipping $OPTARG";; | ||
f ) | ||
FORCE=yes;; | ||
h ) | ||
usage;; | ||
* ) | ||
echo "Sorry, -$OPTARG is not a valid option!" | ||
bad_usage;; | ||
esac | ||
done | ||
|
||
if [[ -z "$FORCE" && "$(docker-compose ps | wc -l)" -gt 2 ]] ; then | ||
echo "You should probably stop services before running this command" | ||
echo "(use -f to skip this check)" | ||
exit 1 | ||
fi | ||
|
||
[[ -z "$SKIP_CODE" ]] && ./script/canvas_update -n data | ||
[[ -z "$SKIP_BUILD" ]] && docker-compose build --pull | ||
if [[ -z "$SKIP_BUILD" ]] ; then | ||
# assets are currently compiled during dc build --pull | ||
docker-compose run --rm web ./script/canvas_update -n code -n assets | ||
else | ||
docker-compose run --rm web ./script/canvas_update -n code | ||
fi |