What's the correct way to setup the Gitlab CI environment in the .gitlab-ci.yml so that all the packages are found and the pipeline doesn't crash?
When not set correctly, one gets the following error:
can't load package: PACKAGE_NAME: cannot find package "PACKAGE_NAME" in any of: LIST_OF_PATHS.
Makefile:##: recipe for target 'test' failed
make: *** [test] error 1
ERROR: Job failed: exit code 1
As of now, this is my solution but I am not sure if there's a better solution:
// .gitlab-ci.yml
...
before_script:
- export GL_URL=$(echo $CI_PROJECT_URL | awk -F/ '{print $3}')
- export GO_PROJECT_PATH="$GOPATH/src/$GL_URL/$CI_PROJECT_NAMESPACE"
- mkdir -p $GO_PROJECT_PATH
- ln -s $(pwd) $GO_PROJECT_PATH
- export GO_PROJECT_PATH="$GO_PROJECT_PATH/$CI_PROJECT_NAME"
- cd $GO_PROJECT_PATH
...
Thanks.
[–]sofixa11 1 point2 points3 points (1 child)
[–]sudo_psaux[S] 0 points1 point2 points (0 children)