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.

70 lines
1.9 KiB

  1. build:
  2. box: node:8-alpine
  3. steps:
  4. - script:
  5. name: install dependencies
  6. code: |
  7. apk update
  8. apk add bash build-base curl git openssh yarn
  9. - script:
  10. name: yarn install
  11. code: |
  12. yarn config set cache-folder "$WERCKER_CACHE_DIR/yarn"
  13. yarn install
  14. - script:
  15. name: build
  16. code: yarn run build
  17. - npm-test
  18. - script:
  19. name: purge dev files
  20. code: |
  21. yarn install --production --ignore-scripts --prefer-offline
  22. - script:
  23. name: copy artifacts
  24. code: cp assets server config.sample.yml package.json wiki.cmd wiki.js "$WERCKER_OUTPUT_DIR"
  25. deploy-github:
  26. box: node:8-alpine
  27. steps:
  28. - script:
  29. name: package
  30. code: |
  31. tar -chzfv wiki-js.tar.gz * -X .build/.deployexclude
  32. tar -chzfv node_modules.tar.gz node_modules
  33. SEMVER_LAST=`npm show wiki.js version`
  34. chmod +x ./.build/semver_next.sh
  35. SEMVER_NEXT=`./.build/semver_next.sh -p $SEMVER_LAST`
  36. - github-create-release:
  37. token: $GITHUB_TOKEN
  38. tag: "v${SEMVER_NEXT}"
  39. prerelease: true
  40. - github-upload-asset:
  41. token: $GITHUB_TOKEN
  42. file: wiki-js.tar.gz
  43. - github-upload-asset:
  44. token: $GITHUB_TOKEN
  45. file: node_modules.tar.gz
  46. deploy-docker-master:
  47. box: node:8-alpine
  48. steps:
  49. - internal/docker-scratch-push:
  50. username: $DOCKER_HUB_USERNAME
  51. password: $DOCKER_HUB_PASSWORD
  52. tag: latest, master
  53. ports: "3000"
  54. entrypoint: node server
  55. repository: requarks/wiki
  56. registry: https://registry.hub.docker.com
  57. deploy-docker-dev:
  58. box: node:8-alpine
  59. steps:
  60. - internal/docker-scratch-push:
  61. username: $DOCKER_HUB_USERNAME
  62. password: $DOCKER_HUB_PASSWORD
  63. tag: dev
  64. ports: "3000"
  65. entrypoint: node server
  66. repository: requarks/wiki
  67. registry: https://registry.hub.docker.com