wercker.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. box: node:6.10
  2. services:
  3. - mongo:3.4
  4. test:
  5. steps:
  6. - script:
  7. name: set yarn cache-folder
  8. code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn
  9. - script:
  10. name: install dependencies
  11. code: |
  12. yarn global add npm@4
  13. yarn install
  14. - script:
  15. name: print dependencies
  16. code: yarn list --depth=0
  17. - script:
  18. name: npm test
  19. code: |
  20. export MONGO_URI=mongodb://$MONGO_PORT_27017_TCP_ADDR/crowi_test
  21. echo "export MONGO_URI=$MONGO_URI"
  22. npm test
  23. - wantedly/pretty-slack-notify:
  24. webhook_url: $SLACK_WEBHOOK_URL
  25. notify_on: "failed"
  26. build-prod:
  27. steps:
  28. - script:
  29. name: set yarn cache-folder
  30. code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn
  31. - script:
  32. name: install dependencies
  33. code: |
  34. yarn global add npm@4
  35. yarn install --production
  36. - script:
  37. name: print dependencies
  38. code: yarn list --depth=0
  39. - script:
  40. name: npm run build:prod
  41. code: |
  42. npm run build:prod
  43. - wantedly/pretty-slack-notify:
  44. webhook_url: $SLACK_WEBHOOK_URL
  45. notify_on: "failed"
  46. build-dev:
  47. steps:
  48. - script:
  49. name: set yarn cache-folder
  50. code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn
  51. - script:
  52. name: install dependencies
  53. code: |
  54. yarn global add npm@4
  55. yarn install
  56. - script:
  57. name: print dependencies
  58. code: yarn list --depth=0
  59. - script:
  60. name: npm run build:dev
  61. code: |
  62. npm run build:dev
  63. - wantedly/pretty-slack-notify:
  64. webhook_url: $SLACK_WEBHOOK_URL
  65. notify_on: "failed"
  66. release: # would be run on release branch
  67. steps:
  68. - install-packages:
  69. packages: jq ruby
  70. - script:
  71. name: bump version
  72. code: |
  73. sh ./bin/wercker/init-git.sh
  74. # npm version to bump version
  75. npm version patch
  76. # get version
  77. RELEASE_VERSION=`npm run version --silent`
  78. echo "RELEASE_VERSION=$RELEASE_VERSION"
  79. - script:
  80. name: commit and push
  81. code: |
  82. TMP_RELEASE_BRANCH=tmp/release-$RELEASE_VERSION
  83. git checkout -B $TMP_RELEASE_BRANCH
  84. git push -u origin HEAD:$TMP_RELEASE_BRANCH
  85. TARGET_COMMITISH=`git rev-parse HEAD`
  86. - github-create-release:
  87. token: $GITHUB_TOKEN
  88. tag: v$RELEASE_VERSION
  89. target-commitish: $TARGET_COMMITISH
  90. - script:
  91. name: remove temporary release branch
  92. code: |
  93. git push --delete origin $TMP_RELEASE_BRANCH
  94. - script:
  95. name: trigger crowi-plus-docker release pipeline
  96. code: |
  97. sh ./bin/wercker/trigger-crowi-plus-docker.sh
  98. - wantedly/pretty-slack-notify:
  99. webhook_url: $SLACK_WEBHOOK_URL
  100. passwd_message: :anchor: crowi-plus v$RELEASE_VERSION has been released!