Update the Jenkinsfile to blow everything out into parallel agents
This is likely going to crater, but let's try!
This commit is contained in:
parent
e964180833
commit
38df410a37
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env groovy
|
#!/usr/bin/env groovy
|
||||||
|
|
||||||
|
def rubies = ['2.3.0', '2.3.1', '2.2.5', 'jruby', 'jruby-9.1.2.0', 'rubinius']
|
||||||
|
|
||||||
node('docker') {
|
node('docker') {
|
||||||
checkout scm
|
checkout scm
|
||||||
|
@ -7,17 +8,29 @@ node('docker') {
|
||||||
stage 'Prepare base RVM container'
|
stage 'Prepare base RVM container'
|
||||||
sh './build-base.sh'
|
sh './build-base.sh'
|
||||||
|
|
||||||
stage 'Build Containers for Rubies'
|
stage 'Push base RVM container'
|
||||||
sh './build-rubies.sh'
|
sh './push-base.sh'
|
||||||
|
|
||||||
stage 'Publish Containers'
|
stage 'Build Containers for Rubies'
|
||||||
/* Using credentials with the ID 'dockerhub' from the Jenkins installation */
|
def stepsForParallel = [:]
|
||||||
withCredentials([[$class: 'UsernamePasswordMultiBinding',
|
for (int i = 0; i < rubies.size(); i++) {
|
||||||
credentialsId: 'dockerhub',
|
def ruby = rubies.get(i)
|
||||||
passwordVariable: 'DOCKERHUB_TOKEN',
|
stepsForParallel[ruby] = {
|
||||||
usernameVariable: 'DOCKERHUB_USERNAME']]) {
|
node {
|
||||||
/* Our variables be exposed in the environment and we must log in before trying to publish to Dockerhub */
|
sh "./build-rubies.sh ${ruby}"
|
||||||
sh 'docker login --username=${DOCKERHUB_USERNAME} --email=tyler@monkeypox.org --password=${DOCKERHUB_TOKEN}'
|
sh './pu
|
||||||
sh './push-rubies.sh'
|
/* Using credentials with the ID 'dockerhub' from the Jenkins installation */
|
||||||
|
withCredentials([[$class: 'UsernamePasswordMultiBinding',
|
||||||
|
credentialsId: 'dockerhub',
|
||||||
|
passwordVariable: 'DOCKERHUB_TOKEN',
|
||||||
|
usernameVariable: 'DOCKERHUB_USERNAME']]) {
|
||||||
|
/* Our variables be exposed in the environment and we must log in before trying to publish to Dockerhub */
|
||||||
|
sh 'docker login --username=${DOCKERHUB_USERNAME} --email=tyler@monkeypox.org --password=${DOCKERHUB_TOKEN}'
|
||||||
|
sh "./push-rubies.sh ${ruby}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
/* Fan everything out like crazy */
|
||||||
|
parallel(stepsForParallel)
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,10 @@ source ./rubies
|
||||||
|
|
||||||
mkdir -p work
|
mkdir -p work
|
||||||
|
|
||||||
|
if [ -n $1 ]; then
|
||||||
|
RUBIES=( "${1}" )
|
||||||
|
fi;
|
||||||
|
|
||||||
for RUBY in "${RUBIES[@]}"; do
|
for RUBY in "${RUBIES[@]}"; do
|
||||||
DOCKERFILE="work/dockerfile-${RUBY}"
|
DOCKERFILE="work/dockerfile-${RUBY}"
|
||||||
cat > $DOCKERFILE <<EOF
|
cat > $DOCKERFILE <<EOF
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
source ./rubies
|
||||||
|
exec docker push ${IMAGE_TAG}:latest
|
|
@ -4,7 +4,9 @@ set -x
|
||||||
|
|
||||||
source ./rubies
|
source ./rubies
|
||||||
|
|
||||||
docker push ${IMAGE_TAG}:latest
|
if [ -n $1 ]; then
|
||||||
|
RUBIES=( "${1}" )
|
||||||
|
fi;
|
||||||
|
|
||||||
for RUBY in "${RUBIES[@]}"; do
|
for RUBY in "${RUBIES[@]}"; do
|
||||||
echo "> Pushing ${IMAGE_TAG}:${RUBY}"
|
echo "> Pushing ${IMAGE_TAG}:${RUBY}"
|
||||||
|
|
Loading…
Reference in New Issue