box: node:6.10 services: - mongo:3.4 test: steps: - script: name: set yarn cache-folder code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn - script: name: install dependencies code: | yarn global add npm@4 yarn install - script: name: print dependencies code: yarn list --depth=0 - script: name: npm test code: | export MONGO_URI=mongodb://$MONGO_PORT_27017_TCP_ADDR/crowi_test echo "export MONGO_URI=$MONGO_URI" npm test build-prod: steps: - script: name: set yarn cache-folder code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn - script: name: install dependencies code: | yarn global add npm@4 yarn install --production - script: name: print dependencies code: yarn list --depth=0 - script: name: npm run build:prod code: | npm run build:prod build-dev: steps: - script: name: set yarn cache-folder code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn - script: name: install dependencies code: | yarn global add npm@4 yarn install - script: name: print dependencies code: yarn list --depth=0 - script: name: npm run build:dev code: | npm run build:dev release: # would be run on release branch steps: - script: name: bump version code: | sh ./bin/wercker/init-git.sh # npm version to bump version npm version patch # get version RELEASE_VERSION=`npm run version --silent` echo "RELEASE_VERSION=$RELEASE_VERSION" - script: name: commit and push code: | TMP_RELEASE_BRANCH=tmp/release-$RELEASE_VERSION git checkout -B $TMP_RELEASE_BRANCH git push -u origin HEAD:$TMP_RELEASE_BRANCH TARGET_COMMITISH=`git rev-parse HEAD` - github-create-release: token: $GITHUB_TOKEN tag: v$RELEASE_VERSION target-commitish: $TARGET_COMMITISH - script: name: remove temporary release branch code: | git push --delete origin $TMP_RELEASE_BRANCH trigger-crowi-plus-docker: steps: - script: name: trigger crowi-plus-docker release pipeline code: |- # strip linebreak curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $WERCKER_TOKEN" https://app.wercker.com/api/v3/runs -d '{ "pipelineId": "$TARGET_PIPELINE_ID", "sourceRunId": "$WERCKER_RUN_ID", "branch": "release", "envVars": [ { "key": "RELEASE_VERSION", "value": "$RELEASE_VERSION" } ] }'