Go packages import redirector done right.
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.

68 lines
1.6KB

  1. ---
  2. kind: pipeline
  3. type: docker
  4. name: build
  5. steps:
  6. - name: notify-start
  7. image: pztrn/discordrone
  8. settings:
  9. webhook_id:
  10. from_secret: discord_webhook_id
  11. webhook_token:
  12. from_secret: discord_webhook_secret
  13. message: 'Starting building **{{repo.name}}#{{build.number}}@{{commit.sha}}** @ {{datetime build.started "02-Jan-2006 15:04:05 MST" "Asia/Yekaterinburg"}} (See {{build.link}} for logs).'
  14. - name: lint
  15. image: golangci/golangci-lint:latest
  16. environment:
  17. CGO_ENABLED: 0
  18. commands:
  19. - golangci-lint run
  20. depends_on:
  21. - notify-start
  22. - name: test
  23. image: golang:1.13.1-alpine
  24. environment:
  25. CGO_ENABLED: 0
  26. commands:
  27. - go test ./...
  28. depends_on:
  29. - notify-start
  30. - name: docker
  31. image: plugins/docker
  32. when:
  33. branch:
  34. master
  35. settings:
  36. username:
  37. from_secret: dockerhub_user
  38. password:
  39. from_secret: dockerhub_password
  40. repo: pztrn/giredore
  41. auto_tag: true
  42. depends_on:
  43. - lint
  44. - test
  45. - name: notify-end
  46. when:
  47. status:
  48. - success
  49. - failure
  50. image: pztrn/discordrone
  51. settings:
  52. webhook_id:
  53. from_secret: discord_webhook_id
  54. webhook_token:
  55. from_secret: discord_webhook_secret
  56. message: "
  57. {{#success build.status}}
  58. **{{repo.name}}#{{build.number}}@{{commit.sha}}** built in {{since build.startedint}} and pushed to hub.docker.com.
  59. {{ else }}
  60. **{{repo.name}}#{{build.number}}@{{commit.sha}}** failed. See {{build.link}}.
  61. {{/success}}"
  62. depends_on:
  63. - docker