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 # add assets-webpack-plugin individually # because `yarn install` couldn't find package from the "npm" registry yarn add assets-webpack-plugin 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 # add assets-webpack-plugin individually # because `yarn install` couldn't find package from the "npm" registry yarn add assets-webpack-plugin 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 # add assets-webpack-plugin individually # because `yarn install` couldn't find package from the "npm" registry yarn add assets-webpack-plugin yarn install - script: name: print dependencies code: yarn list --depth=0 - script: name: npm run build:dev code: | npm run build:dev release-to-github: # would be run on release branch 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: bump version code: | # npm version to bump version git config --global user.name "wercker" git config --global user.email "info@weseek.co.jp" npm version patch # export $RELEASE_VERSION export RELEASE_VERSION=`npm run version --silent` echo "export RELEASE_VERSION=$RELEASE_VERSION" - script: name: push to github code: | git remote rm origin GITHUB_ORIGIN=`git remote get-url origin | sed "s/github.com/yuki-takei:$GITHUB_TOKEN@github.com/"` git remote add origin $GITHUB_ORIGIN git push - github-create-release: token: $GITHUB_TOKEN tag: v$RELEASE_VERSION