wercker.yml 3.3 KB

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