Skip to content

Commit

Permalink
Downloads the Shib IDP distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Van Fleet committed Jul 27, 2016
1 parent e759b5a commit 32f50f1
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ bin/rebuild.sh
bin/rerun.sh
bin/run.sh
bin/test.sh
root/**
shibboleth-identity-provider.tar.gz
39 changes: 36 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node {

stage 'Checkout'

checkout scm
Expand All @@ -13,14 +13,47 @@ node {
sh 'ls'
sh 'mv bin/* .'
}

stage 'Base'

stage 'Build'

def maintainer = maintainer()
def imagename = imagename()
def tag = env.BRANCH_NAME
if(!imagename){
echo "You must define an imagename in common.bash"
currentBuild.result = 'FAILURE'
}
if(maintainer){
echo "Building ${maintainer}:${tag} for ${maintainer}"
}

sh 'bin/build.sh'

stage 'Tests'

sh 'bin/test.sh'

stage 'Push'

docker.withRegistry('https://registry.hub.docker.com/', "dockerhub-$maintainer") {
def baseImg = docker.build("$maintainer/$imagename")
baseImg.push("$tag")
}


}

def maintainer() {
def matcher = readFile('common.bash') =~ 'maintainer="(.+)"'
matcher ? matcher[0][1] : 'tier'
}

def imagename() {
def matcher = readFile('common.bash') =~ 'imagename="(.+)"'
matcher ? matcher[0][1] : null
}

def version() {
def matcher = readFile('common.bash') =~ 'version="(.+)"'
matcher ? matcher[0][1] : null
}
11 changes: 11 additions & 0 deletions bin/download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

source common.bash .

rm -rf root
if [ ! -f shibboleth-identity-provider.tar.gz ]; then
curl -o shibboleth-identity-provider.tar.gz "https://shibboleth.net/downloads/identity-provider/latest/shibboleth-identity-provider-$version.tar.gz"
tar xvf shibboleth-identity-provider.tar.gz
mv shibboleth-identity-provider-$version root
fi
#curl -o shibboleth-identity-provider-3.2.1.tar.gz https://shibboleth.net/downloads/identity-provider/latest/shibboleth-identity-provider-3.2.1.tar.gz
5 changes: 3 additions & 2 deletions common.bash
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
maintainer="tier"
imagename="imagename-replaceme-in-common-bash"
maintainer="bigfleet"
imagename="shibboleth_idp_runtime"
version="3.2.1"

0 comments on commit 32f50f1

Please sign in to comment.