Skip to content

Commit

Permalink
Merge pull request #11 from concourse/bionic-base-image
Browse files Browse the repository at this point in the history
migrating to ubuntu:bionic
  • Loading branch information
cirocosta authored Mar 26, 2019
2 parents 5cb79f1 + 3da7688 commit e0ad304
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 10 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,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 hg-resource .
docker build -t hg-resource -f dockerfiles/alpine/Dockerfile .
docker build -t hg-resource -f dockerfiles/ubuntu/Dockerfile .
```

### Contributing
Expand Down
2 changes: 1 addition & 1 deletion assets/askpass.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
#!/bin/bash
echo "Private keys with passphrases are not supported." >&2
exit 1
File renamed without changes.
35 changes: 35 additions & 0 deletions dockerfiles/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM concourse/golang-builder as builder
COPY . /go/src/github.com/concourse/hg-resource
ENV CGO_ENABLED 0
ENV GOPATH /go/src/github.com/concourse/hg-resource/Godeps/_workspace:${GOPATH}
ENV PATH /go/src/github.com/concourse/hg-resource/Godeps/_workspace/bin:${PATH}
RUN go build -o /assets/hgresource github.com/concourse/hg-resource/hgresource
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 && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
gnupg \
jq \
openssh-client \
mercurial \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /assets /opt/resource
ADD assets/askpass.sh /opt/resource
RUN chmod +x /opt/resource/*
RUN ln -s /opt/resource/hgresource /opt/resource/in; ln -s /opt/resource/hgresource /opt/resource/out; ln -s /opt/resource/hgresource /opt/resource/check
ADD hgrc /etc/mercurial/hgrc

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

COPY /test /test
RUN /test/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/helpers.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

set -e -u

Expand Down
2 changes: 1 addition & 1 deletion test/image.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/shunit2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/sh
#! /bin/bash
# $Id$
# vim:et:ft=sh:sts=2:sw=2
#
Expand Down
2 changes: 1 addition & 1 deletion test/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
2 changes: 1 addition & 1 deletion test/test_in.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/test_out.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 e0ad304

Please sign in to comment.