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

fix printing environment variables in GitLab CI #2423

Merged
merged 1 commit into from
Nov 18, 2024
Merged
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
15 changes: 11 additions & 4 deletions script/gitlabci/print_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ echo -e "\033[0;33mSteps to setup containter locally"

# display the correct docker run command
first_step_prefix="1. Run docker image via:"
if [ "${CMAKE_CXX_COMPILER}" == "nvc++" ] || [ "${alpaka_ACC_GPU_CUDA_ENABLE}" == "ON" ];
if [ "${CMAKE_CXX_COMPILER:-}" == "nvc++" ] || [ "${alpaka_ACC_GPU_CUDA_ENABLE}" == "ON" ];
then
if [ "${ALPAKA_CI_RUN_TESTS}" == "ON" ];
then
Expand All @@ -39,16 +39,23 @@ fi
echo -e "2. Run the following export commands in the container to setup enviroment\n"

# take all env variables, filter it and display it with a `export` prefix
printenv | grep -E 'alpaka_*|ALPAKA_*|CMAKE_*|BOOST_|CUDA_' | while read -r line ; do
echo "export $line \\"
env_name_prefixes=("^ALPAKA_*" "^alpaka_*" "^CMAKE_*" "^BOOST_*" "^CUDA_*")
for reg in ${env_name_prefixes[@]}; do
if printenv | grep -qE ${reg}; then
printenv | grep -E ${reg} | sort | while read -r line ; do
echo "export $line \\"
done
fi
done

echo "export CI_RUNNER_TAGS='${CI_RUNNER_TAGS}' \\"

# the variable is not set, but should be set if a job is debugged locally in a container
echo 'export alpaka_DISABLE_EXIT_FAILURE=true \'
echo 'export GITLAB_CI=true'
echo ""

echo "3. install git: apt update; apt install -y git"
echo "3. install git: apt update && apt install -y git"
echo "4. clone alpaka repository: git clone https://gitlab.com/hzdr/crp/alpaka.git --depth 1 -b ${CI_COMMIT_BRANCH}"
echo "5. Run the following script: cd alpaka && ./script/gitlab_ci_run.sh"
# reset the color
Expand Down
Loading