Carbon/.drone.yml
Bad 69a9e2ed2f
All checks were successful
continuous-integration/drone/push Build is passing
💚 Fix drone build due to missing git
2020-11-25 08:18:46 +01:00

60 lines
1.3 KiB
YAML

kind: pipeline
type: docker
name: default
steps:
- name: build
image: node:current-alpine3.12
commands:
- apk update
- apk add git
- npm install -D
- npm run rebuild
- name: package
image: fuww/alpine-zip
when:
event:
- push
commands:
- SHORTREV=`echo $DRONE_COMMIT | cut -b 1-8`
- echo NAME=`date +%Y%m%d%H%m`-$SHORTREV >> environment
- 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
- name: b2
image: tianon/backblaze-b2:2
when:
event:
- push
environment:
BUCKET: carbon-artifacts
ACCOUNT:
from_secret: b2_account_id
KEY:
from_secret: b2_application_key
COMMIT: ${DRONE_COMMIT_SHA:0:8}
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