You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

74 lines
2.1 KiB

build:
box: node:8
steps:
- script:
name: install dependencies
code: |
apt-get update
apt-get install build-essential -y
npm install -g yarn
- 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
- script:
name: purge dev files
code: |
yarn install --production --ignore-scripts --prefer-offline
- script:
name: copy artifacts
code: |
mkdir -p "$WERCKER_OUTPUT_DIR/var/wiki"
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"
deploy-docker-master:
box: node:8-alpine
steps:
- internal/docker-scratch-push:
username: $DOCKER_HUB_USERNAME
password: $DOCKER_HUB_PASSWORD
tag: latest, master
ports: "3000"
entrypoint: ["ash", "/init.sh"]
repository: requarks/wiki
registry: https://registry.hub.docker.com
deploy-docker-dev:
box: node:8-alpine
steps:
- internal/docker-scratch-push:
username: $DOCKER_HUB_USERNAME
password: $DOCKER_HUB_PASSWORD
tag: dev
ports: "3000"
entrypoint: ["ash", "/init.sh"]
repository: requarks/wiki
registry: https://registry.hub.docker.com
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