Carbon/.drone.yml

59 lines
1.3 KiB
YAML
Raw Normal View History

2020-10-19 13:16:38 +00:00
kind: pipeline
2020-10-19 14:17:29 +00:00
type: docker
2020-10-19 13:16:38 +00:00
name: default
steps:
2020-10-19 14:17:29 +00:00
- name: build
image: node:current-alpine3.12
2020-10-19 13:16:38 +00:00
commands:
- npm install -D
- npm run rebuild
2020-10-20 08:39:10 +00:00
- name: package
image: fuww/alpine-zip
when:
event:
- push
2020-10-20 08:39:10 +00:00
commands:
- SHORTREV=`echo $DRONE_COMMIT | cut -b 1-8`
- echo NAME=`date +%Y%m%d%H%m`-$SHORTREV >> environment
2020-10-20 08:39:10 +00:00
- source environment
- zip -r $NAME.zip build
- name: dev.carbon.chat
image: drillster/drone-rsync
when:
event:
- push
settings:
hosts:
from_secret: SSH_HOST
port:
from_secret: SSH_PORT
user:
from_secret: SSH_USERNAME
key:
from_secret: SSH_KEY
source: ./build/*
target: ${DRONE_COMMIT_SHA:0:8}
recursive: true
2020-10-20 08:39:10 +00:00
- name: b2
image: tianon/backblaze-b2:2
2020-10-20 09:56:11 +00:00
when:
event:
- push
2020-10-20 08:39:10 +00:00
environment:
BUCKET: carbon-artifacts
ACCOUNT:
2020-10-20 08:39:10 +00:00
from_secret: b2_account_id
KEY:
2020-10-20 08:39:10 +00:00
from_secret: b2_application_key
COMMIT: ${DRONE_COMMIT_SHA:0:8}
2020-10-20 08:39:10 +00:00
commands:
- source environment
- b2 authorize-account $ACCOUNT $KEY
- b2 upload-file $BUCKET $NAME.zip $NAME.zip
- echo Build artifacts avaliable at `b2 make-friendly-url $BUCKET $NAME.zip` and at https://dev.carbon.chat/$COMMIT