We have an internal package that we publish to AWS code artifact and consume in another project.
We have different repositories for different environments (e.g., dev and prod) configured in the pyproject.toml
as below. When deploying, credentials to the relevant repository are configured as an environment variable.
When we deploy to prod, it tries to connect to the dev repository and gets an authorized error (expected). I believe that it is because the dev repo is defined first. What is the correct way of managing and configuring it so we can use different repositories for different environments?
We use GitHub Actions for deployment.
[[tool.poetry.source]]
name = "codeartifact-dev"
url = "https://dev-env.com/pypi/beteende-constructs/simple/"
priority = "supplemental"
[[tool.poetry.source]]
name = "codeartifact-prod"
url = "https://prod-env.com/pypi/beteende-constructs/simple/"
priority = "supplemental"