Thomas K
06/06/2022, 6:38 PMrecord-deployment
and record-release
please...
When I record-deployment
into an environment, should the --version
be the same git commit sha for each environment I deploy to?
Reason I ask is because I had a command like this
docker run pactfoundation/pact-cli:latest pact-broker record-release --pacticipant DojoPayConsumerApp \
--version $BITRISE_GIT_COMMIT \
--environment production \
--broker-base-url $PACT_BROKER_BASE_URL \
--broker-username $PACT_BROKER_BASIC_AUTH_USERNAME \
--broker-password $PACT_BROKER_BASIC_AUTH_PASSWORD
in CI for deployments and releases, where the $BITRISE_GIT_COMMIT
version would be different for each deployment.
On the record-release
I was getting failures as it could not find the version it was looking up, would love some clarification on this please, thanks 🙂json
06/06/2022, 7:03 PMjson
06/06/2022, 7:05 PM$BITRISE_GIT_COMMIT
was different for each environment? Because that seems non-typical.Thomas K
06/06/2022, 7:11 PM$BITRISE_GIT_COMMIT
was different for each environment probably based on our git flow and how Bitrise works.
That env var is provided by Bitrise and auto grabs the commit sha.
When I make a PR, that will be one commit sha, when the job is triggered to merge that into develop branch, that’s another commit sha etc etc.
I’m guessing what I need to do is make sha consistent across all record deployments and releases, but would love some confirmation, if maybe @Matt (pactflow.io / pact-js / pact-go) knows please?json
06/06/2022, 7:16 PMThomas K
06/06/2022, 7:17 PMrecord-deployment
then later down the line might do other record-deployments
to other environments, should the sha be the same for all those record-deployments
?json
06/06/2022, 7:19 PMrecord-deployment
you should always use the actual commit sha that you deployed, or else the can-i-deploy
feature won't really work as intended.json
06/06/2022, 7:20 PMThomas K
06/06/2022, 7:20 PMrecord-release
its trying to use a git sha version it cannot find, e.g. another different shaThomas K
06/06/2022, 7:21 PMjson
06/06/2022, 7:21 PMjson
06/06/2022, 7:21 PMrecord-deployment
Thomas K
06/06/2022, 7:22 PMrecord-release
?Thomas K
06/06/2022, 7:22 PMjson
06/06/2022, 7:22 PMrecord-release
Thomas K
06/06/2022, 7:22 PMThomas K
06/06/2022, 7:23 PMThomas K
06/06/2022, 7:23 PMjson
06/06/2022, 7:23 PMThomas K
06/06/2022, 7:24 PMrecord-release
I probably need to grab the sha/version for the latest consumer version with the preproduction
tag/environment (which is the last environment before production
json
06/06/2022, 7:24 PMdoes it need to be the latest version / sha from a specific tag/environmentI'd say no, it doesn't need to be the latest, but it sounds like it does need to be a version that the pact broker has seen before
json
06/06/2022, 7:25 PMjson
06/06/2022, 7:25 PMjson
06/06/2022, 7:26 PMcan-i-deploy
may not work correctlyThomas K
06/06/2022, 7:27 PMjson
06/06/2022, 7:29 PMThomas K
06/06/2022, 7:41 PMjson
06/06/2022, 7:41 PMThomas K
06/06/2022, 7:46 PMtrigger_master
) we dont run any unit tests etc thus the pactPublish
never happens so it cant find it 🙃Thomas K
06/06/2022, 7:46 PMMatt (pactflow.io / pact-js / pact-go)
Timothy Jones
06/07/2022, 3:29 AMThomas K
06/07/2022, 8:58 AMpactPublish
in my release pipeline and the just auto grab the commit sha for that? Or do i instead grab the commit sha from my pre-release pipeline and use that when recording a release in my release pipeline?Timothy Jones
06/07/2022, 8:58 AMTimothy Jones
06/07/2022, 9:01 AMTimothy Jones
06/07/2022, 9:02 AMThomas K
06/07/2022, 9:02 AMtrigger_master_pr
and trigger_master
Timothy Jones
06/07/2022, 9:02 AMTimothy Jones
06/07/2022, 9:02 AMTimothy Jones
06/07/2022, 9:03 AMTimothy Jones
06/07/2022, 9:04 AMThomas K
06/07/2022, 9:04 AMTimothy Jones
06/07/2022, 9:04 AMThomas K
06/07/2022, 10:09 AMjson
06/07/2022, 1:25 PMThomas K
06/07/2022, 4:32 PMThomas K
06/07/2022, 4:33 PM