You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-6Lines changed: 22 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,7 @@ Returns exit code 0 or 1, indicating whether or not the specified application (p
94
94
95
95
The environment variables PACT_BROKER_BASE_URL, PACT_BROKER_USERNAME and PACT_BROKER_PASSWORD may be used instead of their respective command line options.
96
96
97
-
There are two ways to use `can-i-deploy`. The first (recommended and most common) approach is to specify just the application version you want to deploy and let the Pact Broker work out the dependencies for you. The second approach is to specify each application version explicitly. This would generally only be used if there were limitations that stopped you being able to use the first approach.
97
+
There are two ways to use `can-i-deploy`. The first (recommended and most commonly used) approach is to specify just the application version you want to deploy and let the Pact Broker work out the dependencies for you. The second approach is to specify each application version explicitly. This would generally only be used if there were limitations that stopped you being able to use the first approach.
98
98
99
99
#### Specifying an application version
100
100
@@ -105,6 +105,7 @@ To specify an application (pacticipant) version you need to provide:
105
105
*`--version VERSION` to specify a known application version (recommended)
106
106
*`--latest` to specify the latest version
107
107
*`--latest TAG` to specify the latest version that has a particular tag
108
+
*`--all TAG` to specify all the versions that have a particular tag (eg. "all prod" versions). This would be used when ensuring you have backwards compatiblity with all production mobile clients for a provider. Note, when using this option, you need to specify dependency explicitly (see the second usage option).
108
109
109
110
Using a specific version is the easiest way to ensure you get an accurate response that won't be affected by race conditions.
110
111
@@ -148,13 +149,20 @@ Can I deploy the latest version of the application Foo that has the tag "test" t
148
149
149
150
150
151
151
-
#### Alternate usage - specifying all dependencies explicitly
If you are unable to use tags, or there is some other limitation that stops you from using the recommended approach, you can specify each of the application versions explictly. You can specify as many application versions as you like.
154
+
If you are unable to use tags, or there is some other limitation that stops you from using the recommended approach, you can specify one or more of the dependencies explictly. You must also do this if you want to use the `--all TAG` option for any of the pacticipants.
You can specify as many application versions as you like, and you can even specify multiple versions of the same application (repeat the `--pacticipant` name and supply a different version.)
157
+
158
+
You can use explictly declared dependencies with or without the `--to ENVIRONMENT`. For example, if you declare two (or more) application versions with no `--to ENVIRONMENT`, then only the applications you specify will be taken into account when determining if it is safe to deploy. If you declare two (or more) application versions _as well as_ a `--to ENVIRONMENT`, then the Pact Broker will work out what integrations your declared applications will have in that environment when determining if it safe to deploy. When using this script for a production release, and you are using tags, it is always the most future-proof option to use the `--to` if possible, as it will catch any newly added consumers or providers.
159
+
160
+
If you are finding that your dependencies are not being automatically included when you supply multiple pacticipant versions, please upgrade to the latest version of the Pact Broker, as this is a more recently added feature.
@@ -175,6 +183,14 @@ Can I deploy the latest version of Foo with tag "master" and the latest version
175
183
--broker-base-url BROKER_BASE_URL
176
184
177
185
186
+
Mobile provider use case - can I deploy version b80e7b1b of Bar, all versions of Foo with tag "prod", and the latest version tagged "prod" of any other automatically calculated dependencies together? (Eg. where Bar is a provider and Foo is a mobile consumer with multiple versions in production, and Bar also has its own providers it needs to be compatible with.)
187
+
188
+
189
+
$ pact-broker can-i-deploy --pacticipant Bar --version b80e7b1b \
raise ::Thor::RequiredArgumentMissingError,"The version must be specified using --version or --latest [TAG] for pacticipant #{pacticipants_without_versions.join(", ")}"ifpacticipants_without_versions.any?
raise ::Thor::RequiredArgumentMissingError,"The version must be specified using `--version VERSION`, `--latest`, `--latest TAG`, or `--all TAG` for pacticipant #{pacticipants_without_versions.join(", ")}"ifpacticipants_without_versions.any?
0 commit comments