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.

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