Properly build the base image in the pipeline

This commit is contained in:
R. Tyler Croy 2016-08-03 12:29:39 -07:00
parent fbe1d22dd0
commit 2455edd631
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
3 changed files with 12 additions and 2 deletions

5
Jenkinsfile vendored
View File

@ -4,7 +4,10 @@
node('docker') {
checkout scm
stage 'Build Containers'
stage 'Prepare base RVM container'
sh './build-base.sh'
stage 'Build Containers for Rubies'
sh './build-rubies.sh'
stage 'Publish Containers'

7
build-base.sh Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -x
source ./rubies
docker build -t ${IMAGE_TAG} .

View File

@ -9,7 +9,7 @@ mkdir -p work
for RUBY in "${RUBIES[@]}"; do
DOCKERFILE="work/dockerfile-${RUBY}"
cat > $DOCKERFILE <<EOF
FROM rtyler/ci-rvm:latest
FROM ${IMAGE_TAG}:latest
RUN bash -c 'source /usr/local/rvm/scripts/rvm && rvm install ${RUBY}'
EOF