debian-forge-composer/schutzbot/Jenkinsfile
Major Hayden 18fe05f686 CI: Use RHEL 8 CDN subscribed instance
Replace RHEL 8.2 nightly images with a RHEL 8 CDN subscribed instance so
we can test with the exact content a customer would have.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-28 00:22:25 +02:00

186 lines
No EOL
6.2 KiB
Groovy

pipeline {
agent none
environment {
// We upload build RPMs and repository files here.
OPENSHIFT_CONTAINER = "osbuildci-artifacts"
// The files we upload are available under this URL.
// This is auto-generated from OpenStack.
MOCK_REPO_BASE_URL = "https://rhos-d.infra.prod.upshift.rdu2.redhat.com:13808/v1/AUTH_95e858620fb34bcc9162d9f52367a560/osbuildci-artifacts"
}
options {
timestamps()
ansiColor('xterm')
// Cancel the pipeline if it runs for more than three hours.
timeout(
time: 3,
unit: "HOURS"
)
}
stages {
stage("Mock") {
// Halt the entire pipeline if a single RPM build fails. That
// could indicate a code problem that needs to be investigated.
failFast true
parallel {
stage('Fedora 31') {
agent { label "fedora31" }
environment {
OPENSTACK_CREDS = credentials('psi-openstack-clouds-yaml')
}
steps {
sh "schutzbot/mockbuild.sh"
}
}
stage('Fedora 32') {
agent { label "fedora32" }
environment {
OPENSTACK_CREDS = credentials('psi-openstack-clouds-yaml')
}
steps {
sh "schutzbot/mockbuild.sh"
}
}
stage('RHEL 8 CDN') {
agent { label "rhel8" }
environment {
OPENSTACK_CREDS = credentials('psi-openstack-clouds-yaml')
}
steps {
sh "schutzbot/mockbuild.sh"
}
}
// stage('RHEL 8.3 Nightly') {
// agent { label "rhel83" }
// environment {
// OPENSTACK_CREDS = credentials('psi-openstack-clouds-yaml')
// }
// steps {
// sh "schutzbot/mockbuild.sh"
// }
// }
}
}
stage("Functional Testing") {
// Allow the other stages to finish if a single stage fails.
failFast false
parallel {
stage('Fedora 31 base') {
agent { label "fedora31" }
environment { TEST_TYPE = "base" }
steps {
run_tests()
}
post {
always {
preserve_logs('fedora31-base')
}
}
}
stage('Fedora 31 image') {
agent { label "fedora31" }
environment {
TEST_TYPE = "image"
AWS_CREDS = credentials('aws-credentials-osbuildci')
AWS_REGION = "us-east-2"
AWS_BUCKET = "imagebuilder-jenkins-testing-use2"
}
steps {
run_tests()
}
post {
always {
preserve_logs('fedora31-image')
}
}
}
stage('Fedora 32 base') {
agent { label "fedora32" }
environment { TEST_TYPE = "base" }
steps {
run_tests()
}
post {
always {
preserve_logs('fedora32-base')
}
}
}
stage('Fedora 32 image') {
agent { label "fedora32" }
environment {
TEST_TYPE = "image"
AWS_CREDS = credentials('aws-credentials-osbuildci')
AWS_REGION = "us-east-2"
AWS_BUCKET = "imagebuilder-jenkins-testing-use2"
}
steps {
run_tests()
}
post {
always {
preserve_logs('fedora32-image')
}
}
}
stage('RHEL 8 CDN Base') {
agent { label "rhel8" }
environment { TEST_TYPE = "base" }
steps {
run_tests()
}
post {
always {
preserve_logs('rhel8-base')
}
}
}
stage('RHEL 8 CDN Image') {
agent { label "rhel8" }
environment {
TEST_TYPE = "image"
AWS_CREDS = credentials('aws-credentials-osbuildci')
AWS_REGION = "us-east-2"
AWS_BUCKET = "imagebuilder-jenkins-testing-use2"
}
steps {
run_tests()
}
post {
always {
preserve_logs('rhel8-image')
}
}
}
}
}
}
}
// Set up a function to hold the steps needed to run the tests so we don't
// need to copy/paste the same lines over and over above.
void run_tests() {
// Run the tests from the repository.
sh "schutzbot/run_tests.sh"
}
// Move logs to a unique location and tell Jenkins to capture them on success
// or failure.
void preserve_logs(test_slug) {
// Make a directory for the log files and move the logs there.
sh "mkdir ${test_slug} && mv *.log ${test_slug}/"
// Artifact the logs.
archiveArtifacts (
allowEmptyArchive: true,
artifacts: "${test_slug}/*.log"
)
}