update build params
This commit is contained in:
parent
cf97958081
commit
bd0781aec7
|
@ -12,8 +12,11 @@ pipeline:
|
|||
build:
|
||||
image: *golang
|
||||
volumes: *volumes
|
||||
environments:
|
||||
BUILD_DIR: build
|
||||
commands:
|
||||
- go build -o /artifacts/capture
|
||||
- mkdir $BUILD_DIR
|
||||
- make
|
||||
|
||||
push_release:
|
||||
image: plugins/gitea-release
|
||||
|
@ -23,7 +26,7 @@ pipeline:
|
|||
from_secret: gitnet_api_key
|
||||
base_url: https://gitnet.fr
|
||||
note: ${CI_COMMIT_MESSAGE}
|
||||
files: /artifacts/capture
|
||||
files: build/*
|
||||
when:
|
||||
event: [tag]
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ COPY go.mod go.sum ./
|
|||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o /app/capture
|
||||
RUN BUILD_DIR=/app make
|
||||
|
||||
FROM debian:stable-slim
|
||||
|
||||
|
|
24
Makefile
Normal file
24
Makefile
Normal file
|
@ -0,0 +1,24 @@
|
|||
CGO_ENABLED = 0
|
||||
CC = go build
|
||||
CFLAGS = -trimpath
|
||||
LDFLAGS = all=-w -s
|
||||
GCFLAGS = all=
|
||||
ASMFLAGS = all=
|
||||
GOARCH ?= amd64
|
||||
|
||||
BUILD_DIR ?= build
|
||||
LINUX_BIN ?= capture
|
||||
WIN_BIN ?= capture.exe
|
||||
|
||||
all: build
|
||||
|
||||
deps:
|
||||
go install github.com/GeertJohan/go.rice/rice@latest
|
||||
rice embed-go
|
||||
|
||||
.PHONY:
|
||||
build: deps
|
||||
export CGO_ENABLED=$(CGO_ENABLED)
|
||||
export GOARCH=$(GOARCH)
|
||||
GOOS=linux $(CC) $(CFLAGS) -o $(BUILD_DIR)/$(LINUX_BIN) -ldflags="$(LDFLAGS)" -gcflags="$(GCFLAGS)" -asmflags="$(ASMFLAGS)"
|
||||
GOOS=windows $(CC) $(CFLAGS) -o $(BUILD_DIR)/$(WIN_BIN) -ldflags="$(LDFLAGS)" -gcflags="$(GCFLAGS)" -asmflags="$(ASMFLAGS)"
|
Loading…
Reference in a new issue