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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 

136 lines
3.4 KiB

  1. local PipelineBuild(os='linux', arch='amd64') = {
  2. local tag = os + '-' + arch,
  3. local version_tag = os + '-' + arch,
  4. local file_suffix = std.strReplace(version_tag, '-', '.'),
  5. kind: "pipeline",
  6. name: version_tag,
  7. platform: {
  8. os: os,
  9. arch: arch,
  10. },
  11. steps: [
  12. {
  13. name: 'dryrun',
  14. image: 'plugins/docker:' + tag,
  15. pull: 'always',
  16. settings: {
  17. dry_run: true,
  18. tags: version_tag,
  19. dockerfile: './Dockerfile.' + file_suffix,
  20. repo: ' xoxys/ttrss',
  21. username: { from_secret: "docker_username" },
  22. password: { from_secret: "docker_password" },
  23. build_args: {
  24. TTRSS_ORG_VERSION: "${DRONE_TAG##v}",
  25. TTRSS_VERSION: "${TTRSS_ORG_VERSION%.*}",
  26. },
  27. },
  28. },
  29. {
  30. name: 'publish',
  31. image: 'plugins/docker:' + tag,
  32. pull: 'always',
  33. settings: {
  34. auto_tag: true,
  35. auto_tag_suffix: version_tag,
  36. dockerfile: './Dockerfile.' + file_suffix,
  37. repo: ' xoxys/ttrss',
  38. username: { from_secret: "docker_username" },
  39. password: { from_secret: "docker_password" },
  40. build_args: {
  41. TTRSS_ORG_VERSION: "${DRONE_TAG##v}",
  42. TTRSS_VERSION: "${TTRSS_ORG_VERSION%.*}",
  43. },
  44. },
  45. when: {
  46. ref: [
  47. 'refs/heads/master',
  48. 'refs/tags/**',
  49. ],
  50. },
  51. },
  52. ],
  53. };
  54. local PipelineNotifications(depends_on=[]) = {
  55. kind: "pipeline",
  56. name: "notifications",
  57. platform: {
  58. os: "linux",
  59. arch: "amd64",
  60. },
  61. steps: [
  62. {
  63. image: "plugins/manifest",
  64. name: "manifest",
  65. pull: "always",
  66. settings: {
  67. auto_tag: true,
  68. ignore_missing: true,
  69. username: { from_secret: "docker_username" },
  70. password: { from_secret: "docker_password" },
  71. spec: "./manifest.tmpl",
  72. },
  73. when: {
  74. ref: [
  75. 'refs/heads/master',
  76. 'refs/tags/**',
  77. ],
  78. },
  79. },
  80. {
  81. name: "readme",
  82. image: "sheogorath/readme-to-dockerhub",
  83. pull: "always",
  84. environment: {
  85. DOCKERHUB_USERNAME: { from_secret: "docker_username" },
  86. DOCKERHUB_PASSWORD: { from_secret: "docker_password" },
  87. DOCKERHUB_REPO_PREFIX: "xoxys",
  88. DOCKERHUB_REPO_NAME: "ttrss",
  89. README_PATH: "README.md",
  90. SHORT_DESCRIPTION: "Tiny Tiny RSS - Free and open source news feed reader and aggregator"
  91. },
  92. when: {
  93. ref: [
  94. 'refs/heads/master',
  95. 'refs/tags/**',
  96. ],
  97. },
  98. },
  99. {
  100. name: "microbadger",
  101. image: "plugins/webhook",
  102. pull: "always",
  103. settings: {
  104. urls: { from_secret: "microbadger_url" },
  105. },
  106. },
  107. {
  108. image: "plugins/matrix",
  109. name: "matrix",
  110. pull: 'always',
  111. settings: {
  112. homeserver: "https://matrix.rknet.org",
  113. roomid: "MtidqQXWWAtQcByBhH:rknet.org",
  114. template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}",
  115. username: { from_secret: "matrix_username" },
  116. password: { from_secret: "matrix_password" },
  117. },
  118. when: {
  119. status: [ "success", "failure" ],
  120. },
  121. },
  122. ],
  123. trigger: {
  124. status: [ "success", "failure" ],
  125. },
  126. depends_on: depends_on,
  127. };
  128. [
  129. PipelineBuild(os='linux', arch='amd64'),
  130. PipelineNotifications(depends_on=[
  131. "linux-amd64",
  132. ])
  133. ]