Use pipeline credentials in unit test

This commit is contained in:
Vivek Kumar Dutta 2024-02-21 18:28:27 +05:30
parent 8da9a6c133
commit 5610a5ef43
3 changed files with 10 additions and 4 deletions

View file

@ -24,6 +24,7 @@ run_unit_test:
image: ${COMMON_IMAGE}
allow_failure: false
script:
- "./gitlab-ci/pipeline_setup.sh"
- "./gitlab-ci/install-dependencies.sh"
- "./gitlab-ci/setup.sh"
- "./gitlab-ci/unit-test.sh"
@ -37,7 +38,7 @@ run_tools_test:
image: ${COMMON_IMAGE}
allow_failure: false
script:
- "./gitlab-ci/setup.sh"
- "./gitlab-ci/pipeline_setup.sh"
- "./gitlab-ci/tools-test.sh"
- "./gitlab-ci/generate_supported_dm.sh"

7
gitlab-ci/pipeline_setup.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
echo "# Setting pipeline ci credentials"
echo "https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}" > ~/.git-credential
git config --global credential.helper "store --file ~/.git-credential"

View file

@ -2,9 +2,7 @@
echo "# Preparation script ..."
echo "Setting Git config"
echo "https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}" > ~/.git-credential
git config --global credential.helper "store --file ~/.git-credential"
./gitlab-ci/pipeline_setup.sh
# link '/bin/sh' to bash instead of dash
ln -sf bash /bin/sh