2
0

wercker.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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:analyze
  81. code: |
  82. npm run build:dev:analyze
  83. after-steps:
  84. -script:
  85. name: copy report to artifacts
  86. code: |
  87. cp -r report $WERCKER_REPORT_ARTIFACTS_DIR
  88. - slack-notifier:
  89. url: $SLACK_WEBHOOK_URL
  90. channel: ci
  91. username: wercker
  92. notify_on: "failed"
  93. release: # would be run on release branch
  94. steps:
  95. - install-packages:
  96. packages: jq
  97. - script:
  98. name: bump version
  99. code: |
  100. sh ./bin/wercker/init-git.sh
  101. # git reset
  102. git reset --hard
  103. # npm version to bump version
  104. npm version patch
  105. # get version
  106. export RELEASE_VERSION=`npm run version --silent`
  107. echo "export RELEASE_VERSION=$RELEASE_VERSION"
  108. - script:
  109. name: commit and push
  110. code: |
  111. TMP_RELEASE_BRANCH=tmp/release-$RELEASE_VERSION
  112. git checkout -B $TMP_RELEASE_BRANCH
  113. git push -u origin HEAD:$TMP_RELEASE_BRANCH
  114. TARGET_COMMITISH=`git rev-parse HEAD`
  115. - github-create-release:
  116. token: $GITHUB_TOKEN
  117. tag: v$RELEASE_VERSION
  118. target-commitish: $TARGET_COMMITISH
  119. - script:
  120. name: remove temporary release branch
  121. code: |
  122. git push --delete origin $TMP_RELEASE_BRANCH
  123. - script:
  124. name: trigger crowi-plus-docker release pipeline
  125. code: sh ./bin/wercker/trigger-crowi-plus-docker.sh
  126. after-steps:
  127. - slack-notifier:
  128. url: $SLACK_WEBHOOK_URL
  129. channel: ci
  130. username: wercker
  131. notify_on: "failed"