diff --git a/.drone.yml b/.drone.yml index cde3a4e..f1fc2fe 100644 --- a/.drone.yml +++ b/.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 diff --git a/Dockerfile b/Dockerfile index 6a986ec..088dd50 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,10 @@ -FROM centurylink/ca-certs +FROM plugins/base:multiarch -LABEL maintainer="Bo-Yi Wu " +LABEL maintainer="Bo-Yi Wu " \ + 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"] diff --git a/Makefile b/Makefile index c033206..6e62308 100644 --- a/Makefile +++ b/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) .