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. - 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. - scripts/upload_pipeline.sh
  31. - README.md
  32. - CONTRIBUTING.md
  33. - LICENSE.md
  34. - name: docker-image
  35. type: docker-image
  36. icon: docker
  37. source:
  38. repository: ((nexus_docker_write.host))/nulloctet/baphomet-js
  39. username: ((nexus_docker_write.username))
  40. password: ((nexus_docker_write.password))
  41. - name: helm
  42. type: helm
  43. source:
  44. cluster_url: ((helm.cluster_url))
  45. cluster_ca: ((helm.cluster_ca))
  46. token: ((helm.token))
  47. jobs:
  48. # Development Pipeline
  49. - name: test-develop
  50. plan:
  51. - get: git-develop
  52. trigger: true
  53. - task: run-tests
  54. config:
  55. platform: linux
  56. image_resource:
  57. type: registry-image
  58. source: { repository: node, tag: "12.14-stretch" }
  59. inputs:
  60. - name: git-develop
  61. run:
  62. path: /bin/sh
  63. args:
  64. - -c
  65. - |
  66. echo "Node Version: $(node --version)"
  67. echo "NPM Version: $(npm --version)"
  68. cd git-develop
  69. npm install
  70. npm test
  71. - name: deploy-develop-image
  72. plan:
  73. - get: git-develop
  74. passed: [test-develop]
  75. trigger: true
  76. - task: capture-version
  77. config:
  78. platform: linux
  79. image_resource:
  80. type: registry-image
  81. source: { repository: bitnami/git, tag: "2-debian-9" }
  82. inputs:
  83. - name: git-develop
  84. outputs:
  85. - name: version
  86. run:
  87. path: /bin/sh
  88. args:
  89. - -c
  90. - |
  91. cd git-develop
  92. chmod +x ././scripts/get_*.sh
  93. echo $(./scripts/get_build.sh) > ../version/build.info
  94. echo $(./scripts/get_version.sh) > ../version/version.info
  95. echo $(./scripts/get_tag.sh) > ../version/tag.info
  96. echo "dev" > ../version/tag
  97. echo "Build Information: $(cat ../version/build.info)"
  98. echo "Version Information: $(cat ../version/version.info)"
  99. echo "Tag Information: $(cat ../version/tag.info)"
  100. echo "Docker Image Tag: $(cat ../version/tag)"
  101. - task: package
  102. config:
  103. platform: linux
  104. image_resource:
  105. type: registry-image
  106. source: { repository: debian, tag: "stretch-slim" }
  107. inputs:
  108. - name: git-develop
  109. - name: version
  110. outputs:
  111. - name: package
  112. run:
  113. path: /bin/sh
  114. args:
  115. - -c
  116. - |
  117. cd package
  118. cp ../version/* .
  119. cp ../git-develop/package*.json .
  120. cp ../git-develop/index.js .
  121. cp -r ../git-develop/assets .
  122. cp -r ../git-develop/bot .
  123. cp -r ../git-develop/data .
  124. cp ../git-develop/entrypoint.sh .
  125. cp ../git-develop/Dockerfile .
  126. cp ../git-develop/README.md .
  127. cp ../git-develop/LICENSE.md .
  128. ls -al .
  129. - put: docker-image
  130. params:
  131. build: package
  132. tag_file: package/tag
  133. tag_as_latest: false
  134. - name: deploy-develop-helm
  135. plan:
  136. - get: git-develop
  137. passed: [deploy-develop-image]
  138. trigger: true
  139. - put: helm
  140. params:
  141. chart: git-develop/.helm
  142. values: git-develop/.helm/values.yaml
  143. release: baphomet-js-dev
  144. override_values:
  145. - key: image.tag
  146. value: dev
  147. - key: image.pullPolicy
  148. value: Always
  149. - key: app.env.node_env
  150. value: development
  151. - key: persistence.storageClass
  152. value: microk8s-hostpath
  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