Skip to content

Commit

Permalink
Merge pull request #12 from docker/onbuild-era
Browse files Browse the repository at this point in the history
Onbuild era
  • Loading branch information
Jim Van Fleet committed Jul 27, 2016
2 parents 583acd2 + 6c2c65f commit 467d536
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
11 changes: 9 additions & 2 deletions BINSCRIPTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
rm -rf /tmp/shibboleth

ONBUILD ADD ./root/* /opt/shibboleth/$SHIB_PREFIX
9 changes: 9 additions & 0 deletions tests/shibboleth-idp.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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" != '' ]
Expand All @@ -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 ]
}

0 comments on commit 467d536

Please sign in to comment.