Use newer drone and Dockerfile
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Peter Stuifzand 2019-03-19 22:23:10 +01:00
parent 2b9150a5a3
commit caf7e4a900
Signed by: peter
GPG Key ID: 374322D56E5209E8
2 changed files with 39 additions and 33 deletions

View File

@ -1,24 +1,39 @@
pipeline:
publish:
image: plugins/docker
repo: registry.stuifzandapp.com/microsub-server
registry: registry.stuifzandapp.com
secrets: [ docker_username, docker_password ]
kind: pipeline
name: default
deploy:
image: appleboy/drone-ssh
host: microsub.stuifzandapp.com
username: microsub
secrets: ['ssh_key']
script:
- cd /home/microsub/microsub
- docker-compose pull web
- docker-compose up -d
workspace:
base: /go
path: src/p83.nl/go/ekster
notify:
image: plugins/webhook
settings:
debug: true
secrets:
- source: result_webhook
target: plugin_urls
steps:
- name: testing
image: golang:1.12-alpine
commands:
- export GOPATH=/go
- export CGO_ENABLED=0
- apk --no-cache add git
- go get -d -t ./...
- go build p83.nl/go/ekster/cmd/eksterd
- go test ./...
- name: publish
image: plugins/docker
settings:
repo: registry.stuifzandapp.com/microsub-server
registry: registry.stuifzandapp.com
username:
from_secret: docker_username
password:
from_secret: docker_password
- name: deploy
image: appleboy/drone-ssh
settings:
host: microsub.stuifzandapp.com
username: microsub
ssh_key:
from_secret: ssh_key
script:
- cd /home/microsub/microsub
- docker-compose pull web
- docker-compose up -d

View File

@ -1,16 +1,7 @@
# build stage
FROM golang:1.10.2-alpine3.7 AS build-env
RUN apk --no-cache add git
RUN go get p83.nl/go/ekster/...
# final stage
FROM alpine
RUN apk --no-cache add ca-certificates
RUN ["mkdir", "-p", "/opt/micropub"]
WORKDIR /opt/micropub
EXPOSE 80
COPY --from=build-env /go/bin/eksterd /app/
RUN ["mkdir", "/app/templates"]
COPY --from=build-env /go/src/p83.nl/go/ekster/templates /app/templates
COPY /go/bin/eksterd /app/
COPY /go/src/p83.nl/go/ekster/templates /app/templates
ENTRYPOINT ["/app/eksterd"]