wikijs-fork/wercker.yml

74 lines
2.0 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
- script:
2017-08-11 23:54:16 +00:00
name: copy artifacts
code: |
2017-08-12 00:45:13 +00:00
cp -LR assets node_modules server config.sample.yml package.json wiki.cmd wiki.js "$WERCKER_OUTPUT_DIR/var/wiki"
cp .build/docker_init.sh "$WERCKER_OUTPUT_DIR/init.sh"
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 00:08:00 +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 00:45:13 +00:00
entrypoint: ["ash", "/init.sh"]
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 00:08:00 +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 00:45:13 +00:00
entrypoint: ["ash", "/init.sh"]
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: |
tar -chzfv wiki-js.tar.gz * -X .build/.deployexclude
tar -chzfv node_modules.tar.gz node_modules
SEMVER_LAST=`npm show wiki.js version`
chmod +x ./.build/semver_next.sh
SEMVER_NEXT=`./.build/semver_next.sh -p $SEMVER_LAST`
- github-create-release:
token: $GITHUB_TOKEN
tag: "v${SEMVER_NEXT}"
prerelease: true
- github-upload-asset:
token: $GITHUB_TOKEN
file: wiki-js.tar.gz
- github-upload-asset:
token: $GITHUB_TOKEN
file: node_modules.tar.gz