--- resources: - name: git-develop type: git icon: git source: uri: ssh://git@git.nulloctet.com:8437/warricksothr/baphomet-js.git private_key: | ((pull_key)) branch: develop ignore_paths: - pipeline.yml - scripts/upload_pipeline.sh - README.md - CONTRIBUTING.md - LICENSE.md - name: git-master type: git icon: git source: uri: ssh://git@git.nulloctet.com:8437/warricksothr/baphomet-js.git private_key: | ((pull_key)) branch: master ignore_paths: - pipeline.yml - scripts/upload_pipeline.sh - README.md - CONTRIBUTING.md - LICENSE.md - name: docker-image type: docker-image icon: docker source: repository: ((nexus_docker_write.host))/nulloctet/baphomet-js username: ((nexus_docker_write.username)) password: ((nexus_docker_write.password)) jobs: # Development Pipeline - name: test-develop plan: - get: git-develop trigger: true - task: run-tests config: platform: linux image_resource: type: registry-image source: { repository: node, tag: "12.14-stretch" } inputs: - name: git-develop run: path: /bin/sh args: - -c - | echo "Node Version: $(node --version)" echo "NPM Version: $(npm --version)" cd git-develop npm install npm test - name: deploy-develop-image plan: - get: git-develop passed: [test-develop] trigger: true - task: capture-version config: platform: linux image_resource: type: registry-image source: { repository: bitnami/git, tag: "2-debian-9" } inputs: - name: git-develop outputs: - name: version run: path: /bin/sh args: - -c - | cd git-develop chmod +x ././scripts/get_*.sh echo $(./scripts/get_build.sh) > ../version/build.info echo $(./scripts/get_version.sh) > ../version/version.info echo $(./scripts/get_tag.sh) > ../version/tag.info echo "dev" > ../version/tag echo "Build Information: $(cat ../version/build.info)" echo "Version Information: $(cat ../version/version.info)" echo "Tag Information: $(cat ../version/tag.info)" echo "Docker Image Tag: $(cat ../version/tag)" - task: package config: platform: linux image_resource: type: registry-image source: { repository: debian, tag: "stretch-slim" } inputs: - name: git-develop - name: version outputs: - name: package run: path: /bin/sh args: - -c - | cd package cp ../version/* . cp ../git-develop/package*.json . cp ../git-develop/index.js . cp -r ../git-develop/assets . cp -r ../git-develop/bot . cp -r ../git-develop/data . cp ../git-develop/entrypoint.sh . cp ../git-develop/Dockerfile . cp ../git-develop/README.md . cp ../git-develop/LICENSE.md . ls -al . - put: docker-image params: build: package tag_file: package/tag tag_as_latest: false # Release Pipeline - name: test-release plan: - get: git-master trigger: true - task: run-tests config: platform: linux image_resource: type: registry-image source: { repository: node, tag: "12.14-stretch" } inputs: - name: git-master run: path: /bin/sh args: - -c - | echo "Node Version: $(node --version)" echo "NPM Version: $(npm --version)" cd git-master npm install npm test - name: deploy-release-image plan: - get: git-master passed: [test-release] trigger: true - task: capture-version config: platform: linux image_resource: type: registry-image source: { repository: bitnami/git, tag: "2-debian-9" } inputs: - name: git-master outputs: - name: version run: path: /bin/sh args: - -c - | cd git-master chmod +x ././scripts/get_*.sh echo $(./scripts/get_build.sh) > ../version/build.info echo $(./scripts/get_version.sh) > ../version/version.info echo $(./scripts/get_tag.sh) > ../version/tag.info cp ../version/tag.info ../version/tag echo "Build Information: $(cat ../version/build.info)" echo "Version Information: $(cat ../version/version.info)" echo "Tag Information: $(cat ../version/tag.info)" echo "Docker Image Tag: $(cat ../version/tag)" - task: package config: platform: linux image_resource: type: registry-image source: { repository: debian, tag: "stretch-slim" } inputs: - name: git-master - name: version outputs: - name: package run: path: /bin/sh args: - -c - | cd package cp ../version/* . cp ../git-master/package*.json . cp ../git-master/index.js . cp -r ../git-master/assets . cp -r ../git-master/bot . cp -r ../git-master/data . cp ../git-master/entrypoint.sh . cp ../git-master/Dockerfile . cp ../git-master/README.md . cp ../git-master/LICENSE.md . ls -al . - put: docker-image params: build: package tag_file: package/tag tag_as_latest: true