diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 0c669728022..3a66191b531 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -33,6 +33,7 @@ jobs: # Set environment variables echo -n "-e CI_PROJECT_DIR=/repo " >> run_in_container echo -n "-e CI_COMMIT_REF_NAME=$GITHUB_REF " >> run_in_container + echo -n "-e CI_MERGE_REQUEST_TARGET_BRANCH_NAME=$GITHUB_BASE_REF " >> run_in_container echo -n "-e CI_REGISTRY_IMAGE=gitlab-registry.cern.ch/cburr/dirac " >> run_in_container echo -n "-e MYSQL_VER=${{ matrix.MYSQL_VER }} " >> run_in_container echo -n "-e ES_VER=${{ matrix.ES_VER }} " >> run_in_container diff --git a/tests/CI/run_docker_setup.sh b/tests/CI/run_docker_setup.sh index e002e20497f..0570b8419e1 100755 --- a/tests/CI/run_docker_setup.sh +++ b/tests/CI/run_docker_setup.sh @@ -43,25 +43,44 @@ function prepareEnvironment() { # GitLab variables cp ./CONFIG "${SERVERCONFIG}" if [[ -n $CI_PROJECT_DIR ]]; then - echo "I guess we're in GitLab CI, using local repository in branch ${CI_COMMIT_REF_NAME}" + echo "I guess we're in GitLab CI/CD or GitHub Actions, using local repository in branch ${CI_COMMIT_REF_NAME}" + echo "if this is a merge request, the target is ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}" export TESTREPO=$CI_PROJECT_DIR export ALTERNATIVE_MODULES=$CI_PROJECT_DIR - # find the latest version + # find the latest version, unless it's integration if [ "${CI_COMMIT_REF_NAME}" = 'refs/heads/integration' ]; then - export DIRACBRANCH=integration + export DIRAC_RELEASE=integration + + { + echo "export TESTREPO=${TESTREPO}" + echo "export ALTERNATIVE_MODULES=${ALTERNATIVE_MODULES}" + echo "export DIRAC_RELEASE=${DIRAC_RELEASE}" + } >> "${SERVERCONFIG}" + + elif [ "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}" = 'integration' ]; then + export DIRAC_RELEASE=integration + + { + echo "export TESTREPO=${TESTREPO}" + echo "export ALTERNATIVE_MODULES=${ALTERNATIVE_MODULES}" + echo "export DIRAC_RELEASE=${DIRAC_RELEASE}" + } >> "${SERVERCONFIG}" + else majorVersion=$(grep "majorVersion =" "${TESTREPO}/__init__.py" | cut -d "=" -f 2) minorVersion=$(grep "minorVersion =" "${TESTREPO}/__init__.py" | cut -d "=" -f 2) export DIRACBRANCH=v${majorVersion// }r${minorVersion// } echo "Deduced DIRACBRANCH ${DIRACBRANCH} from __init__.py" + + { + echo "export TESTREPO=${TESTREPO}" + echo "export ALTERNATIVE_MODULES=${ALTERNATIVE_MODULES}" + echo "export DIRACBRANCH=${DIRACBRANCH}" + } >> "${SERVERCONFIG}" + fi - { - echo "export TESTREPO=${TESTREPO}" - echo "export ALTERNATIVE_MODULES=${ALTERNATIVE_MODULES}" - echo "export DIRACBRANCH=${DIRACBRANCH}" - } >> "${SERVERCONFIG}" fi cp "${SERVERCONFIG}" "${CLIENTCONFIG}" diff --git a/tests/Jenkins/utilities.sh b/tests/Jenkins/utilities.sh index b7ca4e75085..c7d937d4609 100644 --- a/tests/Jenkins/utilities.sh +++ b/tests/Jenkins/utilities.sh @@ -316,12 +316,16 @@ function installDIRAC(){ if [ "$CLIENT_ALTERNATIVE_MODULES" ]; then echo "Installing from non-release code" if [[ -d "$CLIENT_ALTERNATIVE_MODULES" ]]; then - INSTALLOPTIONS+="--module=$CLIENT_ALTERNATIVE_MODULES:::DIRAC:::local" + INSTALLOPTIONS+=" --module=$CLIENT_ALTERNATIVE_MODULES:::DIRAC:::local" else - INSTALLOPTIONS+="--module=$CLIENT_ALTERNATIVE_MODULES" + INSTALLOPTIONS+=" --module=$CLIENT_ALTERNATIVE_MODULES" fi fi + if [ "$DIRACOSVER" ]; then + INSTALLOPTIONS+=" --dirac-os --dirac-os-version=$DIRACOSVER " + fi + if ! ./dirac-install -r $DIRAC_RELEASE -t client $INSTALLOPTIONS $DEBUG; then echo 'ERROR: DIRAC client installation failed' exit 1