Skip to content

Commit 95d00e1

Browse files
committed
ci(circleci): publish dev and prod pacts
1 parent 4e90a30 commit 95d00e1

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

.circleci/config.yml

+26-5
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,28 @@ jobs:
100100
- ./package.json
101101
# - jobstatus
102102

103-
publish:
103+
publish-dev:
104104
executor: build-executor
105105
steps:
106106
- attach_workspace:
107107
at: /tmp/workspace
108108
- setup_environment:
109109
version_path: /tmp/workspace
110110
- run:
111-
name: Publish pacts to broker
112-
command: npm run pact:publish
111+
name: Publish development pacts to broker
112+
command: cd /tmp/workspace && npm run pact:publish-dev
113+
# - jobstatus
114+
115+
publish-prod:
116+
executor: build-executor
117+
steps:
118+
- attach_workspace:
119+
at: /tmp/workspace
120+
- setup_environment:
121+
version_path: /tmp/workspace
122+
- run:
123+
name: Publish production pacts to broker
124+
command: npm run pact:publish-prod
113125
- run:
114126
name: Publish package to NPM
115127
command: cd /tmp/workspace && npm publish
@@ -134,7 +146,16 @@ workflows:
134146
build-and-deploy:
135147
jobs:
136148
- build_test
137-
- publish:
149+
- publish-dev:
150+
context:
151+
- org-global
152+
- w3w-pact
153+
requires:
154+
- build_test
155+
filters:
156+
branches:
157+
ignore: master
158+
- publish-prod:
138159
context:
139160
- org-global
140161
- w3w-pact
@@ -145,5 +166,5 @@ workflows:
145166
only: master
146167
- tag:
147168
requires:
148-
- publish
169+
- publish-prod
149170

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"pact_do_not_track": true
2121
},
2222
"scripts": {
23-
"pact:publish": "pact-broker publish pacts --consumer-app-version=\"$npm_package_version-$(git rev-parse --short HEAD)\" --auto-detect-version-properties --broker-base-url=${PACT_BROKER_BASE_URL}",
23+
"pact:publish-dev": "pact-broker publish pacts --consumer-app-version=\"$npm_package_version-$(git rev-parse --short HEAD)\" --auto-detect-version-properties --broker-base-url=${PACT_BROKER_BASE_URL}",
24+
"pact:publish-prod": "pact-broker publish pacts --consumer-app-version=\"$npm_package_version\" --auto-detect-version-properties --broker-base-url=${PACT_BROKER_BASE_URL}",
2425
"test": "jest",
2526
"test:watch": "jest --watch",
2627
"coverage": "jest --coverage",

0 commit comments

Comments
 (0)