From 898b2c61506e72847bae00aa8ffe228aebb69547 Mon Sep 17 00:00:00 2001 From: Ondrej Nosek Date: Mar 07 2023 19:56:32 +0000 Subject: Update docker image for Jenkinks tests Regenerate the docker image: Fedora 35 --> Fedora 37. Jenkinsfile as a pipeline script is unified with fedpkg. JIRA: RHELCMP-11391 Signed-off-by: Ondrej Nosek --- diff --git a/Jenkinsfile b/Jenkinsfile index b67b9a7..7b6742f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,7 +23,7 @@ pipeline { } try { echo "Requesting duffy node ..." - def session_str = sh returnStdout: true, script: "set +x; duffy client --url https://duffy.ci.centos.org/api/v1 --auth-name fedora-infra --auth-key $CICO_API_KEY request-session pool=virt-ec2-t2-centos-9s-x86_64,quantity=1" + def session_str = sh returnStdout: true, script: "set +x; duffy client --url https://duffy.ci.centos.org/api/v1 --auth-name fedora-infra --auth-key $CICO_API_KEY request-session pool=virt-ec2-t2-centos-8s-x86_64,quantity=1" def session = readJSON text: session_str DUFFY_SESSION_ID= session.session.id def hostname = session.session.nodes[0].hostname @@ -31,7 +31,7 @@ pipeline { def remote_dir = "/tmp/$JENKINS_AGENT_NAME" echo "remote_dir: $remote_dir" // this makes tests run in parallel if needed: "--parallel=auto --parallel-live" - def TOX_POSARGS = + def TOX_POSARGS = "" writeFile file: 'job.sh', text: """ set -xe dnf install -y git podman @@ -40,15 +40,19 @@ git config --global user.name "jenkins" cd $remote_dir git clone https://pagure.io/rpkg.git -b master cd rpkg -git remote rm proposed || true +# remove remote only if exists +remotes=\$(git remote) +if echo "\$remotes" | grep -q "^proposed\$"; then + git remote rm proposed || true +fi git remote add proposed "$params.REPO" git fetch proposed git checkout "origin/$params.BRANCH_TO" git merge --no-ff "proposed/$params.BRANCH" -m "Merge PR" -podman run --rm -v .:/src:Z quay.io/exd-guild-source-tools/rpkg-test tox -e py36,py39,flake8,bandit --workdir /tmp/tox ${TOX_POSARGS} +podman run --rm -v .:/src:Z quay.io/exd-guild-source-tools/rpkg-test:latest tox -e py36,py39,flake8,bandit --workdir /tmp/tox ${TOX_POSARGS} # disabled py27 environment for now; keep just flake8 for Python 2 -podman run --rm -v .:/src:Z quay.io/exd-guild-source-tools/rpkg-test-py2 tox -e flake8python2 --workdir /tmp/tox ${TOX_POSARGS} +podman run --rm -v .:/src:Z quay.io/exd-guild-source-tools/rpkg-test-py2:latest tox -e flake8python2 --workdir /tmp/tox ${TOX_POSARGS} """ sh "cat job.sh" sh "ssh -o StrictHostKeyChecking=no root@$hostname mkdir $remote_dir" diff --git a/jenkins_test.dockerfile b/jenkins_test.dockerfile index 43245b1..df8762e 100644 --- a/jenkins_test.dockerfile +++ b/jenkins_test.dockerfile @@ -1,4 +1,4 @@ -FROM fedora:35 +FROM fedora:37 LABEL \ name="rpkg test" \ description="Run tests using tox with Python 3" \