Skip to content

Commit 7a0502c

Browse files
committedSep 25, 2023
chore(other): CHECKOUT-0 Add check to ensure SDK version is on CDN
1 parent 0672865 commit 7a0502c

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
 

‎.circleci/config.yml

+11
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ jobs:
9494
- store_artifacts:
9595
path: packages/test-framework/screenshots
9696

97+
sdk-on-cdn:
98+
<<: *node_executor
99+
steps:
100+
- ci/pre-setup
101+
- run:
102+
name: "Check SDK version on CDN"
103+
command: ./scripts/sdk-live-checker.sh
104+
97105
release:
98106
<<: *node_executor
99107
steps:
@@ -167,6 +175,9 @@ workflows:
167175
- e2e:
168176
filters:
169177
<<: *pull_request_filter
178+
- sdk-on-cdn:
179+
filters:
180+
<<: *pull_request_filter
170181
- ci/validate-commits:
171182
filters:
172183
<<: *pull_request_filter

‎scripts/sdk-live-checker.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
npm ci
4+
5+
# Make sure current version of @bigcommerce/checkout-sdk exists on the CDN
6+
CURRENT_VERSION=`npm list --depth=0 | grep checkout-sdk | sed -E 's/.*@//'`
7+
HTTP_STATUS=`curl -s -o /dev/null -I -w "%{http_code}" https://checkout-sdk.bigcommerce.com/v1/loader-v${CURRENT_VERSION}.js`
8+
if [[ $HTTP_STATUS == "200" ]]; then
9+
# Status 200, return OK
10+
exit 0
11+
else
12+
# Status not 200, return error
13+
exit 1
14+
fi

0 commit comments

Comments
 (0)
Please sign in to comment.