-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests and scripts to support building IDP image
- Loading branch information
Jim Van Fleet
committed
Jul 18, 2016
0 parents
commit a27b112
Showing
11 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| FROM bigfleet/centos7base | ||
|
|
||
| # Establish a default value for critical variables | ||
| # These values are not used by bin scripts or the pipeline. | ||
| # Those values are set in common.bash | ||
| ARG registry=docker.io | ||
| ARG maintainer=tier | ||
| ARG imagename=shibboleth_idp | ||
| ARG version=3.2.1 | ||
|
|
||
| ENV VERSION=$version | ||
|
|
||
| MAINTAINER $maintainer | ||
| LABEL Vendor="Internet2" | ||
| LABEL ImageType="Shibboleth IDP Release" | ||
| LABEL ImageName=$imagename | ||
| LABEL ImageOS=centos7 | ||
| LABEL Version=$VERSION | ||
|
|
||
| CMD echo $VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| node { | ||
|
|
||
| env.DOCKERHUB_ACCOUNT = "bigfleet" | ||
| env.VERSION_TAG = "3.2.1" // latest version of the release | ||
| env.BUILD_TAG = "testing" // default tag to push for to the registry | ||
|
|
||
| stage 'Checkout' | ||
|
|
||
| checkout scm | ||
|
|
||
| stage 'Base' | ||
|
|
||
| sh './build_image.sh' | ||
|
|
||
| stage 'Tests' | ||
|
|
||
| sh '/usr/local/bin/bats tests/shibboleth-idp.bats' | ||
|
|
||
| stage 'Push' | ||
| if(env.BRANCH_NAME == "master") | ||
| docker.withRegistry('https://registry.hub.docker.com/', 'dockerhub-bigfleet') { | ||
| def baseImg = docker.build('bigfleet/centos7base') | ||
| baseImg.push('latest') | ||
| } | ||
|
|
||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Shibboleth IDP Container Images | ||
|
|
||
| This repository creates and distributes Shibboleth IDP images to Dockerhub. | ||
|
|
||
| ## Supported Images | ||
|
|
||
| ### Release image | ||
|
|
||
| These images track official releases of the software. The `master` branch produces these images, and the build pipeline distributes the results to Dockerhub. | ||
|
|
||
| ## Development | ||
|
|
||
| ### Configuration | ||
|
|
||
| To alter project configuration details (e.g. which version of the Shibboleth IDP software is the latest), refer to common.bash-- a file referenced by many places. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #!/bin/bash | ||
|
|
||
| source common.bash . | ||
|
|
||
| echo "Building new Docker image($maintainer/$imagename)" | ||
| docker build --rm -t $maintainer/$imagename --build-arg maintainer=$maintainer --build-arg imagename=$imagename --build-arg version=$version . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #!/bin/bash | ||
|
|
||
| source common.bash . | ||
|
|
||
| docker rm $(docker ps -a | grep $maintainer/$imagename | awk '{print $1}') | ||
| docker rmi $maintainer/$imagename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/bash | ||
|
|
||
| source bin/destroy.sh && source bin/build.sh && source bin/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/bin/bash | ||
|
|
||
| source common.bash . | ||
|
|
||
| docker rm $(docker ps -a | grep $maintainer/$imagename | awk '{print $1}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/bin/bash | ||
|
|
||
| source common.bash . | ||
|
|
||
| docker run $maintainer/$imagename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/bash | ||
|
|
||
| bats tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| registry="docker.io" | ||
| maintainer="bigfleet" | ||
| basename="shibboleth_idp" | ||
| imagename="shibboleth_idp" | ||
| version="3.2.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/usr/bin/env bats | ||
|
|
||
| load ../common | ||
|
|
||
| @test "file reading" { | ||
| result="$(echo $maintainer)" | ||
| [ "$result" = 'bigfleet' ] | ||
| } | ||
|
|
||
| @test "container output" { | ||
| result="$(docker run bigfleet/shibboleth_idp)" | ||
| [ "$result" = '3.2.1' ] | ||
| } |