Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adapt directory structure to docker/util
The container is now built directly from the root directory.
Even the simplest composition was moved to demo/plain.
mederly committed Sep 27, 2018
1 parent ce27088 commit 55fcd70
Showing 40 changed files with 19 additions and 30 deletions.
File renamed without changes.
43 changes: 16 additions & 27 deletions Jenkinsfile
@@ -6,49 +6,36 @@ pipeline {
tag = 'l'
}
stages {
stage('Setting build context') {
stage ('Setting build context') {
steps {
script {
maintainer = maintain()
imagename = imagename()
if(env.BRANCH_NAME == "master" || env.BRANCH_NAME == "bats") { // temporary
if (env.BRANCH_NAME == "master" || env.BRANCH_NAME == "bats") { // temporary
tag = "latest"
} else {
tag = env.BRANCH_NAME
}
if(!imagename){
if (!imagename) {
echo "You must define imagename in common.bash"
currentBuild.result = 'FAILURE'
}
}
sh 'mkdir -p bin'
sh 'mkdir -p tmp'
dir('tmp') {
git([ url: "https://github.internet2.edu/docker/util.git", credentialsId: "jenkins-github-access-token" ])
sh 'ls'
sh 'mv bin/* ../bin/.'
dir ('tmp') {
git([ url: "https://github.internet2.edu/docker/util.git", credentialsId: "jenkins-github-access-token" ])
sh 'ls'
sh 'mv bin/* ../bin/.'
}
}
}
}
stage ('Clean') {
steps {
script {
try {
sh 'bin/destroy.sh >> debug'
} catch (error) {
def error_details = readFile('./debug');
def message = "BUILD ERROR: There was a problem building the Base Image. \n\n ${error_details}"
sh "rm -f ./debug"
handleError(message)
}
}
}
}
}
stage ('Build') {
steps {
script {
try {
sh '(set -e ; cd midpoint ; ./download-midpoint ; ../bin/build.sh) &> debug'
sh './download-midpoint &> debug'
sh 'bin/rebuild.sh &>> debug'
} catch (error) {
def error_details = readFile('./debug')
def message = "BUILD ERROR: There was a problem building ${imagename}:${tag}. \n\n ${error_details}"
@@ -62,16 +49,17 @@ pipeline {
steps {
script {
try {
sh 'bats midpoint/tests &> debug'
sh 'bin/test.sh &> debug'
} catch (error) {
def error_details = readFile('./debug')
def message = "BUILD ERROR: There was a problem building ${imagename}:${tag}. \n\n ${error_details}"
def message = "BUILD ERROR: There was a problem testing ${imagename}:${tag}. \n\n ${error_details}"
sh "rm -f ./debug"
handleError(message)
}
}
}
}
/*
stage ('Test2') {
steps {
script {
@@ -91,10 +79,11 @@ pipeline {
}
}
}
*/
stage ('Push') {
steps {
script {
docker.withRegistry('https://registry.hub.docker.com/', "dockerhub-$maintainer") {
docker.withRegistry('https://registry.hub.docker.com/', "dockerhub-$maintainer") {
def baseImg = docker.build("$maintainer/$imagename")
baseImg.push("$tag")
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -14,7 +14,7 @@ services:
- CREATE_NEW_DATABASE=if_needed

midpoint-server:
build: ./midpoint-server/
image: tier/midpoint:latest
ports:
- 8443:443
environment:
4 changes: 2 additions & 2 deletions midpoint/download-midpoint → download-midpoint
@@ -3,10 +3,10 @@
dir=`dirname "$0"`
echo "Downloading midPoint 3.9-SNAPSHOT"
echo "-----------------------------------------"
curl --output $dir/midpoint-server/midpoint-3.9-SNAPSHOT-dist.tar.gz "https://evolveum.com/downloads/midpoint-tier/midpoint-3.9-SNAPSHOT-dist.tar.gz"
curl --output $dir/midpoint-3.9-SNAPSHOT-dist.tar.gz "https://evolveum.com/downloads/midpoint-tier/midpoint-3.9-SNAPSHOT-dist.tar.gz"
echo "-----------------------------------------"
echo "Checking the download..."
if tar -tf $dir/midpoint-server/midpoint-3.9-SNAPSHOT-dist.tar.gz >/dev/null; then
if tar -tf $dir/midpoint-3.9-SNAPSHOT-dist.tar.gz >/dev/null; then
echo "OK"
else
echo "The file was not downloaded correctly"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 55fcd70

Please sign in to comment.