abstract docker image tags to shared variable

refs DE-24

flag = none

Test Plan:

- Main Build
- Main Build (PG12)
- Main-From-Plugin Build
- Master Bouncer
- Translations
- Performance (Chrome)
- Flakey Spec Catcher
- Coverage, from canvas-builds

Change-Id: I9f1d44d5c9725ed2e1ca9c66a4d5b2836ea78168
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/241292
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
This commit is contained in:
Aaron Ogata 2020-06-26 12:37:32 -07:00
parent b94fa0aba3
commit 841ef7933d
5 changed files with 36 additions and 16 deletions

22
Jenkinsfile vendored
View File

@ -134,6 +134,10 @@ pipeline {
RUBY_IMAGE = "$BUILD_IMAGE-ruby"
RUBY_MERGE_IMAGE = "$RUBY_IMAGE:$GERRIT_BRANCH"
RUBY_PATCHSET_IMAGE = "$RUBY_IMAGE:$NAME-$TAG_SUFFIX"
CASSANDRA_IMAGE_TAG=imageTag.cassandra()
DYNAMODB_IMAGE_TAG=imageTag.dynamodb()
POSTGRES_IMAGE_TAG=imageTag.postgres()
}
stages {
@ -283,7 +287,11 @@ pipeline {
echo 'adding Vendored Gems'
stages['Vendored Gems'] = {
skipIfPreviouslySuccessful("vendored-gems") {
wrapBuildExecution('/Canvas/test-suites/vendored-gems', buildParameters, true, "")
wrapBuildExecution('/Canvas/test-suites/vendored-gems', buildParameters + [
string(name: 'CASSANDRA_IMAGE_TAG', value: "${env.CASSANDRA_IMAGE_TAG}"),
string(name: 'DYNAMODB_IMAGE_TAG', value: "${env.DYNAMODB_IMAGE_TAG}"),
string(name: 'POSTGRES_IMAGE_TAG', value: "${env.POSTGRES_IMAGE_TAG}"),
], true, "")
}
}
@ -308,7 +316,11 @@ pipeline {
echo 'adding Contract Tests'
stages['Contract Tests'] = {
skipIfPreviouslySuccessful("contract-tests") {
wrapBuildExecution('/Canvas/test-suites/contract-tests', buildParameters, true, "")
wrapBuildExecution('/Canvas/test-suites/contract-tests', buildParameters + [
string(name: 'CASSANDRA_IMAGE_TAG', value: "${env.CASSANDRA_IMAGE_TAG}"),
string(name: 'DYNAMODB_IMAGE_TAG', value: "${env.DYNAMODB_IMAGE_TAG}"),
string(name: 'POSTGRES_IMAGE_TAG', value: "${env.POSTGRES_IMAGE_TAG}"),
], true, "")
}
}
@ -318,7 +330,11 @@ pipeline {
skipIfPreviouslySuccessful("flakey-spec-catcher") {
def propagate = configuration.fscPropagate()
echo "fsc propagation: $propagate"
wrapBuildExecution('/Canvas/test-suites/flakey-spec-catcher', buildParameters, propagate, "")
wrapBuildExecution('/Canvas/test-suites/flakey-spec-catcher', buildParameters + [
string(name: 'CASSANDRA_IMAGE_TAG', value: "${env.CASSANDRA_IMAGE_TAG}"),
string(name: 'DYNAMODB_IMAGE_TAG', value: "${env.DYNAMODB_IMAGE_TAG}"),
string(name: 'POSTGRES_IMAGE_TAG', value: "${env.POSTGRES_IMAGE_TAG}"),
], propagate, "")
}
}
}

View File

@ -38,6 +38,10 @@ pipeline {
RERUNS_RETRY = 0 // no reruns
POSTGRES_PASSWORD = 'sekret'
SELENIUM_VERSION = "3.141.59-20200525"
CASSANDRA_IMAGE_TAG=imageTag.cassandra()
DYNAMODB_IMAGE_TAG=imageTag.dynamodb()
POSTGRES_IMAGE_TAG=imageTag.postgres()
}
stages {

View File

@ -17,16 +17,16 @@ POSTGIS=${POSTGIS:-2.5}
./build/new-jenkins/docker-with-flakey-network-protection.sh push $REGISTRY_BASE/redis:alpine)
# postgres database with postgis preinstalled
./build/new-jenkins/docker-with-flakey-network-protection.sh pull $REGISTRY_BASE/postgis:"$POSTGRES-$POSTGIS" || \
(docker build -t $REGISTRY_BASE/postgis:"$POSTGRES"-"$POSTGIS" build/docker-compose/postgres && \
./build/new-jenkins/docker-with-flakey-network-protection.sh push $REGISTRY_BASE/postgis:"$POSTGRES"-"$POSTGIS")
./build/new-jenkins/docker-with-flakey-network-protection.sh pull $POSTGRES_IMAGE_TAG || \
(docker build -t $POSTGRES_IMAGE_TAG build/docker-compose/postgres && \
./build/new-jenkins/docker-with-flakey-network-protection.sh push $POSTGRES_IMAGE_TAG)
# cassandra:2:2
./build/new-jenkins/docker-with-flakey-network-protection.sh pull $REGISTRY_BASE/cassandra:2.2 || \
(docker build -t $REGISTRY_BASE/cassandra:2.2 build/docker-compose/cassandra && \
./build/new-jenkins/docker-with-flakey-network-protection.sh push $REGISTRY_BASE/cassandra:2.2)
./build/new-jenkins/docker-with-flakey-network-protection.sh pull $CASSANDRA_IMAGE_TAG || \
(docker build -f build/docker-compose/cassandra/Dockerfile.cachable -t $CASSANDRA_IMAGE_TAG build/docker-compose/cassandra && \
./build/new-jenkins/docker-with-flakey-network-protection.sh push $CASSANDRA_IMAGE_TAG)
# dynamodb-local
./build/new-jenkins/docker-with-flakey-network-protection.sh pull $REGISTRY_BASE/dynamodb-local || \
(docker build -t $REGISTRY_BASE/dynamodb-local build/docker-compose/dynamodb && \
./build/new-jenkins/docker-with-flakey-network-protection.sh push $REGISTRY_BASE/dynamodb-local)
./build/new-jenkins/docker-with-flakey-network-protection.sh pull $DYNAMODB_IMAGE_TAG || \
(docker build -t $DYNAMODB_IMAGE_TAG build/docker-compose/dynamodb && \
./build/new-jenkins/docker-with-flakey-network-protection.sh push $DYNAMODB_IMAGE_TAG)

View File

@ -22,7 +22,7 @@ services:
init: true
postgres:
image: starlord.inscloudgate.net/jenkins/postgis:$POSTGRES-2.5
image: $POSTGRES_IMAGE_TAG
environment:
POSTGRES_PASSWORD: sekret
init: true

View File

@ -34,18 +34,18 @@ services:
init: true
postgres:
image: starlord.inscloudgate.net/jenkins/postgis:$POSTGRES-${POSTGIS:-2.5}
image: $POSTGRES_IMAGE_TAG
environment:
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
init: true
cassandra:
image: starlord.inscloudgate.net/jenkins/cassandra:2.2
image: $CASSANDRA_IMAGE_TAG
environment:
CASSANDRA_START_RPC: 'true'
init: true
dynamodb:
image: starlord.inscloudgate.net/jenkins/dynamodb-local
image: $DYNAMODB_IMAGE_TAG
command: -jar DynamoDBLocal.jar
init: true