mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2024-11-21 12:17:17 +03:00
[FORGEJO] build forgejo-runner
This commit is contained in:
parent
31638583d9
commit
e9ba98411e
4 changed files with 23 additions and 8 deletions
2
.dockerignore
Normal file
2
.dockerignore
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Dockerfile
|
||||||
|
forgejo-runner
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,4 +1,6 @@
|
||||||
act_runner
|
*~
|
||||||
|
|
||||||
|
forgejo-runner
|
||||||
.env
|
.env
|
||||||
.runner
|
.runner
|
||||||
coverage.txt
|
coverage.txt
|
||||||
|
|
15
Dockerfile
Normal file
15
Dockerfile
Normal 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"]
|
8
Makefile
8
Makefile
|
@ -1,5 +1,5 @@
|
||||||
DIST := dist
|
DIST := dist
|
||||||
EXECUTABLE := act_runner
|
EXECUTABLE := forgejo-runner
|
||||||
GOFMT ?= gofumpt -l
|
GOFMT ?= gofumpt -l
|
||||||
DIST := dist
|
DIST := dist
|
||||||
DIST_DIRS := $(DIST)/binaries $(DIST)/release
|
DIST_DIRS := $(DIST)/binaries $(DIST)/release
|
||||||
|
@ -21,11 +21,7 @@ DOCKER_TAG ?= nightly
|
||||||
DOCKER_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)
|
DOCKER_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)
|
||||||
DOCKER_ROOTLESS_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)-dind-rootless
|
DOCKER_ROOTLESS_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)-dind-rootless
|
||||||
|
|
||||||
ifneq ($(shell uname), Darwin)
|
|
||||||
EXTLDFLAGS = -extldflags "-static" $(null)
|
EXTLDFLAGS = -extldflags "-static" $(null)
|
||||||
else
|
|
||||||
EXTLDFLAGS =
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(HAS_GO), GO)
|
ifeq ($(HAS_GO), GO)
|
||||||
GOPATH ?= $(shell $(GO) env GOPATH)
|
GOPATH ?= $(shell $(GO) env GOPATH)
|
||||||
|
@ -117,7 +113,7 @@ install: $(GOFILES)
|
||||||
build: go-check $(EXECUTABLE)
|
build: go-check $(EXECUTABLE)
|
||||||
|
|
||||||
$(EXECUTABLE): $(GOFILES)
|
$(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
|
.PHONY: deps-backend
|
||||||
deps-backend:
|
deps-backend:
|
||||||
|
|
Loading…
Reference in a new issue