added publish step, and drone sig for secrets, plus dockerfile

pull/3/head
josebarn 7 years ago
parent 5f4a28f5f6
commit 7513414eb7

@ -9,8 +9,13 @@ pipeline:
commands: commands:
- go test - go test
publish:
image: plugins/docker
repo: josebarn/hello-world
tags: [ 1.0.0, 1.0, latest ]
dockerfile: ./docker/Dockerfile
secrets: [ docker_username, docker_password ]
matrix: matrix:
IMAGE: IMAGE:
- golang:1.7
- golang:1.8
- golang:latest - golang:latest

@ -0,0 +1 @@
eyJhbGciOiJIUzI1NiJ9.cGlwZWxpbmU6CiAgYnVpbGQ6CiAgICBpbWFnZTogJHtJTUFHRX0KICAgIGNvbW1hbmRzOgogICAgICAtIGdvIGJ1aWxkCgogIHRlc3Q6CiAgICBpbWFnZTogJHtJTUFHRX0KICAgIGNvbW1hbmRzOgogICAgICAtIGdvIHRlc3QKCiAgcHVibGlzaDoKICAgIGltYWdlOiBwbHVnaW5zL2RvY2tlcgogICAgcmVwbzogam9zZWJhcm4vaGVsbG8td29ybGQKICAgIHRhZ3M6IFsgMS4wLjAsIDEuMCwgbGF0ZXN0IF0KICAgIGRvY2tlcmZpbGU6IC4vZG9ja2VyL0RvY2tlcmZpbGUKICAgIHNlY3JldHM6IFsgZG9ja2VyX3VzZXJuYW1lLCBkb2NrZXJfcGFzc3dvcmQgXQogICAgCm1hdHJpeDoKICBJTUFHRToKICAgIC0gZ29sYW5nOmxhdGVzdAo.35I5ulM7TJbhXqCZsiXBtPAVG0MzsDlsgrl_aZYuK10

@ -0,0 +1,23 @@
# Multi-stage build form
FROM golang:latest
# Copy in code...
RUN mkdir /app
ADD main.go /app/
# Build app
WORKDIR /app
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o hello .
# Could use something even smaller...
FROM alpine:latest
RUN apk --no-cache add ca-certificates
RUN mkdir /app
WORKDIR /app/
COPY --from=0 /app/hello .
# Expose ports for future REST Interface
EXPOSE 8080
CMD ["/app/hello"]
Loading…
Cancel
Save