I have an AWS EC2 instance that’s acting as a shell executor for my CICD pipeline.
When I ssh into the machine as ubuntu
and run activate /path/to/my/venv py311
along with pip install -r requirements.txt
, I’m able to install the packages from a private JFrog artifactory repository without any issue.
However, when my gitlab runner does the same two steps that I do manually, I’m met with:
ERROR: Could not find a version that satisfies the requirement package>=1.4.2 (from versions: none)
ERROR: No matching distribution found for package>=1.4.2
I’ve added steps in my .gitlab-ci.yml
to echo $USER
along with checking that .netrc
exists. Both return that the $USER
is ubuntu
and that .netrc exists
so I’m not sure why it’s having trouble installing the packages.
My .gitlab-ci.yml
looks like this:
stages:
- build
build-job:
stage: build
variables:
GIT_CLONE_PATH: '$CI_BUILDS_DIR/$CI_PROJECT_NAME/$CI_PIPELINE_ID'
NETRC: '$HOME/.netrc'
script:
- export PIP_CACHE_DIR=~/pip_store/pip_cache
- echo $USER
- echo "Verifying .netrc at $HOME/.netrc"
- if [[ -f "$HOME/.netrc" ]]; then echo ".netrc exists"; fi
- activate /path/to/my/venv py311
- echo "Installing packages..."
- pip install -r requirements.txt
I’ve also attached the job trace for verifying that $USER
and .netrc exists
as well: