Skip to content

Commit

Permalink
feat: Build process for 2 binaries (api,cli)
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-karan committed Mar 2, 2021
1 parent 083ba19 commit 7d0499c
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 20 deletions.
81 changes: 61 additions & 20 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ env:

builds:
- binary: doggo
id: cli
goos:
- windows
- darwin
Expand All @@ -16,7 +17,23 @@ builds:
- 7
ldflags:
- -s -w -X "main.buildVersion={{ .Tag }} ({{ .ShortCommit }} {{ .Date }})"
dir: ./cmd/doggo/
dir: ./cmd/doggo/cli/

- binary: doggo-api.bin
id: api
goos:
- windows
- darwin
- linux
goarch:
- amd64
- arm64
goarm:
- 6
- 7
ldflags:
- -s -w -X "main.buildVersion={{ .Tag }} ({{ .ShortCommit }} {{ .Date }})"
dir: ./cmd/doggo/api/

archives:
- format: tar.gz
Expand All @@ -34,22 +51,46 @@ snapcrafts:
publish: true

dockers:
- image_templates:
- "ghcr.io/mr-karan/doggo:{{ .Tag }}"
- "ghcr.io/mr-karan/doggo:latest"
binaries:
- doggo
dockerfile: Dockerfile
build_flag_templates:
- "--build-arg"
- "ARCH=amd64"
- image_templates:
- "ghcr.io/mr-karan/doggo:{{ .Tag }}-arm64v8"
- "ghcr.io/mr-karan/doggo:latest-arm64v8"
binaries:
- doggo
goarch: arm64
dockerfile: Dockerfile
build_flag_templates:
- "--build-arg"
- "ARCH=arm64v8"
- image_templates:
- "ghcr.io/mr-karan/doggo-cli:{{ .Tag }}"
- "ghcr.io/mr-karan/doggo-cli:latest"
binaries:
- doggo
dockerfile: Dockerfile-cli
build_flag_templates:
- "--build-arg"
- "ARCH=amd64"
- image_templates:
- "ghcr.io/mr-karan/doggo-cli:{{ .Tag }}-arm64v8"
- "ghcr.io/mr-karan/doggo-cli:latest-arm64v8"
binaries:
- doggo
goarch: arm64
dockerfile: Dockerfile-cli
build_flag_templates:
- "--build-arg"
- "ARCH=arm64v8"

- image_templates:
- "ghcr.io/mr-karan/doggo-api:{{ .Tag }}"
- "ghcr.io/mr-karan/doggo-api:latest"
binaries:
- doggo-api.bin
dockerfile: Dockerfile-api
build_flag_templates:
- "--build-arg"
- "ARCH=amd64"
extra_files:
- config-api-sample.toml
- image_templates:
- "ghcr.io/mr-karan/doggo-api:{{ .Tag }}-arm64v8"
- "ghcr.io/mr-karan/doggo-api:latest-arm64v8"
binaries:
- doggo-api.bin
goarch: arm64
dockerfile: Dockerfile-api
build_flag_templates:
- "--build-arg"
- "ARCH=arm64v8"
extra_files:
- config-api-sample.toml
7 changes: 7 additions & 0 deletions Dockerfile-api
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Dockerfile
ARG ARCH
FROM ${ARCH}/alpine
WORKDIR /app
COPY doggo-api.bin .
COPY config-api-sample.toml config.toml
CMD ["./doggo-api.bin"]
File renamed without changes.

0 comments on commit 7d0499c

Please sign in to comment.