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.

78 lines
2.0 KiB

  1. build:
  2. box: node:8
  3. steps:
  4. - script:
  5. name: install dependencies
  6. code: |
  7. apt update
  8. apt install build-essential
  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. - script:
  24. name: copy artifacts
  25. code: |
  26. ls
  27. cp -LR assets node_modules server config.sample.yml package.json wiki.cmd wiki.js "$WERCKER_OUTPUT_DIR"
  28. deploy-github:
  29. box: node:8
  30. steps:
  31. - script:
  32. name: package
  33. code: |
  34. tar -chzfv wiki-js.tar.gz * -X .build/.deployexclude
  35. tar -chzfv node_modules.tar.gz node_modules
  36. SEMVER_LAST=`npm show wiki.js version`
  37. chmod +x ./.build/semver_next.sh
  38. SEMVER_NEXT=`./.build/semver_next.sh -p $SEMVER_LAST`
  39. - github-create-release:
  40. token: $GITHUB_TOKEN
  41. tag: "v${SEMVER_NEXT}"
  42. prerelease: true
  43. - github-upload-asset:
  44. token: $GITHUB_TOKEN
  45. file: wiki-js.tar.gz
  46. - github-upload-asset:
  47. token: $GITHUB_TOKEN
  48. file: node_modules.tar.gz
  49. deploy-docker-master:
  50. box: node:8-alpine
  51. steps:
  52. - script:
  53. name: install dependencies
  54. code: |
  55. apk update
  56. apk add bash curl git openssh
  57. - internal/docker-scratch-push:
  58. username: $DOCKER_HUB_USERNAME
  59. password: $DOCKER_HUB_PASSWORD
  60. tag: latest, master
  61. ports: "3000"
  62. entrypoint: node server
  63. repository: requarks/wiki
  64. registry: https://registry.hub.docker.com
  65. deploy-docker-dev:
  66. box: node:8-alpine
  67. steps:
  68. - internal/docker-scratch-push:
  69. username: $DOCKER_HUB_USERNAME
  70. password: $DOCKER_HUB_PASSWORD
  71. tag: dev
  72. ports: "3000"
  73. entrypoint: node server
  74. repository: requarks/wiki
  75. registry: https://registry.hub.docker.com