Skip to content

Commit

Permalink
pipeline.groovy: Ensure uniqueness of ec2_name_prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Spredzy committed Sep 9, 2019
1 parent cf0ad81 commit 8a09a88
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions provisioner/tests/pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ${AWX_NIGHTLY_REPO_URL}"""
"AWS_ACCESS_KEY=${AWS_ACCESS_KEY}",
"ANSIBLE_CONFIG=provisioner/ansible.cfg",
"ANSIBLE_FORCE_COLOR=true"]) {
sh "ansible-playbook provisioner/provision_lab.yml -e @provisioner/tests/vars.yml -e workshop_type=rhel -e ec2_name_prefix=tower-qe-rhel-tower-${params.TOWER_VERSION}-${env.BRANCH_NAME}-${env.BUILD_ID} -e tower_installer_url=${tower_installer_url} -e gpgcheck=${gpgcheck} -e aw_repo_url=${aw_repo_url} -e ansible_workshops_url=${ANSIBLE_WORKSHOPS_URL} -e ansible_workshops_version=${params.WORKSHOP_BRANCH} 2>&1 | tee rhel.log"
sh "ansible-playbook provisioner/provision_lab.yml -e @provisioner/tests/vars.yml -e workshop_type=rhel -e ec2_name_prefix=tower-qe-rhel-tower-${params.TOWER_VERSION}-${env.BRANCH_NAME}-${env.BUILD_ID}-${params.ANSIBLE_VERSION} -e tower_installer_url=${tower_installer_url} -e gpgcheck=${gpgcheck} -e aw_repo_url=${aw_repo_url} -e ansible_workshops_url=${ANSIBLE_WORKSHOPS_URL} -e ansible_workshops_version=${params.WORKSHOP_BRANCH} 2>&1 | tee rhel.log"
}
}
}
Expand All @@ -102,7 +102,7 @@ ${AWX_NIGHTLY_REPO_URL}"""
"AWS_ACCESS_KEY=${AWS_ACCESS_KEY}",
"ANSIBLE_CONFIG=provisioner/ansible.cfg",
"ANSIBLE_FORCE_COLOR=true"]) {
sh "ansible-playbook provisioner/teardown_lab.yml -e @provisioner/tests/vars.yml -e workshop_type=rhel -e ec2_name_prefix=tower-qe-rhel-tower-${params.TOWER_VERSION}-${env.BRANCH_NAME}-${env.BUILD_ID} 2>&1 | tee -a rhel.log"
sh "ansible-playbook provisioner/teardown_lab.yml -e @provisioner/tests/vars.yml -e workshop_type=rhel -e ec2_name_prefix=tower-qe-rhel-tower-${params.TOWER_VERSION}-${env.BRANCH_NAME}-${env.BUILD_ID}-${params.ANSIBLE_VERSION} 2>&1 | tee -a rhel.log"
}
}
archiveArtifacts artifacts: 'rhel.log'
Expand All @@ -125,7 +125,7 @@ ${AWX_NIGHTLY_REPO_URL}"""
"AWS_ACCESS_KEY=${AWS_ACCESS_KEY}",
"ANSIBLE_CONFIG=provisioner/ansible.cfg",
"ANSIBLE_FORCE_COLOR=true"]) {
sh "ansible-playbook provisioner/provision_lab.yml -e @provisioner/tests/vars.yml -e workshop_type=networking -e ec2_name_prefix=tower-qe-networking-tower-${params.TOWER_VERSION}-${env.BRANCH_NAME}-${env.BUILD_ID} -e tower_installer_url=${tower_installer_url} -e gpgcheck=${gpgcheck} -e aw_repo_url=${aw_repo_url} -e ansible_workshops_url=${ANSIBLE_WORKSHOPS_URL} -e ansible_workshops_version=${params.WORKSHOP_BRANCH} 2>&1 | tee networking.log"
sh "ansible-playbook provisioner/provision_lab.yml -e @provisioner/tests/vars.yml -e workshop_type=networking -e ec2_name_prefix=tower-qe-networking-tower-${params.TOWER_VERSION}-${env.BRANCH_NAME}-${env.BUILD_ID}-${params.ANSIBLE_VERSION} -e tower_installer_url=${tower_installer_url} -e gpgcheck=${gpgcheck} -e aw_repo_url=${aw_repo_url} -e ansible_workshops_url=${ANSIBLE_WORKSHOPS_URL} -e ansible_workshops_version=${params.WORKSHOP_BRANCH} 2>&1 | tee networking.log"
}
}
}
Expand All @@ -138,7 +138,7 @@ ${AWX_NIGHTLY_REPO_URL}"""
"AWS_ACCESS_KEY=${AWS_ACCESS_KEY}",
"ANSIBLE_CONFIG=provisioner/ansible.cfg",
"ANSIBLE_FORCE_COLOR=true"]) {
sh "ansible-playbook provisioner/teardown_lab.yml -e @provisioner/tests/vars.yml -e workshop_type=networking -e ec2_name_prefix=tower-qe-networking-tower-${params.TOWER_VERSION}-${env.BRANCH_NAME}-${env.BUILD_ID} 2>&1 | tee -a networking.log"
sh "ansible-playbook provisioner/teardown_lab.yml -e @provisioner/tests/vars.yml -e workshop_type=networking -e ec2_name_prefix=tower-qe-networking-tower-${params.TOWER_VERSION}-${env.BRANCH_NAME}-${env.BUILD_ID}-${params.ANSIBLE_VERSION} 2>&1 | tee -a networking.log"
}
}
archiveArtifacts artifacts: 'networking.log'
Expand All @@ -161,14 +161,14 @@ ${AWX_NIGHTLY_REPO_URL}"""
"AWS_ACCESS_KEY=${AWS_ACCESS_KEY}",
"ANSIBLE_CONFIG=provisioner/ansible.cfg",
"ANSIBLE_FORCE_COLOR=true"]) {
sh "ansible-playbook provisioner/provision_lab.yml -e @provisioner/tests/vars.yml -e workshop_type=f5 -e ec2_name_prefix=tower-qe-f5-tower-${params.TOWER_VERSION}-${env.BRANCH_NAME}-${env.BUILD_ID} -e tower_installer_url=${tower_installer_url} -e gpgcheck=${gpgcheck} -e aw_repo_url=${aw_repo_url} -e ansible_workshops_url=${ANSIBLE_WORKSHOPS_URL} -e ansible_workshops_version=${params.WORKSHOP_BRANCH} 2>&1 | tee f5.log"
sh "ansible-playbook provisioner/provision_lab.yml -e @provisioner/tests/vars.yml -e workshop_type=f5 -e ec2_name_prefix=tower-qe-f5-tower-${params.TOWER_VERSION}-${env.BRANCH_NAME}-${env.BUILD_ID}-${params.ANSIBLE_VERSION} -e tower_installer_url=${tower_installer_url} -e gpgcheck=${gpgcheck} -e aw_repo_url=${aw_repo_url} -e ansible_workshops_url=${ANSIBLE_WORKSHOPS_URL} -e ansible_workshops_version=${params.WORKSHOP_BRANCH} 2>&1 | tee f5.log"
}
}
}
}
script {
stage('F5-exercises') {
sh "cat provisioner/tower-qe-f5-tower-${TOWER_VERSION}-${env.BRANCH_NAME}-${env.BUILD_ID}/student1-instances.txt | grep -A 1 control | tail -n 1 | cut -d' ' -f 2 | cut -d'=' -f2 | tee control_host"
sh "cat provisioner/tower-qe-f5-tower-${TOWER_VERSION}-${env.BRANCH_NAME}-${env.BUILD_ID}-${params.ANSIBLE_VERSION}/student1-instances.txt | grep -A 1 control | tail -n 1 | cut -d' ' -f 2 | cut -d'=' -f2 | tee control_host"
CONTROL_NODE_HOST = readFile('control_host').trim()
RUN_ALL_PLAYBOOKS = 'find . -name "*.yml" -o -name "*.yaml" | grep -v "2.0" | sort | xargs -I {} bash -c "echo {} && ANSIBLE_FORCE_COLOR=true ansible-playbook {}"'
sh "sshpass -p 'ansible' ssh -o StrictHostKeyChecking=no student1@${CONTROL_NODE_HOST} 'cd networking-workshop && ${RUN_ALL_PLAYBOOKS}'"
Expand All @@ -182,7 +182,7 @@ ${AWX_NIGHTLY_REPO_URL}"""
"AWS_ACCESS_KEY=${AWS_ACCESS_KEY}",
"ANSIBLE_CONFIG=provisioner/ansible.cfg",
"ANSIBLE_FORCE_COLOR=true"]) {
sh "ansible-playbook provisioner/teardown_lab.yml -e @provisioner/tests/vars.yml -e workshop_type=f5 -e ec2_name_prefix=tower-qe-f5-tower-${params.TOWER_VERSION}-${env.BRANCH_NAME}-${env.BUILD_ID} 2>&1 | tee -a f5.log"
sh "ansible-playbook provisioner/teardown_lab.yml -e @provisioner/tests/vars.yml -e workshop_type=f5 -e ec2_name_prefix=tower-qe-f5-tower-${params.TOWER_VERSION}-${env.BRANCH_NAME}-${env.BUILD_ID}-${params.ANSIBLE_VERSION} 2>&1 | tee -a f5.log"
}
}
archiveArtifacts artifacts: 'f5.log'
Expand Down

0 comments on commit 8a09a88

Please sign in to comment.