diff --git a/.drone-manifest.yml b/.drone-manifest.yml new file mode 100644 index 0000000..5d8f101 --- /dev/null +++ b/.drone-manifest.yml @@ -0,0 +1,22 @@ +image: nemunaire/atsebay.t:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} +{{#if build.tags}} +tags: +{{#each build.tags}} + - {{this}} +{{/each}} +{{/if}} +manifests: + - image: nemunaire/atsebay.t:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64 + platform: + architecture: amd64 + os: linux + - image: nemunaire/atsebay.t:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64 + platform: + architecture: arm64 + os: linux + variant: v8 + - image: nemunaire/atsebay.t:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm + platform: + architecture: arm + os: linux + variant: v7 diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..903bdf1 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,65 @@ +--- +kind: pipeline +type: docker +name: build-arm + +platform: + os: linux + arch: arm + +steps: +- name: generate frontend + image: golang:alpine + commands: + - apk --no-cache add go-bindata + - go generate -v + +- name: vet + image: golang:alpine + commands: + - apk --no-cache add build-base + - go vet -v + +- name: backend armv7 + image: golang:alpine + commands: + - apk --no-cache add build-base + - go get -v + - go build -v + environment: + GOARM: 7 + +- name: publish + image: plugins/docker + settings: + repo: nemunaire/atsebay.t + auto_tag: true + auto_tag_suffix: ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} + username: + from_secret: docker_username + password: + from_secret: docker_password + +--- +kind: pipeline +name: docker-manifest + +steps: +- name: publish + image: plugins/manifest + settings: + auto_tag: true + ignore_missing: true + spec: .drone-manifest.yml + username: + from_secret: docker_username + password: + from_secret: docker_password + +trigger: + event: + - push + - tag + +depends_on: +- build-arm diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e181451 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM golang:alpine as gobuild + +RUN apk add --no-cache go-bindata + +WORKDIR /go/src/git.nemunai.re/atsebay.t + +COPY *.go go.mod go.sum ./ +COPY htdocs/ ./htdocs/ + +RUN go generate -v && \ + go get -d -v && \ + go build -v + + +FROM alpine + +EXPOSE 8081 + +ENTRYPOINT ["atsebay.t"] + +COPY --from=gobuild /go/src/git.nemunai.re/atsebay.t/atsebay.t /usr/bin/atsebay.t \ No newline at end of file