diff --git a/ScriptedJenkinsfile b/ScriptedJenkinsfile new file mode 100644 index 0000000..1819bf1 --- /dev/null +++ b/ScriptedJenkinsfile @@ -0,0 +1,17 @@ +node("linux"){ + parameters { + booleanParam(name: "prod_run") + } + stage("Clone repo"){ + url: 'https://github.com/aragastmatb/example-playbook.git' + } + stage("Run playbook"){ + if (params.prod_run){ + sh 'ansible-playbook site.yml -i inventory/prod.yml' + } + else{ + sh 'ansible-playbook site.yml -i inventory/prod.yml --check --diff' + } + + } +}