From f32cc1b6a0892c99a7964f1825a5bc0c3ef5fca9 Mon Sep 17 00:00:00 2001 From: reqwizz Date: Mon, 4 Nov 2024 19:49:57 +0300 Subject: [PATCH] fix docker&jenkinsfile+legacyjen --- ansible/Jenkinsfile | 8 ++++---- docker-compose.yml | 14 -------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/ansible/Jenkinsfile b/ansible/Jenkinsfile index 80d01ab..a331dd1 100644 --- a/ansible/Jenkinsfile +++ b/ansible/Jenkinsfile @@ -14,7 +14,7 @@ pipeline { stage('Decrypt SSH Key') { steps { script { - def tempDir = '/var/jenkins_home/workspace/Sites' + UUID.randomUUID().toString() + def tempDir = '/tmp/' + UUID.randomUUID().toString() env.TEMP_DIR = tempDir sh "mkdir -p ${tempDir}" @@ -51,11 +51,11 @@ pipeline { def sanitized_content = params.ADDITIONAL_CONTENT.replaceAll("'", "\\'").replaceAll('"', '\\"') 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 /coursework/ansible/playbook.ymlansible/playbook.yml -i ${env.HOSTS_FILE} -l SiteA -e \"additional_content='${sanitized_content}'\"" } 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 /coursework/ansible/playbook.ymlansible/playbook.yml -i ${env.HOSTS_FILE} -l SiteB -e \"additional_content='${sanitized_content}'\"" } 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 /coursework/ansible/playbook.yml -i ${env.HOSTS_FILE} -l SiteA,SiteB,proxy -e \"additional_content='${sanitized_content}'\"" } } } diff --git a/docker-compose.yml b/docker-compose.yml index ca3f4ce..6b83944 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,17 +1,4 @@ services: - jenkins: - image: jenkins/jenkins:latest - container_name: jenkins - privileged: true - user: root - volumes: - - ./jenkins-data:/var/jenkins_home - - ./ansible:/ansible - ports: - - "8080:8080" - - "50000:50000" - restart: always - gitea: image: gitea/gitea:latest container_name: gitea @@ -26,5 +13,4 @@ services: restart: always volumes: - jenkins-data: gitea-data: \ No newline at end of file