@ -1,28 +1,27 @@
---
resources:
- name : baphomet-js-git
- name : baphomet-js-git-develop
type : git
icon : git
source:
uri : ssh://git@git.nulloctet.com:8437/warricksothr/baphomet-js.git
private_key : |
((pull_key))
branch : master
branch : develop
ignore_paths:
- pipeline.yml
- scripts/upload_pipeline.sh
- README.md
- CONTRIBUTING.md
- LICENSE.md
- name : baphomet-js-git-develop
- name : baphomet-js-git
type : git
icon : git
source:
uri : ssh://git@git.nulloctet.com:8437/warricksothr/baphomet-js.git
private_key : |
((pull_key))
branch : develop
branch : master
ignore_paths:
- pipeline.yml
- scripts/upload_pipeline.sh
@ -31,9 +30,10 @@ resources:
- LICENSE.md
jobs:
- name : test
# Development Pipeline
- name : test-develop
plan:
- get : baphomet-js-git
- get : baphomet-js-git-develop
trigger : true
- task : run-tests
config:
@ -42,7 +42,7 @@ jobs:
type : registry-image
source : { repository: node, tag : "12.14-stretch" }
inputs:
- name : baphomet-js-git
- name : baphomet-js-git-develop
run:
path : /bin/sh
args:
@ -50,12 +50,39 @@ jobs:
- |
echo "Node Version: $(node --version)"
echo "NPM Version: $(npm --version)"
cd baphomet-js-git
cd baphomet-js-git-develop
npm install
npm test
- name : test -develop
- name : deploy -develop
plan:
- get : baphomet-js-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 : baphomet-js-git-develop
outputs:
- name : version
run:
path : /bin/sh
args:
- -c
- |
cd baphomet-js-git
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
cat ../version/build.info
# Release Pipeline
- name : test-release
plan:
- get : baphomet-js-git
trigger : true
- task : run-tests
config:
@ -64,7 +91,7 @@ jobs:
type : registry-image
source : { repository: node, tag : "12.14-stretch" }
inputs:
- name : baphomet-js-git-develop
- name : baphomet-js-git
run:
path : /bin/sh
args:
@ -72,13 +99,13 @@ jobs:
- |
echo "Node Version: $(node --version)"
echo "NPM Version: $(npm --version)"
cd baphomet-js-git-develop
cd baphomet-js-git
npm install
npm test
- name : package
- name : package-release
plan:
- get : baphomet-js-git
passed : [ test]
passed : [ test-release ]
trigger : true
- task : capture-version
config:
@ -99,6 +126,7 @@ jobs:
chmod +x ././scripts/get_*.sh
echo $(./scripts/get_build.sh) > ../baphomet-js-version/build.info
echo $(./scripts/get_version.sh) > ../baphomet-js-version/version.info
echo $(./scripts/get_tag.sh) > ../baphomet-js-version/tag.info
cat ../baphomet-js-version/build.info
- task : package
config:
@ -118,13 +146,16 @@ jobs:
- |
mkdir tmp
cd tmp
cp ../baphomet-js-version/version.info .
cp ../baphomet-js-version/build.info .
cp ../baphomet-js-version/version.info .
cp ../baphomet-js-version/tag.info .
cp ../baphomet-js-git/package*.json .
cp ../baphomet-js-git/index.js .
cp -r ../baphomet-js-git/assets .
cp -r ../baphomet-js-git/bot .
cp -r ../baphomet-js-git/data .
cp ../baphomet-js-git/entrypoint.js .
cp ../baphomet-js-git/Dockerfile .
cp ../baphomet-js-git/README.md .
cp ../baphomet-js-git/LICENSE.md .
tar -zcvf ../package/baphomet-js-$(cat version .info).tgz ./*
tar -zcvf ../package/baphomet-js-$(cat tag .info).tgz ./*