wikijs-fork/wercker.yml

93 lines
2.6 KiB
YAML
Raw Normal View History

2017-07-23 20:42:45 +00:00
build:
2017-08-11 23:54:16 +00:00
box: node:8
2017-07-23 20:42:45 +00:00
steps:
- script:
2017-07-23 20:51:15 +00:00
name: install dependencies
2017-07-23 20:42:45 +00:00
code: |
2017-08-12 00:01:42 +00:00
apt-get update
apt-get install build-essential -y
2017-08-12 00:00:34 +00:00
npm install -g yarn
2017-07-23 20:42:45 +00:00
- script:
name: yarn install
code: |
yarn config set cache-folder "$WERCKER_CACHE_DIR/yarn"
yarn install
- script:
name: build
code: yarn run build
- npm-test
2017-08-11 23:45:53 +00:00
- script:
name: purge dev files
code: |
yarn install --production --ignore-scripts --prefer-offline
2017-08-11 20:37:17 +00:00
deploy-docker-master:
2017-08-11 23:45:53 +00:00
box: node:8-alpine
2017-08-11 23:56:27 +00:00
steps:
2017-08-12 02:33:52 +00:00
- script:
name: install dependencies
code: |
apk update
apk add bash curl git openssh
- script:
name: copy app files
code: |
mkdir -p /var/wiki
2017-08-25 01:47:25 +00:00
cp -LR assets node_modules server config.sample.yml package.json LICENSE /var/wiki
2017-08-12 02:45:02 +00:00
rm -rf /pipeline
2017-08-12 02:33:52 +00:00
- internal/docker-push:
2017-08-11 20:37:17 +00:00
username: $DOCKER_HUB_USERNAME
password: $DOCKER_HUB_PASSWORD
tag: latest, master
ports: "3000"
2017-08-12 02:33:52 +00:00
working-dir: /var/wiki
entrypoint: node server
2017-08-12 14:37:59 +00:00
env: "WIKI_JS_HEROKU=1"
2017-08-11 20:37:17 +00:00
repository: requarks/wiki
registry: https://registry.hub.docker.com
deploy-docker-dev:
2017-08-11 23:45:53 +00:00
box: node:8-alpine
2017-07-24 01:50:50 +00:00
steps:
2017-08-12 14:37:59 +00:00
- script:
name: install dependencies
code: |
apk update
apk add bash curl git openssh
- script:
name: copy app files
code: |
mkdir -p /var/wiki
2017-08-25 01:47:25 +00:00
cp -LR assets node_modules server config.sample.yml package.json LICENSE /var/wiki
2017-08-12 14:37:59 +00:00
rm -rf /pipeline
2017-08-12 02:33:52 +00:00
- internal/docker-push:
2017-07-24 01:50:50 +00:00
username: $DOCKER_HUB_USERNAME
password: $DOCKER_HUB_PASSWORD
2017-08-11 20:37:17 +00:00
tag: dev
2017-07-24 01:50:50 +00:00
ports: "3000"
2017-08-12 14:37:59 +00:00
working-dir: /var/wiki
2017-08-12 02:33:52 +00:00
entrypoint: node server
2017-07-24 01:50:50 +00:00
repository: requarks/wiki
registry: https://registry.hub.docker.com
2017-08-12 00:45:13 +00:00
deploy-github:
box: node:8
steps:
- script:
name: package
code: |
2017-08-26 14:18:19 +00:00
tar -chzf wiki-js.tar.gz assets server config.sample.yml package.json wiki.js LICENSE
tar -chzf node_modules.tar.gz node_modules
2017-08-30 01:31:03 +00:00
SEMVER_NEXT=`curl --request POST --url https://beta.requarks.io/api/version/increment --header "authorization: $WIKIJSORG_TOKEN" --header 'cache-control: no-cache' --header 'content-type: application/json' --data '{"channel": "stable"}'`
2017-08-12 00:45:13 +00:00
- github-create-release:
token: $GITHUB_TOKEN
tag: "v${SEMVER_NEXT}"
prerelease: true
2017-08-30 01:11:31 +00:00
title: "$SEMVER_NEXT Release"
2017-08-12 00:45:13 +00:00
- github-upload-asset:
token: $GITHUB_TOKEN
file: wiki-js.tar.gz
- github-upload-asset:
token: $GITHUB_TOKEN
file: node_modules.tar.gz