feat(build): support arm arm64 386 amd64 binary.
This commit is contained in:
parent
0afb796085
commit
ac5bf03e25
29
.drone.yml
29
.drone.yml
@ -20,7 +20,34 @@ pipeline:
|
||||
- make misspell-check
|
||||
- make test
|
||||
- make coverage
|
||||
- make static_build
|
||||
|
||||
build_linux_amd64:
|
||||
image: appleboy/golang-testing
|
||||
pull: true
|
||||
group: build
|
||||
commands:
|
||||
- make build_linux_amd64
|
||||
|
||||
build_linux_i386:
|
||||
image: appleboy/golang-testing
|
||||
pull: true
|
||||
group: build
|
||||
commands:
|
||||
- make build_linux_i386
|
||||
|
||||
build_linux_arm64:
|
||||
image: appleboy/golang-testing
|
||||
pull: true
|
||||
group: build
|
||||
commands:
|
||||
- make build_linux_arm64
|
||||
|
||||
build_linux_arm:
|
||||
image: appleboy/golang-testing
|
||||
pull: true
|
||||
group: build
|
||||
commands:
|
||||
- make build_linux_arm
|
||||
|
||||
codecov:
|
||||
image: robertstettner/drone-codecov
|
||||
|
11
Dockerfile
11
Dockerfile
@ -1,7 +1,10 @@
|
||||
FROM centurylink/ca-certs
|
||||
FROM plugins/base:multiarch
|
||||
|
||||
LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>"
|
||||
LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>" \
|
||||
org.label-schema.name="Drone Telegram" \
|
||||
org.label-schema.vendor="Bo-Yi Wu" \
|
||||
org.label-schema.schema-version="1.0"
|
||||
|
||||
ADD drone-telegram /
|
||||
ADD release/linux/amd64/drone-telegram /bin/
|
||||
|
||||
ENTRYPOINT ["/drone-telegram"]
|
||||
ENTRYPOINT ["/bin/drone-telegram"]
|
||||
|
14
Makefile
14
Makefile
@ -120,9 +120,17 @@ release-copy:
|
||||
release-check:
|
||||
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;)
|
||||
|
||||
# for docker.
|
||||
static_build:
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o $(DEPLOY_IMAGE)
|
||||
build_linux_amd64:
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/linux/amd64/$(DEPLOY_IMAGE)
|
||||
|
||||
build_linux_i386:
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -a -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/linux/i386/$(DEPLOY_IMAGE)
|
||||
|
||||
build_linux_arm64:
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/linux/arm64/$(DEPLOY_IMAGE)
|
||||
|
||||
build_linux_arm:
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -a -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o release/linux/arm/$(DEPLOY_IMAGE)
|
||||
|
||||
docker_image:
|
||||
docker build -t $(DEPLOY_ACCOUNT)/$(DEPLOY_IMAGE) .
|
||||
|
Loading…
Reference in New Issue
Block a user