Skip to content

Commit

Permalink
Merge pull request #45 from concourse/bionic-base-image
Browse files Browse the repository at this point in the history
Migrating to ubuntu base image
  • Loading branch information
cirocosta authored Mar 26, 2019
2 parents eefe6db + c9f2855 commit 393be10
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 5 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ of the same pool), you would put that name instead. For example:
work.
* docker is *required* - version 17.06.x is tested; earlier versions may also
work.
* godep is used for dependency management of the golang packages.
### Running the tests
Expand All @@ -221,10 +222,11 @@ environment is consistent across any `docker` enabled platform. When the docker
image builds, the test are run inside the docker container, on failure they
will stop the build.
Run the tests with the following command:
Run the tests with the following commands for both `alpine` and `ubuntu` images:
```sh
docker build -t pool-resource .
docker build -t pool-resource -f dockerfiles/alpine/Dockerfile .
docker build -t pool-resource -f dockerfiles/ubuntu/Dockerfile .
```

### Contributing
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile → dockerfiles/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN set -e; for pkg in $(go list ./...); do \
go test -o "/tests/$(basename $pkg).test" -c $pkg; \
done

FROM concourse/git-resource AS resource
FROM concourse/git-resource:alpine AS resource

ADD assets/ /opt/resource/
RUN chmod +x /opt/resource/*
Expand Down
28 changes: 28 additions & 0 deletions dockerfiles/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM concourse/golang-builder as builder
COPY . /go/src/github.com/concourse/pool-resource
ENV CGO_ENABLED 0
ENV GOPATH /go/src/github.com/concourse/pool-resource/Godeps/_workspace:${GOPATH}
ENV PATH /go/src/github.com/concourse/pool-resource/Godeps/_workspace/bin:${PATH}
RUN go build -o /assets/out github.com/concourse/pool-resource/cmd/out
RUN set -e; for pkg in $(go list ./...); do \
go test -o "/tests/$(basename $pkg).test" -c $pkg; \
done

FROM concourse/git-resource:ubuntu AS resource

ADD assets/ /opt/resource/
RUN chmod +x /opt/resource/*

COPY --from=builder /assets /opt/go
RUN chmod +x /opt/go/out

FROM resource AS tests
COPY --from=builder /tests /go/resource-tests/
RUN set -e; for test in /go/resource-tests/*.test; do \
$test; \
done

ADD test/ /opt/resource-tests
RUN /opt/resource-tests/all.sh

FROM resource
2 changes: 1 addition & 1 deletion test/all.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion test/check.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

set -e

Expand Down

0 comments on commit 393be10

Please sign in to comment.