Skip to content
Permalink
Browse files

Cleanup tag-specific building

  • Loading branch information
mederly committed Oct 5, 2018
1 parent 7ff6d95 commit 3b8dcd87df78485124d1c5bf98d9c72b886fa5fe
Showing with 23 additions and 8 deletions.
  1. +2 −2 Dockerfile
  2. +7 −1 Jenkinsfile
  3. +9 −5 download-midpoint
  4. +5 −0 jenkins-rebuild.sh
@@ -50,7 +50,7 @@ RUN cp /dev/null /etc/httpd/conf.d/ssl.conf \
# Build arguments

ARG MP_VERSION=3.9-SNAPSHOT
ARG MP_DIST_FILE=midpoint-${MP_VERSION}-dist.tar.gz
ARG MP_DIST_FILE=midpoint-dist.tar.gz

ENV MP_DIR /opt/midpoint

@@ -60,7 +60,7 @@ COPY ${MP_DIST_FILE} ${MP_DIR}
COPY container_files/mp-dir/ ${MP_DIR}/

RUN echo 'Extracting midPoint archive...' \
&& tar xzf ${MP_DIR}/midpoint-${MP_VERSION}-dist.tar.gz -C ${MP_DIR} --strip-components=1
&& tar xzf ${MP_DIR}/${MP_DIST_FILE} -C ${MP_DIR} --strip-components=1

VOLUME ${MP_DIR}/var

@@ -27,14 +27,20 @@ pipeline {
sh 'ls'
sh 'mv bin/* ../bin/.'
}
sh "echo \"tag=\\\"${tag}\\\"\" > tag.bash ; chmod a+x tag.bash ; echo tag.bash ; cat tag.bash'
}
}
}
stage ('Build') {
steps {
script {
try {
sh './download-midpoint 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0'
if (env.BRANCH_NAME == "master") {
toDownload = "3.9-SNAPSHOT"
} else {
toDownload = env.BRANCH_NAME
}
sh "./download-midpoint ${toDownload} 2>&1 | tee -a debug ; test \${PIPESTATUS[0]} -eq 0"
sh './jenkins-rebuild.sh 2>&1 | tee -a debug ; test ${PIPESTATUS[0]} -eq 0' // temporary
} catch (error) {
def error_details = readFile('./debug')
@@ -1,16 +1,20 @@
#!/bin/bash

dir=`dirname "$0"`
echo "Downloading midPoint 3.9-SNAPSHOT"
DIR=`dirname "$0"`
if [[ -n "$1" ]]; then
MP_VERSION=$1
else
MP_VERSION=3.9-SNAPSHOT
fi
echo "Downloading midPoint $MP_VERSION"
echo "-----------------------------------------"
curl --output $dir/midpoint-3.9-SNAPSHOT-dist.tar.gz "https://evolveum.com/downloads/midpoint-tier/midpoint-3.9-SNAPSHOT-dist.tar.gz"
curl --output $dir/midpoint-dist.tar.gz "https://evolveum.com/downloads/midpoint-tier/midpoint-$MP_VERSION-dist.tar.gz"
echo "-----------------------------------------"
echo "Checking the download..."
if tar -tf $dir/midpoint-3.9-SNAPSHOT-dist.tar.gz >/dev/null; then
if tar -tf $dir/midpoint-dist.tar.gz >/dev/null; then
echo "OK"
exit 0
else
echo "The file was not downloaded correctly"
exit 1
fi

@@ -4,6 +4,11 @@

# from destroy.sh (adapted)

source common.bash
source tag.bash

echo "Rebuilding $maintainer/$imagename:$tag..."

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

if [ ! -z "$result" ]; then

0 comments on commit 3b8dcd8

Please sign in to comment.
You can’t perform that action at this time.