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.

211 lines
6.3 KiB

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