Rewrite for Drone 1.0

This commit is contained in:
Peter Stuifzand 2019-03-16 20:25:18 +01:00
parent cc0c5f4538
commit 300233e968
2 changed files with 40 additions and 32 deletions

View File

@ -1,21 +1,37 @@
pipeline:
publish:
kind: pipeline
name: default
steps:
- name: testing
commands:
- go get -u ./...
- go build -u ./...
- go test ./...
- name: publish
image: plugins/docker
settings:
repo: registry.stuifzandapp.com/wiki
registry: registry.stuifzandapp.com
secrets: [ docker_username, docker_password ]
username:
from_secret: docker_username
password:
from_secret: docker_password
deploy:
- name: deploy
image: appleboy/drone-ssh
settings:
host: wiki.p83.nl
username: wiki
secrets: ['ssh_key']
ssh_key:
from_secret: ssh_key
script:
- cd /home/wiki/wiki
- docker-compose pull web
- docker-compose up -d
notify:
- name: notify
image: plugins/webhook
settings:
debug: true

View File

@ -1,16 +1,8 @@
# build stage
FROM golang:1.10.2-alpine3.7 AS build-env
RUN apk --no-cache add git
RUN go get -u p83.nl/go/wiki/...
RUN go test p83.nl/go/wiki/...
# final stage
FROM alpine
RUN apk --no-cache add ca-certificates git
RUN adduser --disabled-password --uid 1005 wiki
EXPOSE 80
COPY --from=build-env /go/bin/wiki /app/
RUN ["mkdir", "/app/templates"]
COPY --from=build-env /go/src/p83.nl/go/wiki/templates /app/templates
WORKDIR /app
ADD ./wiki /app
ADD ./templates /app/templates
ENTRYPOINT ["/app/wiki"]