Skip to content

Commit

Permalink
Fix Jenkins build for non-master branch
Browse files Browse the repository at this point in the history
(trying to)
  • Loading branch information
mederly committed Oct 5, 2018
1 parent 05ee033 commit 7ff6d95
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
4 changes: 1 addition & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ pipeline {
steps {
script {
try {
sh '(ls -l ; docker ps -a ; docker image ls ; echo Destroying ; bin/destroy.sh ; docker image ls) 2>&1 | tee debug' // temporary
sh './download-midpoint 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0'
sh 'bin/rebuild.sh 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0'
//sh 'echo Build output ; cat debug'
sh './jenkins-rebuild.sh 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0' // temporary
} catch (error) {
def error_details = readFile('./debug')
def message = "BUILD ERROR: There was a problem building ${imagename}:${tag}. \n\n ${error_details}"
Expand Down
17 changes: 17 additions & 0 deletions jenkins-rebuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Temporary workaround for docker/util not rebuilding the specific version of the image

# from destroy.sh (adapted)

result=$(docker ps -a | grep $maintainer/$imagename:$tag)

if [ ! -z "$result" ]; then
docker rm -f $(docker ps -a | grep $maintainer/$imagename:$tag | awk '{print $1}')
docker rmi -f $maintainer/$imagename:$tag
fi

# from build.sh (adapted)

echo "Building new Docker image($maintainer/$imagename:$tag)"
docker build --rm -t $maintainer/$imagename:$tag --build-arg maintainer=$maintainer --build-arg imagename=$imagename .

0 comments on commit 7ff6d95

Please sign in to comment.