From 764f1b5792de9fca09bba9ce6573b9f3e90ad340 Mon Sep 17 00:00:00 2001 From: reqwizz Date: Wed, 13 Nov 2024 00:01:20 +0300 Subject: [PATCH] fix jenkinsfile --- ansible/Jenkinsfile | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/ansible/Jenkinsfile b/ansible/Jenkinsfile index 7b33426..4f54b12 100644 --- a/ansible/Jenkinsfile +++ b/ansible/Jenkinsfile @@ -7,10 +7,10 @@ pipeline { } parameters { - string(name: 'ADDITIONAL_CONTENT_SITEA_H2', defaultValue: 'Новое сообщение для SiteA', description: 'Additional

content for SiteA') - string(name: 'ADDITIONAL_CONTENT_SITEA_P', defaultValue: 'Дополнительный параграф для SiteA', description: 'Additional

content for SiteA') - string(name: 'ADDITIONAL_CONTENT_SITEB_H2', defaultValue: 'Новое сообщение для SiteB', description: 'Additional

content for SiteB') - string(name: 'ADDITIONAL_CONTENT_SITEB_P', defaultValue: 'Дополнительный параграф для SiteB', description: 'Additional

content for SiteB') + string(name: 'ADDITIONAL_CONTENT_SITEA_H2', defaultValue: 'Новое сообщение для SiteA', description: 'Дополнительный

контент для SiteA') + string(name: 'ADDITIONAL_CONTENT_SITEA_P', defaultValue: 'Дополнительный параграф для SiteA', description: 'Дополнительный

контент для SiteA') + string(name: 'ADDITIONAL_CONTENT_SITEB_H2', defaultValue: 'Новое сообщение для SiteB', description: 'Дополнительный

контент для SiteB') + string(name: 'ADDITIONAL_CONTENT_SITEB_P', defaultValue: 'Дополнительный параграф для SiteB', description: 'Дополнительный

контент для SiteB') } stages { @@ -35,12 +35,29 @@ pipeline { } } - stage('Deploy Site') { + stage('Deploy SiteA') { steps { script { def extraVars = [ siteA_h2: params.ADDITIONAL_CONTENT_SITEA_H2, siteA_p: params.ADDITIONAL_CONTENT_SITEA_P, + ansible_ssh_private_key_file: env.DECYPTED_KEY_FILE + ] + + ansiblePlaybook( + playbook: 'ansible/playbook.yml', + inventory: "ansible/inventory.yml", + extraVars: extraVars, + limit: 'SiteA,proxy' + ) + } + } + } + + stage('Deploy SiteB') { + steps { + script { + def extraVars = [ siteB_h2: params.ADDITIONAL_CONTENT_SITEB_H2, siteB_p: params.ADDITIONAL_CONTENT_SITEB_P, ansible_ssh_private_key_file: env.DECYPTED_KEY_FILE @@ -50,7 +67,7 @@ pipeline { playbook: 'ansible/playbook.yml', inventory: "ansible/inventory.yml", extraVars: extraVars, - limit: 'SiteA,SiteB,proxy' + limit: 'SiteB,proxy' ) } }