Skip to content

Commit

Permalink
Merge pull request #62 from lukaszbudnik/upgrade-docker-dependencies-…
Browse files Browse the repository at this point in the history
…add-integration-test

upgraded docker containers for golang and alpine
  • Loading branch information
lukaszbudnik committed Jan 8, 2023
2 parents 66b4078 + 196306d commit 48cb758
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,18 @@ jobs:
steps:
- uses: actions/[email protected]
- name: Build the Docker image
run: docker build . --file Dockerfile --tag yosoy-local:$(date +%s)
run: docker build . --file Dockerfile --tag yosoy-local:latest
- name: Run simple integration test
run: |
docker run -p 3333:80 yosoy-local:latest > yosoy.log &
sleep 5
RESULT=$(curl -s -X DELETE -H 'x-api-key: abc123' 'http://0.0.0.0:3333/sample/path?with=params')
echo "$RESULT"
if [[ $RESULT =~ '"method":"DELETE"' ]]
then
echo 'Test successful'
exit 0
else
echo 'Test failure'
exit 1
fi
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.16
go-version: 1.19

- name: Build
run: go build -v ./...
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM golang:1.17.3-alpine3.13 as builder
FROM golang:1.19-alpine as builder

LABEL maintainer="Łukasz Budnik [email protected]"

# build yosoy
ADD . /go/yosoy
RUN cd /go/yosoy && go build

FROM alpine:3.16.2
FROM alpine:3.17
COPY --from=builder /go/yosoy/yosoy /bin

# register entrypoint
Expand Down

0 comments on commit 48cb758

Please sign in to comment.