Add deployment implementation.

This commit is contained in:
jimmy committed 2022-08-09 21:56:28 -04:00
1 parent dfd5336a3a
commit b7cd1ce78e
5 files changed
+179 -3

No files matched your search

Vendored
+47
View File
@@ -0,0 +1,47 @@
pipeline {
agent any
options
{
skipDefaultCheckout(true)
}
stages
{
stage('Checkout')
{
steps
{
cleanWs()
checkout scm
}
}
stage('Run')
{
steps
{
sh 'ansible-playbook -vvvv --skip-tags cleanup,deploy -i ./playbooks/inventory.yaml ./playbooks/build.yaml'
}
}
stage('Deploy')
{
when
{
expression
{
currentBuild.result == null || currentBuild.result == 'SUCCESS'
}
}
steps
{
sh 'ansible-playbook --tags deploy -i ./playbooks/inventory.yaml ./playbooks/build.yaml'
}
}
}
post
{
always
{
sh 'ansible-playbook --tags cleanup -i ./playbooks/inventory.yaml ./playbooks/build.yaml'
}
}
}