:wave: , i tried to search the documentation for m...
# general
h
👋 , i tried to search the documentation for more info about environments, but i couldnt find anything to help describe the option
--no-production
for the cli
pact-broker create-environment
, documented here. is this option purely informational when creating an environment, or is it used somewhere like provider verification?
t
This is a great question! I don't know the answer, but I did notice that that document links to itself for more information:
The "test" and "production" environments will have been seeded for you. You can check the existing environments by running pact-broker list-environments. See https://docs.pact.io/pact_broker/client_cli/readme#environments for more information.
(which leads back to the same doc)
b
It’s just whether or not the environment is a production environment.
At the moment, it’s not used anywhere, but I could see that it might be useful information at some stage, so I included it from the start.
Does this help?
Whether or not this environment is a production environment. This is currently informational only.
h
yep, definitely more clear there. i looked in the cli doc first, so 👍 from me. fwiw, i was partly wondering if i could use it with
can-i-deploy
as a way to check many environments containing
production = true
b
tell me more about that usecase @Hazem Borham
Would it just be something you’d do once off to check the status of something, or in a CI/CD pipeline?
h
so we have a canonical environment pipeline for our micro service deployment:
dev-> stg -> prd
using the pact broker, i created the three envs. two with the field
production=true
, eg stg and prd. dev has the field
production=false
. this was due to me not knowing this flag was purely informational. after merge to main, we were thinking our AWS codepipeline as such:
Copy code
#dev
can-i-deploy --environment=dev --dry-run 
deploy
record-deployment --environment=dev

#stg
can-i-deploy --environment=stg
deploy
record-deployment --environment=stg

#prod
can-i-deploy --environment=stg
deploy
record-deployment --environment=stg
in our pr pipeline, we wanted to verify can-i-deploy would work for all of our production env:
Copy code
test
can-i-deploy --environment=stg
can-i-deploy --environment=prd
then it crossed my mind that the
--production --no-production
flags i came across during the create-environment might have special meaning. so i asked in this thread. :) basically i was curious if i could do this instead:
Copy code
test
can-i-deploy --to-production-environments
@Beth (pactflow.io/Pact Broker/pact-ruby) in case you didnt see. 😁
b
Thanks! That makes sense.
👍 1