Skip to content
Snippets Groups Projects
Commit 16d698a4 authored by François Grand's avatar François Grand
Browse files

fix: (too) early modification of application version in Angular service worker configuration file

refs #588
parent ddf7ec00
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment