From 803c698f9afc2daed5984ca2788e8c3ff1c91cd0 Mon Sep 17 00:00:00 2001 From: Jakub Rusz Date: Tue, 29 Jun 2021 13:56:07 +0200 Subject: [PATCH] ci: Remove Jenkins in favor of Gitlab CI Jenkinsfile and the trigger are no longer neccessary since we're moving all testing to Gitlab CI. --- .github/workflows/tests.yml | 18 --- schutzbot/Jenkinsfile | 226 ------------------------------------ 2 files changed, 244 deletions(-) delete mode 100644 schutzbot/Jenkinsfile diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b364729d..5e4928f7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -111,21 +111,3 @@ jobs: with: ignore_words_list: msdos skip: ./.git,coverity,rpmbuild,samples - - schutzbot: - name: "🍌 Trigger Schutzbot" - runs-on: ubuntu-latest - container: - image: docker.io/library/python:3.7 - steps: - - uses: actions/checkout@v2 - - name: Trigger Schutzbot - env: - EVENT_NAME: ${{ github.event_name }} - WEBHOOK_PAYLOAD: ${{ toJSON(github.event) }} - SQS_REGION: us-east-1 - SQS_QUEUE_URL: "https://sqs.us-east-1.amazonaws.com/933752197999/schutzbot_webhook_sqs-staging" - run: | - #!/bin/bash - pip3 install boto3 botocore - schutzbot/send_webhook.py diff --git a/schutzbot/Jenkinsfile b/schutzbot/Jenkinsfile deleted file mode 100644 index 79dfaaa1..00000000 --- a/schutzbot/Jenkinsfile +++ /dev/null @@ -1,226 +0,0 @@ -pipeline { - agent none - - environment { - AWS_REGION = "us-east-2" - } - - options { - ansiColor('xterm') - timestamps() - } - - stages { - stage("Prepare") { - agent { label "schutzbot" } - options { - // Don't checkout the git repository here. It just clogs - // up the Jenkins disk space and does nothing for us. - skipDefaultCheckout() - } - steps { - sh ( - label: "Get environment variables", - script: "env | sort" - ) - } - } - - 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 33') { - agent { label "f33cloudbase && x86_64" } - environment { - AWS_CREDS = credentials('aws-credentials-osbuildci') - } - steps { - sh "schutzbot/ci_details.sh" - sh "schutzbot/mockbuild.sh" - } - } - stage('Fedora 33 aarch64') { - agent { label "f33cloudbase && aarch64 && aws" } - environment { - AWS_CREDS = credentials('aws-credentials-osbuildci') - } - steps { - sh "schutzbot/ci_details.sh" - sh "schutzbot/mockbuild.sh" - } - } - stage('RHEL 8 CDN') { - agent { label "rhel8cloudbase && x86_64" } - environment { - AWS_CREDS = credentials('aws-credentials-osbuildci') - RHN_REGISTRATION_SCRIPT = credentials('rhn-register-script-production') - } - steps { - sh "schutzbot/ci_details.sh" - sh "schutzbot/mockbuild.sh" - } - } - stage('RHEL 8 aarch64 CDN') { - agent { label "rhel8cloudbase && aarch64 && aws" } - environment { - AWS_CREDS = credentials('aws-credentials-osbuildci') - RHN_REGISTRATION_SCRIPT = credentials('rhn-register-script-production') - } - steps { - sh "schutzbot/ci_details.sh" - sh "schutzbot/mockbuild.sh" - } - } - stage('RHEL 8.5') { - agent { label "rhel85cloudbase && x86_64 && psi" } - environment { - AWS_CREDS = credentials('aws-credentials-osbuildci') - RHEL85_NIGHTLY_REPO = credentials('rhel85-nightly-repo') - } - steps { - sh "schutzbot/ci_details.sh" - sh "schutzbot/mockbuild.sh" - } - } - stage('CS8') { - agent { label "cs8cloudbase && x86_64 && aws" } - environment { - AWS_CREDS = credentials('aws-credentials-osbuildci') - } - steps { - sh "schutzbot/ci_details.sh" - sh "schutzbot/mockbuild.sh" - } - } - stage('CS8 aarch64') { - agent { label "cs8cloudbase && aarch64 && aws" } - environment { - AWS_CREDS = credentials('aws-credentials-osbuildci') - } - steps { - sh "schutzbot/ci_details.sh" - sh "schutzbot/mockbuild.sh" - } - } - } - } - stage("Functional Testing") { - // Allow the other stages to finish if a single stage fails. - failFast false - - parallel { - stage('Fedora 33') { - agent { label "f33cloudbase && x86_64 && psi" } - environment { - TEST_TYPE = "image" - AWS_CREDS = credentials('aws-credentials-osbuildci') - DISTRO_CODE = "fedora33" - AWS_IMAGE_TEST_CREDS = credentials('aws-credentials-osbuild-image-test') - AZURE_CREDS = credentials('azure') - OPENSTACK_CREDS = credentials('psi-openstack-creds') - VCENTER_CREDS = credentials('vmware-vcenter-credentials') - } - steps { - run_tests() - } - post { - always { - preserve_logs('fedora33-image') - } - } - } - stage('RHEL 8 CDN') { - agent { label "rhel8cloudbase && x86_64 && psi" } - environment { - TEST_TYPE = "image" - RHN_REGISTRATION_SCRIPT = credentials('rhn-register-script-production') - AWS_CREDS = credentials('aws-credentials-osbuildci') - DISTRO_CODE = "rhel8" - AWS_IMAGE_TEST_CREDS = credentials('aws-credentials-osbuild-image-test') - AZURE_CREDS = credentials('azure') - OPENSTACK_CREDS = credentials('psi-openstack-creds') - VCENTER_CREDS = credentials('vmware-vcenter-credentials') - } - steps { - run_tests() - } - post { - always { - preserve_logs('rhel8-image') - } - } - } - } - } - } - - post { - success { - node('schutzbot') { - script { - if (env.BRANCH_NAME == 'main') { - telegramSend "💚 CI passed for osbuild main branch ${env.BUILD_URL}" - } - } - } - } - unsuccessful { - node('schutzbot') { - script { - if (env.BRANCH_NAME == 'main') { - telegramSend "💣 CI failed for osbuild main branch ${env.BUILD_URL}" - } - } - } - } - } - -} - -// 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() { - - // Get CI machine details. - sh ( - label: "Get CI machine details", - script: "schutzbot/ci_details.sh" - ) - - // Deploy the Image Builder packages and services. - sh ( - label: "Deploy", - script: "schutzbot/deploy.sh" - ) - - // Run the image tests. - sh ( - label: "Image tests", - script: "/usr/libexec/tests/osbuild-composer/image_tests.sh" - ) - -} - -// Move logs to a unique location and tell Jenkins to capture them on success -// or failure. -void preserve_logs(test_slug) { - - // Save the systemd journal. - sh "sudo journalctl --boot > systemd-journald.log" - - // Make a directory for the log files and move the logs there. - sh "mkdir ${test_slug} && mv *.log *.jpg ${test_slug}/ || true" - - // Artifact the repo file. - sh "cp /etc/yum.repos.d/osbuild.repo ${test_slug}/ || true" - - // Artifact the logs. - archiveArtifacts ( - allowEmptyArchive: true, - artifacts: "${test_slug}/*.log,${test_slug}/*.jpg,${test_slug}/*.repo" - ) - -}