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.
 
 
 
 
 

282 lines
8.7 KiB

---
resource_types:
- name: helm
type: docker-image
source:
repository: linkyard/concourse-helm-resource
- name: matrix-notification-resource
type: docker-image
source:
repository: ((nexus_docker_read.host))/sothr/matrix-notification-resource
username: ((nexus_docker_read.username))
password: ((nexus_docker_read.password))
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:
- 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:
- 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))
- name: helm
type: helm
source:
cluster_url: ((helm.cluster_url))
cluster_ca: ((helm.cluster_ca))
token: ((helm.token))
- name: matrix-notification
type: matrix-notification-resource
source:
matrix_server_url: ((matrix.url))
token: ((matrix.token))
room_id: ((matrix.room_id))
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
on_failure:
do:
- put: matrix-notification
params:
msgtype: m.notice
text: |
A test of baphomet-js-dev has failed. Check it out at:
https://concourse.nulloctet.com/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
or at:
https://concourse.nulloctet.com/builds/$BUILD_ID
- 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/tsconfig.json .
cp ../git-develop/index.js .
cp -r ../git-develop/assets .
cp -r ../git-develop/src .
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
get_params: {skip_download: true}
- put: matrix-notification
params:
msgtype: m.notice
text: |
Successfully deployed baphomet-js-dev image to repository
- name: deploy-develop-helm
plan:
- get: git-develop
passed: [deploy-develop-image]
trigger: true
- put: helm
params:
chart: git-develop/.helm
values: git-develop/.helm/values.yaml
release: baphomet-js-dev
override_values:
- key: image.tag
value: dev
- key: image.pullPolicy
value: Always
- key: app.env.node_env
value: development
- key: persistence.storageClass
value: microk8s-hostpath
recreate_pods: true
# 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
on_failure:
do:
- put: matrix-notification
params:
msgtype: m.notice
text: |
A test of baphomet-js has failed. Check it out at:
https://concourse.nulloctet.com/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
or at:
https://concourse.nulloctet.com/builds/$BUILD_ID
- 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/tsconfig.json .
cp ../git-master/index.js .
cp -r ../git-master/assets .
cp -r ../git-master/src .
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
get_params: {skip_download: true}