Skip to content

Commit

Permalink
Merge pull request #2060 from video-dev/use-package-json-version-for-…
Browse files Browse the repository at this point in the history
…deploys

use the version from package.json when deploying
  • Loading branch information
tjenkinson committed Dec 22, 2018
2 parents a1df93a + ee97e11 commit 259c6c0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions scripts/build-deploy-netlify.sh
Expand Up @@ -5,11 +5,8 @@ set -e

id=$(git rev-parse HEAD)
root="./netlify"
tag=$(git describe --exact-match --tags HEAD 2>/dev/null || echo "")
idShort=$(echo "$id" | cut -c 1-8)
if [ ! -z "$tag" ] && [[ $tag == v* ]]; then
idShort="$idShort ($tag)"
fi
version=$(jq -r -e '.version' "./package.json")
idShort="$(echo "$id" | cut -c 1-8) ($version)"
latestSiteId="642d9ad4-f002-4104-9309-40ed9cd81a1f"
stableSiteId="deef7ecf-4c3e-4de0-b6bb-676b02e1c20e"

Expand Down Expand Up @@ -41,8 +38,8 @@ echo "Created site '$commitSiteId'."

deploy "$commitSiteId"
deploy "$latestSiteId"
if [ ! -z "$tag" ] && [[ $tag == v* ]]; then
echo "Detected tag: $tag"
if [[ $version != *"-"* ]]; then
echo "Detected new version: $version"
deploy "$stableSiteId"
fi
echo "Finished deploying to netlify."
Expand Down

0 comments on commit 259c6c0

Please sign in to comment.