Skip to content

Commit

Permalink
update build env + goreleaser config
Browse files Browse the repository at this point in the history
  • Loading branch information
kamaln7 committed Oct 11, 2019
1 parent d503cff commit cdde602
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
17 changes: 11 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
builds:
- binary: karmabot
- id: karmabot
binary: karmabot
main: ./cmd/karmabot/main.go
ldflags: -s -w -X "github.com/kamaln7/karmabot.Version={{.Version}}"
goos:
- linux
goarch:
- amd64
- binary: karmabotctl
- id: karmabotctl
binary: karmabotctl
main: ./cmd/karmabotctl/main.go
ldflags: -s -w -X "github.com/kamaln7/karmabot.Version={{.Version}}"
goos:
Expand All @@ -16,20 +18,23 @@ builds:
snapshot:
name_template: "{{ .Tag }}-next"
dockers:
- binary: karmabot
- binaries:
- karmabot
dockerfile: ./cmd/karmabot/Dockerfile-goreleaser
image_templates:
- "kamaln7/karmabot:{{ .Version }}"
- "kamaln7/karmabot:latest"
- binary: karmabot
- binaries:
- karmabot
dockerfile: ./cmd/karmabot/Dockerfile-webui-goreleaser
image_templates:
- "kamaln7/karmabot:{{ .Version }}-webui"
- "kamaln7/karmabot:latest-webui"
extra_files:
- www
- binary: karmabotctl
- binaries:
- karmabotctl
dockerfile: ./cmd/karmabotctl/Dockerfile-goreleaser
image_templates:
- "kamaln7/karmabotctl:{{ .Version }}"
- "kamaln7/karmabotctl:latest"
- "kamaln7/karmabotctl:latest"
5 changes: 2 additions & 3 deletions Dockerfile-build-env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.11-alpine
FROM golang:1.13-alpine

# Need to mount /var/run/docker.sock
# Need to mount /root/.config/goreleaser/github_token
Expand All @@ -8,10 +8,9 @@ RUN apk add --no-cache alpine-sdk git docker

RUN mkdir /tmp/goreleaser && \
cd /tmp/goreleaser && \
wget -O goreleaser.tgz https://github.com/goreleaser/goreleaser/releases/download/v0.104.0/goreleaser_Linux_x86_64.tar.gz && \
wget -O goreleaser.tgz https://github.com/goreleaser/goreleaser/releases/download/v0.119.0/goreleaser_Linux_x86_64.tar.gz && \
tar vxf goreleaser.tgz && \
mv goreleaser /bin && \
rm -r /tmp/goreleaser

WORKDIR /go/src/github.com/kamaln7/karmabot
ENTRYPOINT ["goreleaser"]
5 changes: 3 additions & 2 deletions goreleaser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ docker run \
-v $(pwd):/go/src/github.com/kamaln7/karmabot \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $HOME/.config/goreleaser/github_token:/root/.config/goreleaser/github_token \
-v $HOME/.docker/config.json:/root/.docker/config.json \
karmabot-goreleaser $@
-v $HOME/.docker/config.json:/root/.docker/config.json \
-w /go/src/github.com/kamaln7/karmabot \
karmabot-build-env $@

0 comments on commit cdde602

Please sign in to comment.