Add deployment implementation.
This commit is contained in:
1 parent
dfd5336a3a
commit
b7cd1ce78e
5 files changed
+179
-3
No files matched your search
Vendored
+47
@@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user