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.

243 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. - 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. - key: persistence.storageClass
  154. value: microk8s-hostpath
  155. recreate_pods: true
  156. # Release Pipeline
  157. - name: test-release
  158. plan:
  159. - get: git-master
  160. trigger: true
  161. - task: run-tests
  162. config:
  163. platform: linux
  164. image_resource:
  165. type: registry-image
  166. source: { repository: node, tag: "12.14-stretch" }
  167. inputs:
  168. - name: git-master
  169. run:
  170. path: /bin/sh
  171. args:
  172. - -c
  173. - |
  174. echo "Node Version: $(node --version)"
  175. echo "NPM Version: $(npm --version)"
  176. cd git-master
  177. npm install
  178. npm test
  179. - name: deploy-release-image
  180. plan:
  181. - get: git-master
  182. passed: [test-release]
  183. trigger: true
  184. - task: capture-version
  185. config:
  186. platform: linux
  187. image_resource:
  188. type: registry-image
  189. source: { repository: bitnami/git, tag: "2-debian-9" }
  190. inputs:
  191. - name: git-master
  192. outputs:
  193. - name: version
  194. run:
  195. path: /bin/sh
  196. args:
  197. - -c
  198. - |
  199. cd git-master
  200. chmod +x ././scripts/get_*.sh
  201. echo $(./scripts/get_build.sh) > ../version/build.info
  202. echo $(./scripts/get_version.sh) > ../version/version.info
  203. echo $(./scripts/get_tag.sh) > ../version/tag.info
  204. cp ../version/tag.info ../version/tag
  205. echo "Build Information: $(cat ../version/build.info)"
  206. echo "Version Information: $(cat ../version/version.info)"
  207. echo "Tag Information: $(cat ../version/tag.info)"
  208. echo "Docker Image Tag: $(cat ../version/tag)"
  209. - task: package
  210. config:
  211. platform: linux
  212. image_resource:
  213. type: registry-image
  214. source: { repository: debian, tag: "stretch-slim" }
  215. inputs:
  216. - name: git-master
  217. - name: version
  218. outputs:
  219. - name: package
  220. run:
  221. path: /bin/sh
  222. args:
  223. - -c
  224. - |
  225. cd package
  226. cp ../version/* .
  227. cp ../git-master/package*.json .
  228. cp ../git-master/index.js .
  229. cp -r ../git-master/assets .
  230. cp -r ../git-master/bot .
  231. cp -r ../git-master/data .
  232. cp ../git-master/entrypoint.sh .
  233. cp ../git-master/Dockerfile .
  234. cp ../git-master/README.md .
  235. cp ../git-master/LICENSE.md .
  236. ls -al .
  237. - put: docker-image
  238. params:
  239. build: package
  240. tag_file: package/tag
  241. tag_as_latest: true