2019-04-28 14:38:36 +02:00
|
|
|
kind: pipeline
|
|
|
|
name: default
|
2020-07-04 18:33:42 +02:00
|
|
|
type: docker
|
2019-04-28 14:38:36 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: restore-cache
|
2018-07-03 16:57:08 +02:00
|
|
|
privileged: true
|
2021-10-02 15:36:57 +02:00
|
|
|
image: 2martens/drone-volume-cache
|
2019-04-28 14:38:36 +02:00
|
|
|
settings:
|
|
|
|
restore: true
|
|
|
|
mount:
|
2019-04-28 15:44:16 +02:00
|
|
|
- ./.bundle
|
2019-04-28 14:38:36 +02:00
|
|
|
- ./.yarn-cache
|
|
|
|
- ./node_modules
|
2018-07-03 14:32:57 +02:00
|
|
|
volumes:
|
2019-04-28 15:44:16 +02:00
|
|
|
- name: cache
|
|
|
|
path: /cache
|
2019-04-28 14:38:36 +02:00
|
|
|
- name: build
|
2020-11-11 21:12:58 +01:00
|
|
|
image: 2martens/ruby-node
|
2018-07-03 14:32:57 +02:00
|
|
|
environment:
|
2019-04-28 15:44:16 +02:00
|
|
|
BUNDLE_PATH: .bundle
|
|
|
|
commands:
|
2018-07-04 10:06:38 +02:00
|
|
|
- export LANG="C.UTF-8"
|
|
|
|
- export LC_ALL="C.UTF-8"
|
|
|
|
- ruby -e 'puts STDIN.external_encoding' # figure out the encoding used
|
2018-07-03 14:32:57 +02:00
|
|
|
- bundle install
|
2019-04-28 16:02:01 +02:00
|
|
|
- yarn config set cache-folder /cache/.yarn-cache
|
2019-02-27 16:23:46 +01:00
|
|
|
- yarn global add gulp-cli
|
2019-04-28 16:18:26 +02:00
|
|
|
- yarn install --frozen-lockfile
|
2019-02-27 15:21:25 +01:00
|
|
|
- gulp build
|
2019-04-28 14:38:36 +02:00
|
|
|
- name: rebuild-cache
|
2018-07-03 16:57:08 +02:00
|
|
|
privileged: true
|
2021-10-02 15:36:57 +02:00
|
|
|
image: 2martens/drone-volume-cache
|
2019-04-28 14:38:36 +02:00
|
|
|
settings:
|
|
|
|
rebuild: true
|
|
|
|
mount:
|
2019-04-28 15:44:16 +02:00
|
|
|
- .bundle
|
|
|
|
- .yarn-cache
|
2019-04-28 14:38:36 +02:00
|
|
|
- ./node_modules
|
2018-07-03 14:32:57 +02:00
|
|
|
volumes:
|
2019-04-28 15:44:16 +02:00
|
|
|
- name: cache
|
|
|
|
path: /cache
|
2019-04-28 14:38:36 +02:00
|
|
|
- name: deploy
|
2018-07-03 14:32:57 +02:00
|
|
|
image: drillster/drone-rsync
|
2019-04-28 14:38:36 +02:00
|
|
|
settings:
|
|
|
|
hosts: [ "wolf.uberspace.de" ]
|
|
|
|
user: martens7
|
2020-01-04 16:37:27 +01:00
|
|
|
source: /drone/src/_site/.
|
2019-04-28 14:38:36 +02:00
|
|
|
target: ~/tmp/build
|
|
|
|
recursive: true
|
|
|
|
delete: true
|
2020-01-04 16:37:27 +01:00
|
|
|
port: 22
|
2020-01-04 16:27:39 +01:00
|
|
|
key:
|
|
|
|
from_secret: rsync_key
|
2019-04-28 14:38:36 +02:00
|
|
|
script:
|
2018-07-04 10:18:05 +02:00
|
|
|
- shopt -s dotglob
|
2018-07-03 14:32:57 +02:00
|
|
|
- rm -rf tmp/old.build
|
|
|
|
- mkdir tmp/old.build
|
2018-07-04 10:18:05 +02:00
|
|
|
- cp -r html/* tmp/old.build/
|
|
|
|
- rm -rf html/*
|
|
|
|
- cp -r tmp/build/* html/
|
2018-07-03 14:32:57 +02:00
|
|
|
- rm -rf tmp/build
|
2019-04-28 14:38:36 +02:00
|
|
|
- name: notify
|
2018-07-03 14:32:57 +02:00
|
|
|
image: drillster/drone-email
|
2019-04-28 14:38:36 +02:00
|
|
|
environment:
|
|
|
|
EMAIL_USERNAME:
|
|
|
|
from_secret: email_username
|
|
|
|
EMAIL_PASSWORD:
|
|
|
|
from_secret: email_password
|
|
|
|
settings:
|
2020-01-04 13:11:13 +01:00
|
|
|
host: howell.uberspace.de
|
2019-04-28 14:38:36 +02:00
|
|
|
port: 587
|
|
|
|
from: Drone <drone@2martens.de>
|
|
|
|
secrets: [email_username, email_password]
|
2018-07-03 14:32:57 +02:00
|
|
|
when:
|
|
|
|
status: [ failure ]
|
|
|
|
|
2019-04-28 15:28:59 +02:00
|
|
|
volumes:
|
2019-04-28 15:44:16 +02:00
|
|
|
- name: cache
|
2019-04-28 15:28:59 +02:00
|
|
|
host:
|
2019-04-28 15:44:16 +02:00
|
|
|
path: /var/lib/drone/cache
|
2019-04-28 15:28:59 +02:00
|
|
|
|
|
|
|
|
2019-04-28 14:38:36 +02:00
|
|
|
trigger:
|
|
|
|
branch:
|
|
|
|
- master
|