2019-03-16 19:25:18 +00:00
|
|
|
kind: pipeline
|
|
|
|
name: default
|
2019-02-05 20:28:37 +00:00
|
|
|
|
2019-03-16 19:33:40 +00:00
|
|
|
workspace:
|
|
|
|
base: /go
|
|
|
|
path: src/p83.nl/go/wiki
|
|
|
|
|
2019-03-16 19:25:18 +00:00
|
|
|
steps:
|
|
|
|
- name: testing
|
2021-08-13 06:44:50 +00:00
|
|
|
image: golang:1.16-alpine
|
2019-03-16 19:25:18 +00:00
|
|
|
commands:
|
2019-03-16 19:35:34 +00:00
|
|
|
- export GOPATH=/go
|
2019-03-16 19:53:12 +00:00
|
|
|
- export CGO_ENABLED=0
|
2019-03-16 19:52:05 +00:00
|
|
|
- apk --no-cache add git
|
2019-03-16 19:37:37 +00:00
|
|
|
- go get -d -t ./...
|
2021-08-13 19:08:19 +00:00
|
|
|
- go build
|
2019-03-16 19:25:18 +00:00
|
|
|
- go test ./...
|
|
|
|
|
2021-02-02 21:38:59 +00:00
|
|
|
- name: restore-cache-with-filesystem
|
2021-05-20 21:49:58 +00:00
|
|
|
image: meltwater/drone-cache:v1
|
2021-02-02 21:38:59 +00:00
|
|
|
pull: true
|
|
|
|
settings:
|
|
|
|
backend: "filesystem"
|
|
|
|
restore: true
|
2021-05-20 21:50:08 +00:00
|
|
|
cache_key: '{{ .Repo.Name }}_{{ arch }}_{{ os }}'
|
2021-02-02 21:38:59 +00:00
|
|
|
archive_format: "gzip"
|
|
|
|
mount:
|
|
|
|
- './editor/node_modules'
|
|
|
|
volumes:
|
|
|
|
- name: cache
|
|
|
|
path: /tmp/cache
|
2019-08-25 10:43:44 +00:00
|
|
|
|
|
|
|
- name: build-node
|
2021-05-20 21:56:20 +00:00
|
|
|
image: node:14
|
2021-02-02 22:03:51 +00:00
|
|
|
depends_on:
|
|
|
|
- restore-cache-with-filesystem
|
2019-08-25 10:43:44 +00:00
|
|
|
commands:
|
2020-10-25 14:52:39 +00:00
|
|
|
- cd list-editor
|
|
|
|
- npm install
|
|
|
|
- cd ../editor
|
2019-08-25 10:43:44 +00:00
|
|
|
- npm install
|
|
|
|
- npm run docker
|
|
|
|
|
2021-02-02 21:38:59 +00:00
|
|
|
- name: rebuild-cache-with-filesystem
|
2021-05-20 21:49:58 +00:00
|
|
|
image: meltwater/drone-cache:v1
|
2021-02-02 21:38:59 +00:00
|
|
|
pull: true
|
2021-02-02 22:03:51 +00:00
|
|
|
depends_on:
|
|
|
|
- build-node
|
2021-02-02 21:38:59 +00:00
|
|
|
settings:
|
|
|
|
backend: "filesystem"
|
|
|
|
rebuild: true
|
2021-05-20 21:50:08 +00:00
|
|
|
cache_key: '{{ .Repo.Name }}_{{ arch }}_{{ os }}'
|
2021-02-02 21:38:59 +00:00
|
|
|
archive_format: "gzip"
|
|
|
|
mount:
|
|
|
|
- './editor/node_modules'
|
|
|
|
volumes:
|
|
|
|
- name: cache
|
|
|
|
path: /tmp/cache
|
2019-08-25 10:43:44 +00:00
|
|
|
|
2019-03-16 19:25:18 +00:00
|
|
|
- name: publish
|
|
|
|
image: plugins/docker
|
2021-02-02 22:03:51 +00:00
|
|
|
depends_on:
|
|
|
|
- rebuild-cache-with-filesystem
|
|
|
|
- testing
|
2019-03-16 19:25:18 +00:00
|
|
|
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
|
2021-02-02 22:03:51 +00:00
|
|
|
depends_on:
|
|
|
|
- publish
|
2019-03-16 19:25:18 +00:00
|
|
|
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
|
|
|
|
|
2019-08-25 10:52:38 +00:00
|
|
|
# - name: notify
|
|
|
|
# image: plugins/webhook
|
|
|
|
# settings:
|
|
|
|
# debug: true
|
|
|
|
# secrets:
|
|
|
|
# - source: result_webhook
|
|
|
|
# target: plugin_urls
|
2019-08-25 10:43:44 +00:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: cache
|
|
|
|
host:
|
2021-02-02 22:00:04 +00:00
|
|
|
path: /cache
|