Baphomet is the dedicated bot for nulloctet matrix
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.

241 lines
7.1 KiB

  1. ---
  2. resource_types:
  3. - name: helm
  4. type: docker-image
  5. source:
  6. repository: linkyard/concourse-helm-resource
  7. resources:
  8. - name: git-develop
  9. type: git
  10. icon: git
  11. source:
  12. uri: ssh://git@git.nulloctet.com:8437/warricksothr/baphomet-js.git
  13. private_key: |
  14. ((pull_key))
  15. branch: develop
  16. ignore_paths:
  17. - pipeline.yml
  18. - scripts/upload_pipeline.sh
  19. - README.md
  20. - CONTRIBUTING.md
  21. - LICENSE.md
  22. - name: git-master
  23. type: git
  24. icon: git
  25. source:
  26. uri: ssh://git@git.nulloctet.com:8437/warricksothr/baphomet-js.git
  27. private_key: |
  28. ((pull_key))
  29. branch: master
  30. ignore_paths:
  31. - pipeline.yml
  32. - scripts/upload_pipeline.sh
  33. - README.md
  34. - CONTRIBUTING.md
  35. - LICENSE.md
  36. - name: docker-image
  37. type: docker-image
  38. icon: docker
  39. source:
  40. repository: ((nexus_docker_write.host))/nulloctet/baphomet-js
  41. username: ((nexus_docker_write.username))
  42. password: ((nexus_docker_write.password))
  43. - name: helm
  44. type: helm
  45. source:
  46. cluster_url: ((helm.cluster_url))
  47. cluster_ca: ((helm.cluster_ca))
  48. token: ((helm.token))
  49. jobs:
  50. # Development Pipeline
  51. - name: test-develop
  52. plan:
  53. - get: git-develop
  54. trigger: true
  55. - task: run-tests
  56. config:
  57. platform: linux
  58. image_resource:
  59. type: registry-image
  60. source: { repository: node, tag: "12.14-stretch" }
  61. inputs:
  62. - name: git-develop
  63. run:
  64. path: /bin/sh
  65. args:
  66. - -c
  67. - |
  68. echo "Node Version: $(node --version)"
  69. echo "NPM Version: $(npm --version)"
  70. cd git-develop
  71. npm install
  72. npm test
  73. - name: deploy-develop-image
  74. plan:
  75. - get: git-develop
  76. passed: [test-develop]
  77. trigger: true
  78. - task: capture-version
  79. config:
  80. platform: linux
  81. image_resource:
  82. type: registry-image
  83. source: { repository: bitnami/git, tag: "2-debian-9" }
  84. inputs:
  85. - name: git-develop
  86. outputs:
  87. - name: version
  88. run:
  89. path: /bin/sh
  90. args:
  91. - -c
  92. - |
  93. cd git-develop
  94. chmod +x ././scripts/get_*.sh
  95. echo $(./scripts/get_build.sh) > ../version/build.info
  96. echo $(./scripts/get_version.sh) > ../version/version.info
  97. echo $(./scripts/get_tag.sh) > ../version/tag.info
  98. echo "dev" > ../version/tag
  99. echo "Build Information: $(cat ../version/build.info)"
  100. echo "Version Information: $(cat ../version/version.info)"
  101. echo "Tag Information: $(cat ../version/tag.info)"
  102. echo "Docker Image Tag: $(cat ../version/tag)"
  103. - task: package
  104. config:
  105. platform: linux
  106. image_resource:
  107. type: registry-image
  108. source: { repository: debian, tag: "stretch-slim" }
  109. inputs:
  110. - name: git-develop
  111. - name: version
  112. outputs:
  113. - name: package
  114. run:
  115. path: /bin/sh
  116. args:
  117. - -c
  118. - |
  119. cd package
  120. cp ../version/* .
  121. cp ../git-develop/package*.json .
  122. cp ../git-develop/index.js .
  123. cp -r ../git-develop/assets .
  124. cp -r ../git-develop/bot .
  125. cp -r ../git-develop/data .
  126. cp ../git-develop/entrypoint.sh .
  127. cp ../git-develop/Dockerfile .
  128. cp ../git-develop/README.md .
  129. cp ../git-develop/LICENSE.md .
  130. ls -al .
  131. - put: docker-image
  132. params:
  133. build: package
  134. tag_file: package/tag
  135. tag_as_latest: false
  136. - name: deploy-develop-helm
  137. plan:
  138. - get: git-develop
  139. passed: [deploy-develop-image]
  140. trigger: true
  141. - put: helm
  142. params:
  143. chart: git-develop/.helm
  144. values: git-develop/.helm/values.yaml
  145. release: baphomet-js-dev
  146. override_values:
  147. - key: image.tag
  148. value: dev
  149. - key: image.pullPolicy
  150. value: Always
  151. - key: app.env.node_env
  152. value: development
  153. recreate_pods: true
  154. # Release Pipeline
  155. - name: test-release
  156. plan:
  157. - get: git-master
  158. trigger: true
  159. - task: run-tests
  160. config:
  161. platform: linux
  162. image_resource:
  163. type: registry-image
  164. source: { repository: node, tag: "12.14-stretch" }
  165. inputs:
  166. - name: git-master
  167. run:
  168. path: /bin/sh
  169. args:
  170. - -c
  171. - |
  172. echo "Node Version: $(node --version)"
  173. echo "NPM Version: $(npm --version)"
  174. cd git-master
  175. npm install
  176. npm test
  177. - name: deploy-release-image
  178. plan:
  179. - get: git-master
  180. passed: [test-release]
  181. trigger: true
  182. - task: capture-version
  183. config:
  184. platform: linux
  185. image_resource:
  186. type: registry-image
  187. source: { repository: bitnami/git, tag: "2-debian-9" }
  188. inputs:
  189. - name: git-master
  190. outputs:
  191. - name: version
  192. run:
  193. path: /bin/sh
  194. args:
  195. - -c
  196. - |
  197. cd git-master
  198. chmod +x ././scripts/get_*.sh
  199. echo $(./scripts/get_build.sh) > ../version/build.info
  200. echo $(./scripts/get_version.sh) > ../version/version.info
  201. echo $(./scripts/get_tag.sh) > ../version/tag.info
  202. cp ../version/tag.info ../version/tag
  203. echo "Build Information: $(cat ../version/build.info)"
  204. echo "Version Information: $(cat ../version/version.info)"
  205. echo "Tag Information: $(cat ../version/tag.info)"
  206. echo "Docker Image Tag: $(cat ../version/tag)"
  207. - task: package
  208. config:
  209. platform: linux
  210. image_resource:
  211. type: registry-image
  212. source: { repository: debian, tag: "stretch-slim" }
  213. inputs:
  214. - name: git-master
  215. - name: version
  216. outputs:
  217. - name: package
  218. run:
  219. path: /bin/sh
  220. args:
  221. - -c
  222. - |
  223. cd package
  224. cp ../version/* .
  225. cp ../git-master/package*.json .
  226. cp ../git-master/index.js .
  227. cp -r ../git-master/assets .
  228. cp -r ../git-master/bot .
  229. cp -r ../git-master/data .
  230. cp ../git-master/entrypoint.sh .
  231. cp ../git-master/Dockerfile .
  232. cp ../git-master/README.md .
  233. cp ../git-master/LICENSE.md .
  234. ls -al .
  235. - put: docker-image
  236. params:
  237. build: package
  238. tag_file: package/tag
  239. tag_as_latest: true