diff --git a/BINSCRIPTS.md b/BINSCRIPTS.md index c25c1ff..8569b7d 100644 --- a/BINSCRIPTS.md +++ b/BINSCRIPTS.md @@ -4,9 +4,12 @@ This repository is intended to be downloaded into a container repository during ## Install -To use these scripts on your container image construction project, issue these commands in the root directory of your container project: +If you are reading this file in BINSCRIPTS.md, your container project is likely to be util-enabled. + +To use these scripts yourself, issue this command: ``` +curl "https://github.internet2.edu/raw/docker/util/master/bin/install.sh?token=AAAAEddkrL9MeeA6VWcNn_PgV30r4lD1ks5XogeiwA%3D%3D" | bash ``` ### common.bash @@ -15,13 +18,17 @@ The installation process will create a common.bash file. This file should be th You should edit this file to change the image name, and add any other helpful environment variables. +### Jenkinsfile + +This will also install a Jenkinsfile to your repository, if it doesn't have one. This will ensure that your Jenkins pipeline can leverage these scripts in the way intended. Ensuring the commands that you issue on your laptop match the commands issued by the build pipeline is critical to ensure predictable, reliable results. + ## Use ### Building #### build.sh -`bin/build ` +`bin/build.sh ` #### destroy.sh #### rebuild.sh diff --git a/Dockerfile b/Dockerfile index 55b5a73..7cebae7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,4 +46,6 @@ RUN mkdir -p /tmp/shibboleth && cd /tmp/shibboleth && \ mv $SHIB_PREFIX /opt/shibboleth/. && \ ln -s /opt/shibboleth/$SHIB_PREFIX /opt/shibboleth/current && \ # Cleanup - rm -rf /tmp/shibboleth \ No newline at end of file + rm -rf /tmp/shibboleth + +ONBUILD ADD ./root/* /opt/shibboleth/$SHIB_PREFIX \ No newline at end of file diff --git a/tests/shibboleth-idp.bats b/tests/shibboleth-idp.bats index a2b2640..1190e9d 100644 --- a/tests/shibboleth-idp.bats +++ b/tests/shibboleth-idp.bats @@ -2,6 +2,10 @@ load ../common +setup() { + ./bin/rebuild.sh +} + @test "Creates non-root Shib IDP home" { result="$(docker run -i bigfleet/shibboleth_idp ls /opt/shibboleth/current/bin/)" [ "$result" != '' ] @@ -15,4 +19,9 @@ load ../common @test "Contains java" { run docker run -i bigfleet/shibboleth_idp which java [ "$status" -eq 0 ] +} + +@test "Defers configuration via ONBUILD" { + run grep ONBUILD Dockerfile + [ "$status" -eq 0 ] } \ No newline at end of file