Get latest provider version for a specific environment
Thomas Knee
Currently there is no way using the new environments approach to get/describe version within a specific environment.
As a workaround I have had to use legacy tagging and create a version tag immediately after we record-deployment into an environment. I can then use this version tag when I describe version with the specific tag passed in.
Seems there is a gap here between what you can do with legacy tags and the new environments approach.
My reason for needing to do this is because I reached pact nirvana for one service, and now when I add new services, pact can-i-deploy fails on the new services as they are not fully setup with recording deployments/releases etc yet, so I was advised in Pact Foundation slack workspace as a temporary workaround to instead run can-i-deploy against specific pacticipants and versions until the other newly added services are ready too.
For example, with a version tag I can do
pact-broker describe-version -a ProviderService -l $TAG -o json | jq '.number'
But there is no similar approach using environments approach instead of legacy tags.
Beth
You can also ignore specific applications using the
--ignore
flag in the can-i-deploy command.Thomas Knee
Beth: thank you I will give this a go later today
Thomas Knee
Beth: thank you this
--ignore
flag worked perfectly for my needs hereBeth
You can call the API. Go to
/environments
and then go to the tpb:currently-deployed-deployed-versions
link for the enviroment you're after.