Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Integration] Running on integration (fix run of GitHub Actions for PRs targeting integration) #4372

Merged
merged 1 commit into from
Dec 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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