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
|
2020-10-19 14:54:42 +00:00
|
|
|
image: node:current-alpine3.12
|
2020-10-19 13:16:38 +00:00
|
|
|
commands:
|
|
|
|
- npm install -D
|
|
|
|
- npm run rebuild
|
2020-10-20 09:30:08 +00:00
|
|
|
|
2020-10-20 08:39:10 +00:00
|
|
|
- name: package
|
2020-10-20 09:30:08 +00:00
|
|
|
image: fuww/alpine-zip
|
2020-10-20 08:39:10 +00:00
|
|
|
commands:
|
2020-10-20 09:30:08 +00:00
|
|
|
- SHORTREV=`echo $DRONE_COMMIT | cut -b 1-8`
|
|
|
|
- echo FILENAME=`date +%Y%m%d%H%m`-$SHORTREV.zip >> environment
|
2020-10-20 08:39:10 +00:00
|
|
|
- source environment
|
|
|
|
- zip -r $FILENAME build
|
|
|
|
|
|
|
|
- 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
|
2020-10-20 08:47:14 +00:00
|
|
|
ACCOUNT:
|
2020-10-20 08:39:10 +00:00
|
|
|
from_secret: b2_account_id
|
2020-10-20 08:47:14 +00:00
|
|
|
KEY:
|
2020-10-20 08:39:10 +00:00
|
|
|
from_secret: b2_application_key
|
|
|
|
commands:
|
|
|
|
- source environment
|
2020-10-20 08:47:14 +00:00
|
|
|
- b2 authorize-account $ACCOUNT $KEY
|
2020-10-20 08:39:10 +00:00
|
|
|
- b2 upload-file $BUCKET $FILENAME $FILENAME
|
|
|
|
- echo Build artifacts avaliable at `b2 make-friendly-url $BUCKET $FILENAME`
|