fix docker&jenkinsfile+legacyjen
This commit is contained in:
parent
589b269ae3
commit
f32cc1b6a0
8
ansible/Jenkinsfile
vendored
8
ansible/Jenkinsfile
vendored
@ -14,7 +14,7 @@ pipeline {
|
|||||||
stage('Decrypt SSH Key') {
|
stage('Decrypt SSH Key') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def tempDir = '/var/jenkins_home/workspace/Sites' + UUID.randomUUID().toString()
|
def tempDir = '/tmp/' + UUID.randomUUID().toString()
|
||||||
env.TEMP_DIR = tempDir
|
env.TEMP_DIR = tempDir
|
||||||
sh "mkdir -p ${tempDir}"
|
sh "mkdir -p ${tempDir}"
|
||||||
|
|
||||||
@ -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 /coursework/ansible/playbook.ymlansible/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 /coursework/ansible/playbook.ymlansible/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 /coursework/ansible/playbook.yml -i ${env.HOSTS_FILE} -l SiteA,SiteB,proxy -e \"additional_content='${sanitized_content}'\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,4 @@
|
|||||||
services:
|
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:
|
gitea:
|
||||||
image: gitea/gitea:latest
|
image: gitea/gitea:latest
|
||||||
container_name: gitea
|
container_name: gitea
|
||||||
@ -26,5 +13,4 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
jenkins-data:
|
|
||||||
gitea-data:
|
gitea-data:
|
Loading…
Reference in New Issue
Block a user