Open angela-tran opened 1 month ago
An alternate way which requires more changes, but uses Environments in a way that maybe makes more sense
I think this makes a lot of sense! I know it's a bit more work but I feel like it would be useful to know how to set this up.
in
terraform/pipeline/deploy.yml
, derive the correct Environment name and store it in a variable
I tried using a variable in #483, but the tricky part is that environment
is set during compile time while our logic for looking at the branch / tag names is done at runtime.
@angela-tran if it's proving to be too much work, the single environment (without approval) is totally fine! Maybe we just rename it to Deployment
or something like that to indicate approval is removed.
@thekaveman Sounds good, I was thinking the same thing. Thanks!
Left todo:
terraform/pipeline/deploy.yml
edit: the pipeline is now working with #481. This ticket is still open because we could try to make the naming / deployment history on our Azure DevOps Environments a little more intuitive. See the second solution described below.
The infra pipeline is currently not able to run. The actual eligibility servers are still up and running, so this is not causing an outage, but we should get the infra pipeline back to working ASAP.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The infra pipeline succeeds.
Environment
Affects the infra pipeline only
Agency
Applies to infra pipelines for all agencies
Additional context
I removed the
Approval
environment from theApply
deployment job in #477 in an attempt to have it run without needing our manual approval, but that is not how it works.Environments in Azure DevOps represent a collection of resources that you might want to deploy to, for example maybe a VM or a Kubernetes environment. The Environment does not actually need to hold any resources, but it can. A use case for having an empty Environment is so you can use other features that it provides like deployment history and manual approvals.
A deployment job is a special type of job, and when it runs, it adds to the deployment history of the Environment that it is associated with. Therefore it requires an Environment.
The simplest way to remove approvals:
environment: Approval
to theApply
jobApproval
environment to not require any approvals (screenshot of configuration screen below)An alternate way which requires more changes, but uses Environments in a way that maybe makes more sense:
Dev
,Test
, andProd
- none of which require approvalterraform/pipeline/deploy.yml
, derive the correct Environment name and store it in a variableenvironment
on theApply
job using that variableApproval
environmentWith this alternate way, we would be able to see the deployment history for each environment separately instead of all in one. Current deployment history on![image](https://github.com/cal-itp/eligibility-server/assets/25497886/337db927-71d3-45af-989f-81f94fb60217)
Approval
is for all 3: