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,24 +1,40 @@
pipeline:
publish:
image: plugins/docker
repo: registry.stuifzandapp.com/wiki
registry: registry.stuifzandapp.com
secrets: [ docker_username, docker_password ]
deploy: kind: pipeline
image: appleboy/drone-ssh name: default
host: wiki.p83.nl
username: wiki
secrets: ['ssh_key']
script:
- cd /home/wiki/wiki
- docker-compose pull web
- docker-compose up -d
notify: steps:
image: plugins/webhook - name: testing
settings: commands:
debug: true - go get -u ./...
secrets: - go build -u ./...
- source: result_webhook - go test ./...
target: plugin_urls
- name: publish
image: plugins/docker
settings:
repo: registry.stuifzandapp.com/wiki
registry: registry.stuifzandapp.com
username:
from_secret: docker_username
password:
from_secret: docker_password
- name: deploy
image: appleboy/drone-ssh
settings:
host: wiki.p83.nl
username: wiki
ssh_key:
from_secret: ssh_key
script:
- cd /home/wiki/wiki
- docker-compose pull web
- docker-compose up -d
- name: notify
image: plugins/webhook
settings:
debug: true
secrets:
- source: result_webhook
target: plugin_urls

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 FROM alpine
RUN apk --no-cache add ca-certificates git RUN apk --no-cache add ca-certificates git
RUN adduser --disabled-password --uid 1005 wiki RUN adduser --disabled-password --uid 1005 wiki
EXPOSE 80 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 WORKDIR /app
ADD ./wiki /app
ADD ./templates /app/templates
ENTRYPOINT ["/app/wiki"] ENTRYPOINT ["/app/wiki"]