Skip to content

Onbuild era #12

Merged
3 commits merged into from
Jul 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ]
}