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
|
||||
|
||||
def rubies = ['2.3.0', '2.3.1', '2.2.5', 'jruby', 'jruby-9.1.2.0', 'rubinius']
|
||||
|
||||
node('docker') {
|
||||
checkout scm
|
||||
|
@ -7,17 +8,29 @@ node('docker') {
|
|||
stage 'Prepare base RVM container'
|
||||
sh './build-base.sh'
|
||||
|
||||
stage 'Build Containers for Rubies'
|
||||
sh './build-rubies.sh'
|
||||
stage 'Push base RVM container'
|
||||
sh './push-base.sh'
|
||||
|
||||
stage 'Publish Containers'
|
||||
/* 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'
|
||||
stage 'Build Containers for Rubies'
|
||||
def stepsForParallel = [:]
|
||||
for (int i = 0; i < rubies.size(); i++) {
|
||||
def ruby = rubies.get(i)
|
||||
stepsForParallel[ruby] = {
|
||||
node {
|
||||
sh "./build-rubies.sh ${ruby}"
|
||||
sh './pu
|
||||
/* 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
|
||||
|
||||
if [ -n $1 ]; then
|
||||
RUBIES=( "${1}" )
|
||||
fi;
|
||||
|
||||
for RUBY in "${RUBIES[@]}"; do
|
||||
DOCKERFILE="work/dockerfile-${RUBY}"
|
||||
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
|
||||
|
||||
docker push ${IMAGE_TAG}:latest
|
||||
if [ -n $1 ]; then
|
||||
RUBIES=( "${1}" )
|
||||
fi;
|
||||
|
||||
for RUBY in "${RUBIES[@]}"; do
|
||||
echo "> Pushing ${IMAGE_TAG}:${RUBY}"
|
||||
|
|
Loading…
Reference in New Issue