feat: Build process for 2 binaries (api,cli)

pull/15/head v0.3.0
Karan Sharma 2021-03-02 18:58:49 +05:30
parent 083ba19363
commit 7d0499c432
3 changed files with 68 additions and 20 deletions

View File

@ -4,6 +4,7 @@ env:
builds:
- binary: doggo
id: cli
goos:
- windows
- darwin
@ -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
@ -34,22 +51,46 @@ snapcrafts:
publish: true
dockers:
- image_templates:
- "ghcr.io/mr-karan/doggo:{{ .Tag }}"
- "ghcr.io/mr-karan/doggo:latest"
- image_templates:
- "ghcr.io/mr-karan/doggo-cli:{{ .Tag }}"
- "ghcr.io/mr-karan/doggo-cli:latest"
binaries:
- doggo
dockerfile: Dockerfile
dockerfile: Dockerfile-cli
build_flag_templates:
- "--build-arg"
- "ARCH=amd64"
- image_templates:
- "ghcr.io/mr-karan/doggo:{{ .Tag }}-arm64v8"
- "ghcr.io/mr-karan/doggo:latest-arm64v8"
- image_templates:
- "ghcr.io/mr-karan/doggo-cli:{{ .Tag }}-arm64v8"
- "ghcr.io/mr-karan/doggo-cli:latest-arm64v8"
binaries:
- doggo
goarch: arm64
dockerfile: Dockerfile
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
Dockerfile-api 100644
View File

@ -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"]