Skip to content

Commit

Permalink
Merge pull request #88 from concourse/bionic-base-image
Browse files Browse the repository at this point in the history
Migrating to ubuntu:bionic and golang-builder
  • Loading branch information
cirocosta authored Mar 26, 2019
2 parents 70e97f8 + 7483f6a commit c2a3d1c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 3 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,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 semver-resource .
docker build -t semver-resource -f dockerfiles/alpine/Dockerfile .
docker build -t semver-resource -f dockerfiles/ubuntu/Dockerfile .
```

#### Integration tests
Expand All @@ -247,7 +248,17 @@ You will need:
Run the tests with the following command, replacing each `build-arg` value with your own values:

```sh
docker build . -t semver-resource --build-arg SEMVER_TESTING_ACCESS_KEY_ID="some-key" --build-arg SEMVER_TESTING_SECRET_ACCESS_KEY="some-secret" --build-arg SEMVER_TESTING_BUCKET="some-bucket" --build-arg SEMVER_TESTING_REGION="some-region"
docker build . -t semver-resource -f dockerfiles/alpine/Dockerfile \
--build-arg SEMVER_TESTING_ACCESS_KEY_ID="some-key" \
--build-arg SEMVER_TESTING_SECRET_ACCESS_KEY="some-secret" \
--build-arg SEMVER_TESTING_BUCKET="some-bucket" \
--build-arg SEMVER_TESTING_REGION="some-region"
docker build . -t semver-resource -f dockerfiles/ubuntu/Dockerfile \
--build-arg SEMVER_TESTING_ACCESS_KEY_ID="some-key" \
--build-arg SEMVER_TESTING_SECRET_ACCESS_KEY="some-secret" \
--build-arg SEMVER_TESTING_BUCKET="some-bucket" \
--build-arg SEMVER_TESTING_REGION="some-region"
```

### Contributing
Expand Down
File renamed without changes.
42 changes: 42 additions & 0 deletions dockerfiles/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM concourse/golang-builder as builder
COPY . /go/src/github.com/concourse/semver-resource
ENV CGO_ENABLED 0
RUN go build -o /assets/in github.com/concourse/semver-resource/in
RUN go build -o /assets/out github.com/concourse/semver-resource/out
RUN go build -o /assets/check github.com/concourse/semver-resource/check
WORKDIR /go/src/github.com/concourse/semver-resource
RUN set -e; for pkg in $(go list ./...); do \
go test -o "/tests/$(basename $pkg).test" -c $pkg; \
done

FROM ubuntu:bionic AS resource
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
tzdata \
ca-certificates \
git \
jq \
openssh-client \
&& rm -rf /var/lib/apt/lists/*
RUN git config --global user.email "git@localhost"
RUN git config --global user.name "git"
COPY --from=builder assets/ /opt/resource/
RUN chmod +x /opt/resource/*

FROM resource AS tests
ARG SEMVER_TESTING_ACCESS_KEY_ID
ARG SEMVER_TESTING_SECRET_ACCESS_KEY
ARG SEMVER_TESTING_BUCKET
ARG SEMVER_TESTING_REGION
ARG SEMVER_TESTING_V2_SIGNING
COPY --from=builder /tests /go-tests
WORKDIR /go-tests
RUN set -e; for test in /go-tests/*.test; do \
$test; \
done
COPY test/ /opt/resource-tests
RUN /opt/resource-tests/all.sh


FROM resource

0 comments on commit c2a3d1c

Please sign in to comment.