wercker.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. box: node:6.11
  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. after-steps:
  24. - slack-notifier:
  25. url: $SLACK_WEBHOOK_URL
  26. channel: ci
  27. username: wercker
  28. notify_on: "failed"
  29. build-prod:
  30. steps:
  31. - script:
  32. name: set yarn cache-folder
  33. code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn
  34. - script:
  35. name: install dependencies
  36. code: |
  37. yarn global add npm@4
  38. yarn install --production
  39. - script:
  40. name: install plugins
  41. code: |
  42. yarn add crowi-plugin-lsx
  43. yarn add crowi-plugin-pukiwiki-like-linker
  44. - script:
  45. name: print dependencies
  46. code: yarn list --depth=0
  47. - script:
  48. name: npm run build:prod
  49. code: |
  50. npm run build:prod
  51. after-steps:
  52. - slack-notifier:
  53. url: $SLACK_WEBHOOK_URL
  54. channel: ci
  55. username: wercker
  56. notify_on: "failed"
  57. build-dev:
  58. steps:
  59. - script:
  60. name: set yarn cache-folder
  61. code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn
  62. - script:
  63. name: install dependencies
  64. code: |
  65. yarn global add npm@4
  66. yarn install
  67. - script:
  68. name: install plugins
  69. code: |
  70. yarn add crowi-plugin-lsx
  71. yarn add crowi-plugin-pukiwiki-like-linker
  72. - script:
  73. name: print dependencies
  74. code: yarn list --depth=0
  75. - script:
  76. name: npm run build:dev
  77. code: |
  78. npm run build:dev
  79. after-steps:
  80. - slack-notifier:
  81. url: $SLACK_WEBHOOK_URL
  82. channel: ci
  83. username: wercker
  84. notify_on: "failed"
  85. release: # would be run on release branch
  86. steps:
  87. - install-packages:
  88. packages: jq
  89. - script:
  90. name: bump version
  91. code: |
  92. sh ./bin/wercker/init-git.sh
  93. # git reset
  94. git reset --hard
  95. # npm version to bump version
  96. npm version patch
  97. # get version
  98. export RELEASE_VERSION=`npm run version --silent`
  99. echo "export RELEASE_VERSION=$RELEASE_VERSION"
  100. - script:
  101. name: commit and push
  102. code: |
  103. TMP_RELEASE_BRANCH=tmp/release-$RELEASE_VERSION
  104. git checkout -B $TMP_RELEASE_BRANCH
  105. git push -u origin HEAD:$TMP_RELEASE_BRANCH
  106. TARGET_COMMITISH=`git rev-parse HEAD`
  107. - github-create-release:
  108. token: $GITHUB_TOKEN
  109. tag: v$RELEASE_VERSION
  110. target-commitish: $TARGET_COMMITISH
  111. - script:
  112. name: remove temporary release branch
  113. code: |
  114. git push --delete origin $TMP_RELEASE_BRANCH
  115. - script:
  116. name: trigger crowi-plus-docker release pipeline
  117. code: sh ./bin/wercker/trigger-crowi-plus-docker.sh
  118. after-steps:
  119. - slack-notifier:
  120. url: $SLACK_WEBHOOK_URL
  121. channel: ci
  122. username: wercker
  123. notify_on: "failed"