52
loading...
This website collects cookies to deliver better user experience
[tool.poetry.dependencies]
python = "^3.9"
private-project = {git = "ssh://[email protected]/mundo03/sample-private-repo.git", rev = "main"}
image: python:3.9-buster
poetry_token:
script:
# Install Poetry
- pip install poetry
# setup string replacement
- export SSH_URL=ssh:\\/\\/[email protected]\\/mundo03
- export TOKEN_URL=https:\\/\\/$deploy_user:[email protected]\\/mundo03
- sed -i "s/$SSH_URL/$TOKEN_URL/g" pyproject.toml
# Install repo
- poetry install
# Use Clonned Repo
- poetry run print_something "LOOK AT ME!!"
sed
is being used to replace the SSH URL with an HTTP URL that has the Deploy Token in it.[tool.poetry.dependencies]
python = "^3.9"
private-project = {git = "ssh://[email protected]/mundo03/sample-private-repo.git", rev = "main"}
image: python:3.9-buster
poetry_key:
script:
# Install OS dependencies
- apt-get update -y -qq && apt-get install -y -qq make openssh-client python3-pip
# Start ssh-agent
- eval $(ssh-agent -s)
# Add Private key to SSH Agent
- ssh-add <(echo "$SSH_PK")
# Add gitlab as known host
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
# Install Poetry
- pip install poetry
# Install repo
- poetry install
# Use Clonned Repo
- poetry run print_something "LOOK AT ME!!"