From 147d1f76388987bf1f92db24020a92b3dadf5cd1 Mon Sep 17 00:00:00 2001 From: fstagni Date: Fri, 10 Nov 2023 17:07:49 +0100 Subject: [PATCH] test: use REST APIs to get the latest releases --- .github/workflows/integration.yml | 42 +++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index b57a2f84..d94d6993 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - dirac_version: + dirac_branch: - rel-v8r0 - integration pilot_schema: @@ -43,14 +43,14 @@ jobs: sed -i "s/VAR_JENKINS_SITE/DIRAC.Jenkins.ch/g" pilot.json sed -i "s/VAR_JENKINS_CE/jenkins.cern.ch/g" pilot.json sed -i "s/VAR_JENKINS_QUEUE/jenkins-queue_not_important/g" pilot.json - sed -i "s/VAR_DIRAC_VERSION/${{ matrix.dirac_version }}/g" pilot.json + sed -i "s/VAR_DIRAC_VERSION/${{ matrix.dirac_branch }}/g" pilot.json sed -i "s#VAR_CS#https://lbcertifdirac70.cern.ch:9135/Configuration/Server#g" pilot.json sed -i "s#VAR_USERDN#/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=alboyer/CN=819281/CN=Alexandre Franck Boyer#g" pilot.json sed -i "s#VAR_USERDN_GRIDPP#${DIRACUSERDN_GRIDPP}#g" pilot.json g_job="testintegrationworkflow${GITHUB_JOB//-/}" pilotUUID="${g_job//_/}""${GITHUB_RUN_ID}" pilotUUID=$(echo $pilotUUID | rev | cut -c 1-32 | rev) - python dirac-pilot.py --modules https://github.com/DIRACGrid/DIRAC.git:::DIRAC:::${{ matrix.dirac_version }} -M 1 -S DIRAC-Certification -N jenkins.cern.ch -Q jenkins-queue_not_important -n DIRAC.Jenkins.ch --cert --certLocation=${GITHUB_WORKSPACE}/Pilot/etc/grid-security --wnVO=${{ matrix.VO }} --pilotUUID="${pilotUUID}" --debug + python dirac-pilot.py --modules https://github.com/DIRACGrid/DIRAC.git:::DIRAC:::${{ matrix.dirac_branch }} -M 1 -S DIRAC-Certification -N jenkins.cern.ch -Q jenkins-queue_not_important -n DIRAC.Jenkins.ch --cert --certLocation=${GITHUB_WORKSPACE}/Pilot/etc/grid-security --wnVO=${{ matrix.VO }} --pilotUUID="${pilotUUID}" --debug integration-cvmfs: @@ -62,8 +62,8 @@ jobs: - pilot_oldSchema.json - pilot_newSchema.json dirac_version: - - v8.0.27 - - v8.1.0a17 + - prod + - pre steps: - uses: actions/checkout@v4 @@ -89,12 +89,18 @@ jobs: X509_VOMS_DIR: /cvmfs/grid.cern.ch/etc/grid-security/vomsdir DIRAC_VOMSES: /cvmfs/grid.cern.ch/etc/grid-security/vomses run: | + if [ "${{ matrix.dirac_version }}" == "prod" ]; then + version=$(curl -s "https://api.github.com/repos/DIRACGrid/DIRAC/releases" | jq -r '.[].tag_name' | sort -V | grep -v 'a' | tail -n 1) + else + version=$(curl -s "https://api.github.com/repos/DIRACGrid/DIRAC/releases" | jq -r '.[].tag_name' | sort -V | grep 'a' | tail -n 1) + fi + echo ${version} cd Pilot cp ../tests/CI/${{ matrix.pilot_schema }} pilot.json sed -i "s/VAR_JENKINS_SITE/DIRAC.Jenkins.ch/g" pilot.json sed -i "s/VAR_JENKINS_CE/jenkins.cern.ch/g" pilot.json sed -i "s/VAR_JENKINS_QUEUE/jenkins-queue_not_important/g" pilot.json - sed -i "s/VAR_DIRAC_VERSION/${{ matrix.dirac_version }}/g" pilot.json + sed -i "s/VAR_DIRAC_VERSION/${version}/g" pilot.json sed -i "s#VAR_CS#https://lbcertifdirac70.cern.ch:9135/Configuration/Server#g" pilot.json sed -i "s#VAR_USERDN#/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=alboyer/CN=819281/CN=Alexandre Franck Boyer#g" pilot.json sed -i "s#VAR_USERDN_GRIDPP#${DIRACUSERDN_GRIDPP}#g" pilot.json @@ -127,12 +133,13 @@ jobs: chmod 400 etc/grid-security/hostkey.pem - name: tests run: | + version=$(curl -s "https://api.github.com/repos/DIRACGrid/DIRAC/releases" | jq -r '.[].tag_name' | sort -V | grep 'a' | tail -n 1) cd Pilot cp ../tests/CI/pilot_newSchema.json pilot.json sed -i "s/VAR_JENKINS_SITE/DIRAC.Jenkins.ch/g" pilot.json sed -i "s/VAR_JENKINS_CE/jenkins.cern.ch/g" pilot.json sed -i "s/VAR_JENKINS_QUEUE/jenkins-queue_not_important/g" pilot.json - sed -i "s/VAR_DIRAC_VERSION/v8.1.0a17/g" pilot.json + sed -i "s/VAR_DIRAC_VERSION/${version}/g" pilot.json sed -i "s#VAR_CS#https://lbcertifdirac70.cern.ch:9135/Configuration/Server#g" pilot.json sed -i "s#VAR_USERDN#/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=alboyer/CN=819281/CN=Alexandre Franck Boyer#g" pilot.json sed -i "s#VAR_USERDN_GRIDPP#${DIRACUSERDN_GRIDPP}#g" pilot.json @@ -196,8 +203,8 @@ jobs: - dteam - gridpp dirac_version: - - v8.0.27 - - v8.1.0a17 + - prod + - pre steps: - uses: actions/checkout@v4 @@ -219,12 +226,18 @@ jobs: chmod 400 etc/grid-security/hostkey.pem - name: tests run: | + if [ "${{ matrix.dirac_version }}" == "prod" ]; then + version=$(curl -s "https://api.github.com/repos/DIRACGrid/DIRAC/releases" | jq -r '.[].tag_name' | sort -V | grep -v 'a' | tail -n 1) + else + version=$(curl -s "https://api.github.com/repos/DIRACGrid/DIRAC/releases" | jq -r '.[].tag_name' | sort -V | grep 'a' | tail -n 1) + fi + echo ${version} cd Pilot cp ../tests/CI/pilot_newSchema.json pilot.json sed -i "s/VAR_JENKINS_SITE/DIRAC.Jenkins.ch/g" pilot.json sed -i "s/VAR_JENKINS_CE/jenkins-full.cern.ch/g" pilot.json sed -i "s/VAR_JENKINS_QUEUE/jenkins-queue_not_important/g" pilot.json - sed -i "s/VAR_DIRAC_VERSION/${{ matrix.dirac_version }}/g" pilot.json + sed -i "s/VAR_DIRAC_VERSION/${version}/g" pilot.json sed -i "s#VAR_CS#https://lbcertifdirac70.cern.ch:9135/Configuration/Server#g" pilot.json sed -i "s#VAR_USERDN#/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=alboyer/CN=819281/CN=Alexandre Franck Boyer#g" pilot.json sed -i "s#VAR_USERDN_GRIDPP#${DIRACUSERDN_GRIDPP}#g" pilot.json @@ -277,6 +290,7 @@ jobs: X509_VOMS_DIR: /cvmfs/lhcb.cern.ch/etc/grid-security/vomsdir DIRAC_VOMSES: /cvmfs/lhcb.cern.ch/etc/grid-security/vomses run: | + version=$(echo $(curl -s "https://gitlab.cern.ch/api/v4/projects/3588/releases") | jq -r '.[].name' | sort -V | grep -v 'a' | tail -n 1) cd Pilot export VO_LHCB_SW_DIR=${GITHUB_WORKSPACE}/Pilot curl https://gitlab.cern.ch/lhcb-dirac/LHCbPilot/-/raw/${{ matrix.pilot_version }}/LHCbPilot/LHCbPilotCommands.py -o LHCbPilotCommands.py @@ -284,7 +298,7 @@ jobs: sed -i "s/VAR_JENKINS_SITE/DIRAC.Jenkins.ch/g" pilot.json sed -i "s/VAR_JENKINS_CE/jenkins-lhcb.cern.ch/g" pilot.json sed -i "s/VAR_JENKINS_QUEUE/jenkins-queue_not_important/g" pilot.json - sed -i "s/VAR_DIRAC_VERSION/v11.0.20/g" pilot.json + sed -i "s/VAR_DIRAC_VERSION/${version}/g" pilot.json sed -i "s#VAR_CS#https://lbcertifdirac70.cern.ch:9135/Configuration/Server#g" pilot.json sed -i "s#VAR_USERDN#/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=alboyer/CN=819281/CN=Alexandre Franck Boyer#g" pilot.json sed -i "s#VAR_USERDN_GRIDPP#${DIRACUSERDN_GRIDPP}#g" pilot.json @@ -325,13 +339,14 @@ jobs: chmod 400 etc/grid-security/hostkey.pem - name: tests run: | + version=$(echo $(curl -s "https://gitlab.cern.ch/api/v4/projects/3588/releases") | jq -r '.[].name' | sort -V | grep -v 'a' | tail -n 1) cd Pilot curl https://lhcbdirac.s3.cern.ch/Pilot3/LHCbPilotCommands.py -o LHCbPilotCommands.py cp ../tests/CI/${{ matrix.pilot_schema }} pilot.json sed -i "s/VAR_JENKINS_SITE/DIRAC.Jenkins.ch/g" pilot.json sed -i "s/VAR_JENKINS_CE/${{ matrix.ce }}/g" pilot.json sed -i "s/VAR_JENKINS_QUEUE/jenkins-queue_not_important/g" pilot.json - sed -i "s/VAR_DIRAC_VERSION/v11.0.20/g" pilot.json + sed -i "s/VAR_DIRAC_VERSION/${version}/g" pilot.json sed -i "s#VAR_CS#https://lbcertifdirac70.cern.ch:9135/Configuration/Server#g" pilot.json sed -i "s#VAR_USERDN#/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=alboyer/CN=819281/CN=Alexandre Franck Boyer#g" pilot.json sed -i "s#VAR_USERDN_GRIDPP#${DIRACUSERDN_GRIDPP}#g" pilot.json @@ -372,13 +387,14 @@ jobs: chmod 400 etc/grid-security/hostkey.pem - name: tests run: | + version=$(echo $(curl -s "https://gitlab.cern.ch/api/v4/projects/3588/releases") | jq -r '.[].name' | sort -V | grep -v 'a' | tail -n 1) cd Pilot curl https://gitlab.cern.ch/lhcb-dirac/LHCbPilot/-/raw/${{ matrix.pilot_version }}/LHCbPilot/LHCbPilotCommands.py -o LHCbPilotCommands.py cp ../tests/CI/${{ matrix.pilot_schema }} pilot.json sed -i "s/VAR_JENKINS_SITE/DIRAC.Jenkins.ch/g" pilot.json sed -i "s/VAR_JENKINS_CE/jenkins-lhcb-d.cern.ch/g" pilot.json sed -i "s/VAR_JENKINS_QUEUE/jenkins-queue_not_important/g" pilot.json - sed -i "s/VAR_DIRAC_VERSION/v11.0.20/g" pilot.json + sed -i "s/VAR_DIRAC_VERSION/${version}/g" pilot.json sed -i "s#VAR_CS#https://lbcertifdirac70.cern.ch:9135/Configuration/Server#g" pilot.json sed -i "s#VAR_USERDN#/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=alboyer/CN=819281/CN=Alexandre Franck Boyer#g" pilot.json sed -i "s#VAR_USERDN_GRIDPP#${DIRACUSERDN_GRIDPP}#g" pilot.json