add second job for deploying site
This commit is contained in:
parent
48b6369a3a
commit
37c8f1bcfd
1 changed files with 23 additions and 15 deletions
38
pipeline.yml
38
pipeline.yml
|
@ -13,6 +13,20 @@ notify-failed: ¬ify-failed
|
||||||
- -exc
|
- -exc
|
||||||
- |
|
- |
|
||||||
curl -X POST -d '{"body":"Deployment failed!"}' -H "Content-Type: application/json" https://apprise.pim.kunis.nl:444/notify/concourse
|
curl -X POST -d '{"body":"Deployment failed!"}' -H "Content-Type: application/json" https://apprise.pim.kunis.nl:444/notify/concourse
|
||||||
|
notify-success: ¬ify-success
|
||||||
|
task: notify-deployed
|
||||||
|
config:
|
||||||
|
platform: linux
|
||||||
|
image_resource:
|
||||||
|
type: registry-image
|
||||||
|
source:
|
||||||
|
repository: badouralix/curl-jq
|
||||||
|
run:
|
||||||
|
path: sh
|
||||||
|
args:
|
||||||
|
- -exc
|
||||||
|
- |
|
||||||
|
curl -X POST -d '{"body":"Static website deployed!"}' -H "Content-Type: application/json" https://apprise.pim.kunis.nl:444/notify/concourse
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
- name: site-repo
|
- name: site-repo
|
||||||
|
@ -29,7 +43,7 @@ resources:
|
||||||
icon: docker
|
icon: docker
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- name: build-and-deploy-static-website
|
- name: build-static-website
|
||||||
plan:
|
plan:
|
||||||
- get: site-repo
|
- get: site-repo
|
||||||
trigger: true
|
trigger: true
|
||||||
|
@ -128,6 +142,11 @@ jobs:
|
||||||
<< : *notify-failed
|
<< : *notify-failed
|
||||||
- load_var: tag
|
- load_var: tag
|
||||||
file: image/tag
|
file: image/tag
|
||||||
|
- name: deploy-static-website
|
||||||
|
plan:
|
||||||
|
- get: site-registry-image
|
||||||
|
trigger: true
|
||||||
|
- get: site-repo
|
||||||
- task: deploy-site
|
- task: deploy-site
|
||||||
config:
|
config:
|
||||||
platform: linux
|
platform: linux
|
||||||
|
@ -139,6 +158,7 @@ jobs:
|
||||||
DOCKER_HOST: ssh://root@maestro.dmz
|
DOCKER_HOST: ssh://root@maestro.dmz
|
||||||
inputs:
|
inputs:
|
||||||
- name: site-repo
|
- name: site-repo
|
||||||
|
- name: site-registry-image
|
||||||
run:
|
run:
|
||||||
path: sh
|
path: sh
|
||||||
args:
|
args:
|
||||||
|
@ -149,21 +169,9 @@ jobs:
|
||||||
cp site-repo/ssh_config $HOME/.ssh/config
|
cp site-repo/ssh_config $HOME/.ssh/config
|
||||||
echo "((private_key))" > $HOME/.ssh/id_ed25519
|
echo "((private_key))" > $HOME/.ssh/id_ed25519
|
||||||
chmod 600 $HOME/.ssh/id_ed25519
|
chmod 600 $HOME/.ssh/id_ed25519
|
||||||
sed "s/TAG/((.:tag))/g" "site-repo/docker-stack.yml.template" > docker-stack.yml
|
sed "s/TAG/$(cat site-registry-image/tag)/g" "site-repo/docker-stack.yml.template" > docker-stack.yml
|
||||||
docker stack deploy --compose-file docker-stack.yml static
|
docker stack deploy --compose-file docker-stack.yml static
|
||||||
on_success:
|
on_success:
|
||||||
task: notify-deployed
|
<< : *notify-success
|
||||||
config:
|
|
||||||
platform: linux
|
|
||||||
image_resource:
|
|
||||||
type: registry-image
|
|
||||||
source:
|
|
||||||
repository: badouralix/curl-jq
|
|
||||||
run:
|
|
||||||
path: sh
|
|
||||||
args:
|
|
||||||
- -exc
|
|
||||||
- |
|
|
||||||
curl -X POST -d '{"body":"Static website deployed!"}' -H "Content-Type: application/json" https://apprise.pim.kunis.nl:444/notify/concourse
|
|
||||||
on_failure:
|
on_failure:
|
||||||
<< : *notify-failed
|
<< : *notify-failed
|
||||||
|
|
Reference in a new issue