diff --git a/.drone.yml b/.drone.yml index 71562c1..dafbc0d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -32,22 +32,32 @@ pipeline: - make fmt-check build_linux_amd64: - image: appleboy/golang-testing:1.9.2 + image: appleboy/golang-testing + pull: true group: golang commands: - - make docker_build + - make build_linux_amd64 + + build_linux_i386: + image: appleboy/golang-testing + pull: true + group: golang + commands: + - make build_linux_i386 build_linux_arm64: - image: appleboy/golang-testing:1.9.2 + image: appleboy/golang-testing + pull: true group: golang commands: - - make docker_build_arm64 + - make build_linux_arm64 build_linux_arm: - image: appleboy/golang-testing:1.9.2 + image: appleboy/golang-testing + pull: true group: golang commands: - - make docker_build_arm + - make build_linux_arm coverage: image: appleboy/golang-testing:1.9.2 @@ -96,6 +106,19 @@ pipeline: event: [ push, tag ] local: false + publish_linux_i386: + image: plugins/docker + group: release + pull: true + dockerfile: Dockerfile.i386 + secrets: [ docker_username, docker_password ] + default_tags: true + default_suffix: i386 + repo: ${DRONE_REPO} + when: + event: [ push, tag ] + local: false + publish_linux_arm: image: plugins/docker group: release diff --git a/Dockerfile b/Dockerfile index b0272cf..89ebd59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ LABEL org.label-schema.vendor="Bo-Yi Wu" LABEL org.label-schema.schema-version="1.0" LABEL maintainer="Bo-Yi Wu " -ADD bin/gorush / +ADD release/linux/amd64/gorush /bin/ EXPOSE 8088 9000 -ENTRYPOINT ["/gorush"] +ENTRYPOINT ["/bin/gorush"] diff --git a/Dockerfile.alpine b/Dockerfile.alpine index c852b71..68729d6 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -10,7 +10,7 @@ LABEL maintainer="Bo-Yi Wu " RUN apk add -U --no-cache ca-certificates && \ rm -rf /var/cache/apk/* -ADD bin/gorush / +ADD release/linux/amd64/gorush /bin/ EXPOSE 8088 9000 -ENTRYPOINT ["/gorush"] +ENTRYPOINT ["/bin/gorush"] diff --git a/Dockerfile.arm b/Dockerfile.arm index fb0897b..50b0ae1 100644 --- a/Dockerfile.arm +++ b/Dockerfile.arm @@ -7,7 +7,7 @@ LABEL org.label-schema.vendor="Bo-Yi Wu" LABEL org.label-schema.schema-version="1.0" LABEL maintainer="Bo-Yi Wu " -ADD bin/gorush-arm /gorush +ADD release/linux/arm/gorush /bin/ EXPOSE 8088 9000 -ENTRYPOINT ["/gorush"] +ENTRYPOINT ["/bin/gorush"] diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index bf5f857..c50ea45 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -7,7 +7,7 @@ LABEL org.label-schema.vendor="Bo-Yi Wu" LABEL org.label-schema.schema-version="1.0" LABEL maintainer="Bo-Yi Wu " -ADD bin/gorush-arm64 /gorush +ADD release/linux/arm64/gorush /bin/ EXPOSE 8088 9000 -ENTRYPOINT ["/gorush"] +ENTRYPOINT ["/bin/gorush"] diff --git a/Dockerfile.i386 b/Dockerfile.i386 new file mode 100644 index 0000000..93d2162 --- /dev/null +++ b/Dockerfile.i386 @@ -0,0 +1,13 @@ +FROM plugins/base:multiarch + +LABEL org.label-schema.version=latest +LABEL org.label-schema.vcs-url="https://github.com/appleboy/gorush.git" +LABEL org.label-schema.name="Gorush" +LABEL org.label-schema.vendor="Bo-Yi Wu" +LABEL org.label-schema.schema-version="1.0" +LABEL maintainer="Bo-Yi Wu " + +ADD release/linux/i386/gorush /bin/ + +EXPOSE 8088 9000 +ENTRYPOINT ["/bin/gorush"] diff --git a/Makefile b/Makefile index 5880f13..4e43b47 100644 --- a/Makefile +++ b/Makefile @@ -172,14 +172,17 @@ release-copy: release-check: cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;) -docker_build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO) build -a -tags '$(TAGS)' -ldflags "$(EXTLDFLAGS)-s -w $(LDFLAGS)" -o bin/$(EXECUTABLE) +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) -docker_build_arm64: - CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $(GO) build -a -tags '$(TAGS)' -ldflags "$(EXTLDFLAGS)-s -w $(LDFLAGS)" -o bin/$(EXECUTABLE)-arm64 +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) -docker_build_arm: - CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 $(GO) build -a -tags '$(TAGS)' -ldflags "$(EXTLDFLAGS)-s -w $(LDFLAGS)" -o bin/$(EXECUTABLE)-arm +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) -f Dockerfile .