fix jenkinsfile&proxyconf

This commit is contained in:
reqwizz 2024-11-13 00:10:18 +03:00
parent 5c2eb4a087
commit 4110aa63c1
2 changed files with 7 additions and 24 deletions

29
ansible/Jenkinsfile vendored
View File

@ -7,10 +7,10 @@ pipeline {
} }
parameters { parameters {
string(name: 'ADDITIONAL_CONTENT_SITEA_H2', defaultValue: 'Новое сообщение для SiteA', description: 'Дополнительный <h2> контент для SiteA') string(name: 'ADDITIONAL_CONTENT_SITEA_H2', defaultValue: 'Новое сообщение для SiteA', description: 'Additional <h2> content for SiteA')
string(name: 'ADDITIONAL_CONTENT_SITEA_P', defaultValue: 'Дополнительный параграф для SiteA', description: 'Дополнительный <p> контент для SiteA') string(name: 'ADDITIONAL_CONTENT_SITEA_P', defaultValue: 'Дополнительный параграф для SiteA', description: 'Additional <p> content for SiteA')
string(name: 'ADDITIONAL_CONTENT_SITEB_H2', defaultValue: 'Новое сообщение для SiteB', description: 'Дополнительный <h2> контент для SiteB') string(name: 'ADDITIONAL_CONTENT_SITEB_H2', defaultValue: 'Новое сообщение для SiteB', description: 'Additional <h2> content for SiteB')
string(name: 'ADDITIONAL_CONTENT_SITEB_P', defaultValue: 'Дополнительный параграф для SiteB', description: 'Дополнительный <p> контент для SiteB') string(name: 'ADDITIONAL_CONTENT_SITEB_P', defaultValue: 'Дополнительный параграф для SiteB', description: 'Additional <p> content for SiteB')
} }
stages { stages {
@ -35,29 +35,12 @@ pipeline {
} }
} }
stage('Deploy SiteA') { stage('Deploy Site') {
steps { steps {
script { script {
def extraVars = [ def extraVars = [
siteA_h2: params.ADDITIONAL_CONTENT_SITEA_H2, siteA_h2: params.ADDITIONAL_CONTENT_SITEA_H2,
siteA_p: params.ADDITIONAL_CONTENT_SITEA_P, 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_h2: params.ADDITIONAL_CONTENT_SITEB_H2,
siteB_p: params.ADDITIONAL_CONTENT_SITEB_P, siteB_p: params.ADDITIONAL_CONTENT_SITEB_P,
ansible_ssh_private_key_file: env.DECYPTED_KEY_FILE ansible_ssh_private_key_file: env.DECYPTED_KEY_FILE
@ -67,7 +50,7 @@ pipeline {
playbook: 'ansible/playbook.yml', playbook: 'ansible/playbook.yml',
inventory: "ansible/inventory.yml", inventory: "ansible/inventory.yml",
extraVars: extraVars, extraVars: extraVars,
limit: 'SiteB,proxy' limit: 'SiteA,SiteB,proxy'
) )
} }
} }

View File

@ -1,6 +1,6 @@
upstream backend { upstream backend {
{% for server in upstream_servers %} {% for server in upstream_servers %}
server {{ server }} max_fails=1 fail_timeout=5s; server {{ server }} max_fails=1 fail_timeout=1s;
{% endfor %} {% endfor %}
} }