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.

67 lines
1.8 KiB

  1. box: node:8-alpine
  2. build:
  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. deploy-github:
  19. steps:
  20. - script:
  21. name: package
  22. code: |
  23. tar -chzfv wiki-js.tar.gz * -X .build/.deployexclude
  24. yarn install --production --ignore-scripts --prefer-offline
  25. tar -chzfv node_modules.tar.gz node_modules
  26. SEMVER_LAST=`npm show wiki.js version`
  27. chmod +x ./.build/semver_next.sh
  28. SEMVER_NEXT=`./.build/semver_next.sh -p $SEMVER_LAST`
  29. - github-create-release:
  30. token: $GITHUB_TOKEN
  31. tag: "v${SEMVER_NEXT}"
  32. prerelease: true
  33. - github-upload-asset:
  34. token: $GITHUB_TOKEN
  35. file: wiki-js.tar.gz
  36. - github-upload-asset:
  37. token: $GITHUB_TOKEN
  38. file: node_modules.tar.gz
  39. deploy-docker-master:
  40. steps:
  41. - script:
  42. name: remove dev dependencies
  43. code: |
  44. yarn install --production --ignore-scripts --prefer-offline
  45. apk update
  46. apk del build-base yarn
  47. - internal/docker-push:
  48. username: $DOCKER_HUB_USERNAME
  49. password: $DOCKER_HUB_PASSWORD
  50. tag: latest, master
  51. ports: "3000"
  52. entrypoint: node server
  53. repository: requarks/wiki
  54. registry: https://registry.hub.docker.com
  55. deploy-docker-dev:
  56. steps:
  57. - internal/docker-push:
  58. username: $DOCKER_HUB_USERNAME
  59. password: $DOCKER_HUB_PASSWORD
  60. tag: dev
  61. ports: "3000"
  62. entrypoint: node server
  63. repository: requarks/wiki
  64. registry: https://registry.hub.docker.com