Skip to content

Commit

Permalink
Merge pull request #4372 from fstagni/v7r2-fixes2
Browse files Browse the repository at this point in the history
[Integration] Running on integration (fix run of GitHub Actions for PRs targeting integration)
  • Loading branch information
fstagni authored Dec 15, 2019
2 parents cf2ffc7 + a8f57e7 commit e8c66f3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 27 additions & 8 deletions tests/CI/run_docker_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
8 changes: 6 additions & 2 deletions tests/Jenkins/utilities.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e8c66f3

Please sign in to comment.