move wait-for-it code to build-up
refs DE-168 The upcoming migrations cache will no longer call setup-databases.sh in patchsets without a new migration. We still need to wait for these containers to spin up, so move it to build-up.sh Test Plan: 1. Jenkins passes 2. FSC passes 3. Chrome performance passes Change-Id: I157ff04a1a008193bbee4e8b74369264fa387785 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244121 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: James Butters <jbutters@instructure.com> QA-Review: Aaron Ogata <aogata@instructure.com> Product-Review: Aaron Ogata <aogata@instructure.com>
This commit is contained in:
parent
297a664980
commit
fabe20f12d
|
@ -4,6 +4,12 @@ set -o errexit -o errtrace -o nounset -o pipefail -o xtrace
|
|||
# ':' is a bash "no-op" and then we pass an empty argument which isn't used
|
||||
parallel --will-cite ::: :
|
||||
|
||||
PROCESSES=$((${DOCKER_PROCESSES:=1}-1))
|
||||
|
||||
docker-compose build
|
||||
|
||||
seq 0 $((${DOCKER_PROCESSES:=1}-1)) | parallel "docker-compose --project-name canvas-lms{} up -d"
|
||||
seq 0 $PROCESSES | parallel "docker-compose --project-name canvas-lms{} up -d"
|
||||
|
||||
for service in cassandra:9160 postgres:5432 dynamodb:8000 redis:6379; do
|
||||
seq 0 $PROCESSES | parallel "docker-compose --project-name canvas-lms{} exec -T canvas ./build/new-jenkins/wait-for-it ${service}"
|
||||
done
|
||||
|
|
|
@ -6,20 +6,11 @@ parallel --will-cite ::: :
|
|||
|
||||
PROCESSES=$((${DOCKER_PROCESSES:=1}-1))
|
||||
|
||||
seq 0 $PROCESSES | parallel "docker-compose --project-name canvas-lms{} exec -T canvas ./build/new-jenkins/wait-for-it cassandra:9160"
|
||||
|
||||
create_cmd=""
|
||||
for keyspace in auditors global_lookups page_views; do
|
||||
create_cmd+="CREATE KEYSPACE IF NOT EXISTS ${keyspace} WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };"
|
||||
done
|
||||
seq 0 $PROCESSES | parallel "docker-compose --project-name canvas-lms{} exec -T cassandra cqlsh -e \"${create_cmd[@]}\""
|
||||
|
||||
# migrations cannot complete until postgres, dynamodb, and cassandra are up.
|
||||
# (cassandra was verified above) redis is included here for completion but
|
||||
# isn't necessary for migrations
|
||||
for service in postgres:5432 dynamodb:8000 redis:6379; do
|
||||
seq 0 $PROCESSES | parallel "docker-compose --project-name canvas-lms{} exec -T canvas ./build/new-jenkins/wait-for-it ${service}"
|
||||
done
|
||||
|
||||
seq 0 $PROCESSES | parallel "docker-compose --project-name canvas-lms{} exec -T -e VERBOSE=false canvas bundle exec rails db:migrate"
|
||||
seq 0 $PROCESSES | parallel "docker-compose --project-name canvas-lms{} exec -T canvas bundle exec rails runner \"require 'switchman/test_helper'; Switchman::TestHelper.recreate_persistent_test_shards\""
|
||||
|
|
Loading…
Reference in New Issue