Skip to content

Commit

Permalink
Docker image changes && release changes (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
vadv authored Jul 17, 2020
1 parent 69429b6 commit b59c46c
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 8 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: gorelease
on:
push:
tags:
- '*'
jobs:

test:
runs-on: ubuntu-latest
steps:

- name: Checkout repo
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
- name: Build and push Docker images
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: vadv/pg_gatherer
name: vadv/pg_gatherer_test
dockerfile: ./docker/test.Dockerfile
username: vadv
password: ${{ secrets.DOCKER_TOKEN }}
cache: ${{ github.event_name != 'schedule' }}
tags: test
tags: latest

- name: Test in docker image
run: docker run --rm vadv/pg_gatherer:test bash -ec "make test_in_docker"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
- name: Build test image
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: vadv/pg_gatherer
name: vadv/pg_gatherer_test
dockerfile: ./docker/test.Dockerfile
username: vadv
password: ${{ secrets.DOCKER_TOKEN }}
cache: true
tags: test
tags: latest

- name: Test in docker image
run: docker run --rm vadv/pg_gatherer:test bash -ec "make test_in_docker"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.idea
.DS_Store
dist
14 changes: 14 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
builds:
- main: ./gatherer/cmd/pg_gatherer
id: "pg_gatherer"
binary: pg_gatherer
goos:
- linux
- darwin
- windows
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
10 changes: 6 additions & 4 deletions docker/release.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.12 as builder
FROM golang:1.14 as builder

WORKDIR /go/github.com/vadv/pg_gatherer

Expand All @@ -9,6 +9,8 @@ RUN go mod download
COPY . .
RUN make build

FROM alpine
COPY --from=builder /go/github.com/vadv/pg_gatherer/bin/pg_gatherer /app/bin/
COPY --from=builder /go/github.com/vadv/pg_gatherer/plugins /app/plugins
FROM centos:7

ENV LC_ALL=en_US.UTF-8
COPY --from=builder /go/github.com/vadv/pg_gatherer/bin/pg_gatherer /usr/bin/pg_gatherer
COPY --from=builder /go/github.com/vadv/pg_gatherer/plugins /etc/pg_gatherer/plugins

0 comments on commit b59c46c

Please sign in to comment.