diff --git a/cicd/crabserver_pypi/requirements.txt b/cicd/crabserver_pypi/requirements.txt index e8101c646b..d920f227a1 100644 --- a/cicd/crabserver_pypi/requirements.txt +++ b/cicd/crabserver_pypi/requirements.txt @@ -1,5 +1,5 @@ # Original dependencies from WMCore's requirements.txt -# https://github.com/dmwm/WMCore/blob/9c6e83d1d23983c0296eee318c9e6255ff80d01b/requirements.txt +# https://github.com/dmwm/WMCore/blob/2.3.7.1/requirements.txt # Lesser deps but match the version with upstream. Cheetah3==3.2.6.post1 CherryPy==18.8.0 diff --git a/cicd/crabserver_pypi/wmcore_requirements.txt b/cicd/crabserver_pypi/wmcore_requirements.txt index 07940f2c55..121be64bb8 100644 --- a/cicd/crabserver_pypi/wmcore_requirements.txt +++ b/cicd/crabserver_pypi/wmcore_requirements.txt @@ -6,4 +6,4 @@ # # Specifying repo other than "dmwm/WMCore" will use "clone-and-copy" method instead # of "pip install". See more detail in cicd/crabserver/installWMCore.sh -https://github.com/dmwm/WMCore 2.3.6rc2 +https://github.com/dmwm/WMCore 2.3.7.1 diff --git a/cicd/crabtaskworker_pypi/requirements.txt b/cicd/crabtaskworker_pypi/requirements.txt index 97106b0387..0a908eb88a 100644 --- a/cicd/crabtaskworker_pypi/requirements.txt +++ b/cicd/crabtaskworker_pypi/requirements.txt @@ -1,4 +1,4 @@ -# https://github.com/dmwm/WMCore/blob/2.2.4rc6/requirements.txt +# https://github.com/dmwm/WMCore/blob/2.3.7.1/requirements.txt # update deps version when bump wmcore version dbs3-client~=4.0.12 diff --git a/cicd/scripts/bumpWMCoreVersion.sh b/cicd/scripts/bumpWMCoreVersion.sh new file mode 100755 index 0000000000..a4590cc80f --- /dev/null +++ b/cicd/scripts/bumpWMCoreVersion.sh @@ -0,0 +1,40 @@ +#! /usr/bin/env bash +# Usage: +# - to bump to the latest WMCore version > ./cicd/scripts/bumpWMCoreVersion.sh +# - to bump to a specific WMCore version > ./cicd/scripts/bumpWMCoreVersion.sh +# Example: ./cicd/scripts/bumpWMCoreVersion.sh 2.3.7.6 + +# Check if specific version is provided as an argument +if [ -z "$1" ] + then + # if no argument passed, fetch the latest stable WMCore release tag + WMCORE_RELEASE_TAG=$(curl https://api.github.com/repos/dmwm/wmcore/releases/latest -s | jq .tag_name -r) + echo -e "The latest WMCore stable release is $WMCORE_RELEASE_TAG\n" +else + # Use the provided version argument + WMCORE_RELEASE_TAG=$1 + echo -e "Bumping WMCore version to $WMCORE_RELEASE_TAG\n" +fi + + +# Ensure the script is executed within the CRABServer codebase directory +if [[ "$PWD" =~ CRABServer ]]; then + [[ $PWD =~ (.*)/CRABServer.* ]] + BASE_WDIR=${BASH_REMATCH[1]} + WDIR=${BASE_WDIR}/CRABServer + + # Update WMCore version in relevant files + sed -i -e "s/\(.*\/dmwm\/WMCore\/blob\/\)\(.*\)\(\/requirements.txt$\)/\1$WMCORE_RELEASE_TAG\3/" ${WDIR}/cicd/crabserver_pypi/requirements.txt + sed -i -e "s/\(.*\/dmwm\/WMCore\/blob\/\)\(.*\)\(\/requirements.txt$\)/\1$WMCORE_RELEASE_TAG\3/" ${WDIR}/cicd/crabtaskworker_pypi/requirements.txt + sed -i -e "s/\(https:\/\/github.com\/dmwm\/WMCore \)\(.*\)/\1$WMCORE_RELEASE_TAG/" ${WDIR}/cicd/crabserver_pypi/wmcore_requirements.txt + + # Show a diff of the changes made for review + git diff ${WDIR}/cicd/crabserver_pypi/requirements.txt \ + ${WDIR}/cicd/crabtaskworker_pypi/requirements.txt \ + ${WDIR}/cicd/crabserver_pypi/wmcore_requirements.txt + echo -e "\n ^^^ If change made above looks ok then commit changes and bump crabserver tag to force rebuilding image, otherwise: + > git restore cicd/crabserver_pypi/requirements.txt cicd/crabserver_pypi/wmcore_requirements.txt cicd/crabtaskworker_pypi/requirements.txt " +else + echo -e "Please run this script inside CRABServer codebase directory." +fi +