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. - 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/tsconfig.json .
  121. cp ../git-develop/index.js .
  122. cp -r ../git-develop/assets .
  123. cp -r ../git-develop/src .
  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/tsconfig.json .
  228. cp ../git-master/index.js .
  229. cp -r ../git-master/assets .
  230. cp -r ../git-master/src .
  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