[FORGEJO] build forgejo-runner

This commit is contained in:
Earl Warren 2023-04-30 18:13:11 +02:00
parent b02cc3071e
commit 02b72efa6f
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
4 changed files with 23 additions and 8 deletions

2
.dockerignore Normal file
View file

@ -0,0 +1,2 @@
Dockerfile
forgejo-runner

4
.gitignore vendored
View file

@ -1,4 +1,6 @@
act_runner
*~
forgejo-runner
.env
.runner
coverage.txt

15
Dockerfile Normal file
View file

@ -0,0 +1,15 @@
#Build stage
FROM golang:1.20-alpine3.17 AS build-env
RUN apk --no-cache add build-base git
COPY . /srv
WORKDIR /srv
RUN make build
FROM alpine:3.17
LABEL maintainer="contact@forgejo.org"
COPY --from=build-env /srv/forgejo-runner /bin/forgejo-runner
ENTRYPOINT ["/bin/forgejo-runner"]

View file

@ -1,5 +1,5 @@
DIST := dist
EXECUTABLE := act_runner
EXECUTABLE := forgejo-runner
GOFMT ?= gofumpt -l
DIST := dist
DIST_DIRS := $(DIST)/binaries $(DIST)/release
@ -20,11 +20,7 @@ DOCKER_IMAGE ?= gitea/act_runner
DOCKER_TAG ?= nightly
DOCKER_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)
ifneq ($(shell uname), Darwin)
EXTLDFLAGS = -extldflags "-static" $(null)
else
EXTLDFLAGS =
endif
EXTLDFLAGS = -extldflags "-static" $(null)
ifeq ($(HAS_GO), GO)
GOPATH ?= $(shell $(GO) env GOPATH)
@ -113,7 +109,7 @@ install: $(GOFILES)
build: go-check $(EXECUTABLE)
$(EXECUTABLE): $(GOFILES)
$(GO) build -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o $@
$(GO) build -v -tags 'netgo osusergo $(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o $@
.PHONY: deps-backend
deps-backend: