From 08594bd66dd2086284d64db7e5e207a433f96f19 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Tue, 5 May 2020 16:44:19 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=BD=20Use=20Jenkins=20pipeline=20for?= =?UTF-8?q?=20better=20flow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By using a small Jenkins pipeline in the repository, we can define almost all of our testing parameters in the repo itself and not inside Jenkins. This also allows us to use the GitHub Branch Source plugin and auto-discover new repositories without `ok to test` bombs in pull requests. Signed-off-by: Major Hayden --- jenkins/Jenkinsfile | 84 ++++++++++++++++++++++++++++++++++++++++++++ jenkins/run_tests.sh | 4 +++ 2 files changed, 88 insertions(+) create mode 100644 jenkins/Jenkinsfile mode change 100644 => 100755 jenkins/run_tests.sh diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile new file mode 100644 index 000000000..59a055be8 --- /dev/null +++ b/jenkins/Jenkinsfile @@ -0,0 +1,84 @@ +pipeline { + agent none + + options { + timestamps() + ansiColor('xterm') + } + + stages { + stage("Functional Testing") { + parallel { + stage('Fedora 31 base') { + agent { + label "fedora31" + } + environment { + TEST_TYPE = "base" + } + steps { + sh "jenkins/run_tests.sh" + } + } + stage('Fedora 31 image') { + agent { + label "fedora31" + } + environment { + TEST_TYPE = "image" + } + steps { + sh "jenkins/run_tests.sh" + } + } + stage('Fedora 32 base') { + agent { + label "fedora32" + } + environment { + TEST_TYPE = "base" + } + steps { + sh "jenkins/run_tests.sh" + } + } + stage('Fedora 32 image') { + agent { + label "fedora32" + } + environment { + TEST_TYPE = "image" + } + steps { + sh "jenkins/run_tests.sh" + } + } + stage('RHEL 8.2 base') { + agent { + label "rhel82" + } + environment { + TEST_TYPE = "base" + } + steps { + sh "jenkins/run_tests.sh" + } + } + // Disable RHEL 8.3 image testing for now until we work out the + // QEMU issues there. + // + // stage('RHEL 8.2 image') { + // agent { + // label "rhel82" + // } + // environment { + // TEST_TYPE = "image" + // } + // steps { + // sh "jenkins/run_tests.sh" + // } + // } + } + } + } +} diff --git a/jenkins/run_tests.sh b/jenkins/run_tests.sh old mode 100644 new mode 100755 index bfbaf3950..730710208 --- a/jenkins/run_tests.sh +++ b/jenkins/run_tests.sh @@ -1,6 +1,10 @@ #!/bin/bash set -euxo pipefail +# Create temporary directories for Ansible. +sudo mkdir -vp /opt/ansible_{local,remote} +sudo chmod -R 777 /opt/ansible_{local,remote} + # Restart systemd to work around some Fedora issues in cloud images. sudo systemctl restart systemd-journald