Commit 5fbaa02f authored by Robert Knight's avatar Robert Knight

Wait for npm release to complete before deploying to CDN

npm packages are not immediately available after "npm publish" returns.
Wait until the package has been released before attempting to deploy it
to the CDN. This should fix the failure seen in
https://jenkins.hypothes.is/job/client/job/master/745/console.
parent 94028ff3
...@@ -110,6 +110,7 @@ node { ...@@ -110,6 +110,7 @@ node {
// See https://github.com/yarnpkg/yarn/pull/3391. // See https://github.com/yarnpkg/yarn/pull/3391.
sh "echo '//registry.npmjs.org/:_authToken=${env.NPM_TOKEN}' >> \$HOME/.npmrc" sh "echo '//registry.npmjs.org/:_authToken=${env.NPM_TOKEN}' >> \$HOME/.npmrc"
sh "npm publish --tag ${npmTag}" sh "npm publish --tag ${npmTag}"
sh "scripts/wait-for-npm-release.sh"
} }
} }
......
#!/bin/sh
# Wait for the version of the package available on npm to match the
# version in package.json.
#
# This script is needed because a new release of a package is not always
# immediately available after "npm publish" returns.
expected_version=$(node -p "require('./package.json').version")
while [ true ]
do
released_version=$(npm show hypothesis dist-tags.latest)
if [ $released_version = $expected_version ]; then
break
fi
sleep 1
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment