fix jenkinsfile

This commit is contained in:
reqwizz 2024-11-04 19:06:24 +03:00
parent aa6fa836ae
commit a2811c81ad

6
ansible/Jenkinsfile vendored
View File

@ -51,11 +51,11 @@ pipeline {
def sanitized_content = params.ADDITIONAL_CONTENT.replaceAll("'", "\\'").replaceAll('"', '\\"') def sanitized_content = params.ADDITIONAL_CONTENT.replaceAll("'", "\\'").replaceAll('"', '\\"')
if (params.SITE_OPTION == 'SiteA') { if (params.SITE_OPTION == 'SiteA') {
sh "export PATH=/usr/local/bin:\$PATH && ansible-playbook /ansible/playbook.yml -i ${env.HOSTS_FILE} -l SiteA -e \"additional_content='${sanitized_content}'\"" sh "export PATH=/usr/local/bin:\$PATH && ansible-playbook ansible/playbook.yml -i ${env.HOSTS_FILE} -l SiteA -e \"additional_content='${sanitized_content}'\""
} else if (params.SITE_OPTION == 'SiteB') { } else if (params.SITE_OPTION == 'SiteB') {
sh "export PATH=/usr/local/bin:\$PATH && ansible-playbook /ansible/playbook.yml -i ${env.HOSTS_FILE} -l SiteB -e \"additional_content='${sanitized_content}'\"" sh "export PATH=/usr/local/bin:\$PATH && ansible-playbook ansible/playbook.yml -i ${env.HOSTS_FILE} -l SiteB -e \"additional_content='${sanitized_content}'\""
} else if (params.SITE_OPTION == 'SiteA&B') { } else if (params.SITE_OPTION == 'SiteA&B') {
sh "export PATH=/usr/local/bin:\$PATH && ansible-playbook /ansible/playbook.yml -i ${env.HOSTS_FILE} -l SiteA,SiteB,proxy -e \"additional_content='${sanitized_content}'\"" sh "export PATH=/usr/local/bin:\$PATH && ansible-playbook ansible/playbook.yml -i ${env.HOSTS_FILE} -l SiteA,SiteB,proxy -e \"additional_content='${sanitized_content}'\""
} }
} }
} }