You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.6 KiB

  1. build:
  2. box: node:8
  3. steps:
  4. - script:
  5. name: install dependencies
  6. code: |
  7. apt-get update
  8. apt-get install build-essential -y
  9. npm install -g yarn
  10. - script:
  11. name: yarn install
  12. code: |
  13. yarn config set cache-folder "$WERCKER_CACHE_DIR/yarn"
  14. yarn install
  15. - script:
  16. name: build
  17. code: yarn run build
  18. - npm-test
  19. - script:
  20. name: purge dev files
  21. code: |
  22. yarn install --production --ignore-scripts --prefer-offline
  23. deploy-docker-master:
  24. box: node:8-alpine
  25. steps:
  26. - script:
  27. name: install dependencies
  28. code: |
  29. apk update
  30. apk add bash curl git openssh
  31. - script:
  32. name: copy app files
  33. code: |
  34. mkdir -p /var/wiki
  35. cp -LR assets node_modules server config.sample.yml package.json LICENSE /var/wiki
  36. rm -rf /pipeline
  37. - internal/docker-push:
  38. username: $DOCKER_HUB_USERNAME
  39. password: $DOCKER_HUB_PASSWORD
  40. tag: latest, master
  41. ports: "3000"
  42. working-dir: /var/wiki
  43. entrypoint: node server
  44. env: "WIKI_JS_HEROKU=1"
  45. repository: requarks/wiki
  46. registry: https://registry.hub.docker.com
  47. deploy-docker-dev:
  48. box: node:8-alpine
  49. steps:
  50. - script:
  51. name: install dependencies
  52. code: |
  53. apk update
  54. apk add bash curl git openssh
  55. - script:
  56. name: copy app files
  57. code: |
  58. mkdir -p /var/wiki
  59. cp -LR assets node_modules server config.sample.yml package.json LICENSE /var/wiki
  60. rm -rf /pipeline
  61. - internal/docker-push:
  62. username: $DOCKER_HUB_USERNAME
  63. password: $DOCKER_HUB_PASSWORD
  64. tag: dev
  65. ports: "3000"
  66. working-dir: /var/wiki
  67. entrypoint: node server
  68. repository: requarks/wiki
  69. registry: https://registry.hub.docker.com
  70. deploy-github:
  71. box: node:8
  72. steps:
  73. - script:
  74. name: package
  75. code: |
  76. tar -chzf wiki-js.tar.gz assets server config.sample.yml package.json wiki.js LICENSE
  77. tar -chzf node_modules.tar.gz node_modules
  78. SEMVER_NEXT=`curl --request POST --url https://beta.requarks.io/api/version/increment --header "authorization: $WIKIJSORG_TOKEN" --header 'cache-control: no-cache' --header 'content-type: application/json' --data '{"channel": "stable"}'`
  79. - github-create-release:
  80. token: $GITHUB_TOKEN
  81. tag: "v${SEMVER_NEXT}"
  82. prerelease: true
  83. title: "$SEMVER_NEXT Release"
  84. - github-upload-asset:
  85. token: $GITHUB_TOKEN
  86. file: wiki-js.tar.gz
  87. - github-upload-asset:
  88. token: $GITHUB_TOKEN
  89. file: node_modules.tar.gz