diff --git a/scripts/deploy-new-stable-version.sh b/scripts/deploy-new-stable-version.sh index 92733055ec7e96cab769b35875b8710919a7e7cb..14ae97da12f54c82c9f6fbeaf52855310115775f 100755 --- a/scripts/deploy-new-stable-version.sh +++ b/scripts/deploy-new-stable-version.sh @@ -19,6 +19,9 @@ then exit 1 fi +# Angular service worker configuration file +NGSW_CONF=ngsw-config.json + # 0. changelog read -p "Avez-vous rempli jalhyd_branch, et les CHANGELOG de JaLHyd et NgHyd pour la version $VERSION ? (o/N) " -n 1 -r echo @@ -28,8 +31,8 @@ then exit 2 fi -if [[ ! -f ngsw-config.json ]]; then - echo "Fichier de configuration du service worker ngsw-config.json non trouvé" >&2 +if [[ ! -f $NGSW_CONF ]]; then + echo "Fichier de configuration du service worker $NGSW_CONF non trouvé" >&2 exit 1 fi @@ -73,11 +76,7 @@ git push --tags --force echo "BUILDING NGHYD" cd .. -# 2.1 service worker configuration (application version) - -sed -i "/\"version\": \"/s/\": \".*/\": \"$VERSION\"/" ngsw-config.json - -# 2.2 update Git repository +# 2.1 update Git repository git checkout master git pull --rebase npm install @@ -87,7 +86,7 @@ then git commit -a -m "verify dependencies (npm install) before deploying version $VERSION" fi -# 2.3 version in package.* +# 2.2 version in package.* npm version "$VERSION" --allow-same-version --git-tag-version=false if [ ! -z "$(git status --untracked-files=no --porcelain)" ] then @@ -95,6 +94,15 @@ then git commit -a -m "update package.* to version $VERSION" fi +# 2.3 service worker configuration (application version) +echo "updating version in Angular service worker configuration" >&2 +sed -i "/\"version\": \"/s/\": \".*/\": \"$VERSION\"/" $NGSW_CONF +# check +if [[ -z $(grep version $NGSW_CONF | grep $VERSION) ]]; then + echo "error updating version in service worker configuration file $NGSW_CONF" >&2 + exit 1 +fi + # 2.4 tags echo "setting tags to $VERSION version" git tag -fa stable -m "stable version"