| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- 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
- prepare-to-release: # would be run on release branch
- steps:
- - script:
- name: bump version
- code: |
- git config --global user.name "wercker"
- git config --global user.email "info@weseek.co.jp"
- # npm version to bump version
- npm version patch
- # export $RELEASE_VERSION
- export RELEASE_VERSION=`npm run version --silent`
- echo "export RELEASE_VERSION=$RELEASE_VERSION"
- - script:
- name: push to github to create new branch
- code: |
- # reconfigure origin
- GITHUB_ORIGIN=https://yuki-takei:$GITHUB_TOKEN@$WERCKER_GIT_DOMAIN/$WERCKER_GIT_OWNER/$WERCKER_GIT_REPOSITORY.git
- git remote set-url origin $GITHUB_ORIGIN
- git checkout -B tmp/release-$RELEASE_VERSION
- git push -u origin HEAD:tmp/release-$RELEASE_VERSION
- release-to-github: # would be run on temporary release branch
- steps:
- - script:
- name: get version
- code: |
- export RELEASE_VERSION=`npm run version --silent`
- echo "export RELEASE_VERSION=$RELEASE_VERSION"
- - github-create-release:
- token: $GITHUB_TOKEN
- tag: v$RELEASE_VERSION
- - script:
- name: remove temporary release branch
- code: |
- git config --global user.name "wercker"
- git config --global user.email "info@weseek.co.jp"
- # reconfigure origin
- GITHUB_ORIGIN=https://yuki-takei:$GITHUB_TOKEN@$WERCKER_GIT_DOMAIN/$WERCKER_GIT_OWNER/$WERCKER_GIT_REPOSITORY.git
- git remote rm origin
- git remote add origin $GITHUB_ORIGIN
- # remove branch
- git push --delete origin $WERCKER_GIT_BRANCH
- # the pipeline that do nothing
- # this is needed while wercker can't detect specified branch pushed
- empty:
- steps:
- - script:
- code: echo "this is $WERCKER_GIT_BRANCH branch"
|