Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heroku: update version and improve release script [ci skip] #1215

Merged
merged 1 commit into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"JHIPSTER_LITE_VERSION": {
"description": "Version of the JHipster Lite to deploy.",
"value": "0.15.0"
"value": "0.0.15"
}
},
"buildpacks": [{ "url": "heroku/jvm" }, { "url": "https://github.com/jhipster/jhipster-lite-heroku-buildpack" }]
Expand Down
23 changes: 15 additions & 8 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@ releaseVersion=${currentVersion//-SNAPSHOT/}

checkGit=$(git status --porcelain|wc -l)
if [[ $checkGit != 0 ]]; then
echo "*** Check: there are uncommitted changes..."
echo "*** check: there are uncommitted changes..."
show_syntax
fi

if [ "$#" -ne 1 ]; then
show_syntax
fi

echo "*** Git: update project..."
echo "*** git: update project..."
git switch $GIT_MAIN_BRANCH
git fetch $GIT_REMOTE
git rebase $GIT_REMOTE/$GIT_MAIN_BRANCH

if [[ "$1" == "patch" ]]; then
echo "*** Version: remove SNAPSHOT and keep the version"
echo "*** version: remove SNAPSHOT and keep the version"
./mvnw versions:set -DremoveSnapshot versions:commit -q

elif [[ "$1" == "minor" ]]; then
echo "*** Version: remove SNAPSHOT and change to minor version"
echo "*** version: remove SNAPSHOT and change to minor version"
./mvnw versions:set -DremoveSnapshot versions:commit -q
./mvnw build-helper:parse-version versions:set \
-DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.0 \
versions:commit -q
elif [[ "$1" == "major" ]]; then
echo "*** Version: remove SNAPSHOT and change to major version"
echo "*** version: remove SNAPSHOT and change to major version"
./mvnw versions:set -DremoveSnapshot versions:commit -q
./mvnw build-helper:parse-version versions:set \
-DnewVersion=\${parsedVersion.nextMajorVersion}.0.0 \
Expand All @@ -50,20 +50,27 @@ else
show_syntax
fi

echo "*** Git: commit, tag and push tag..."
echo "*** calculate release version..."
releaseVersion=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)

echo "*** update version in package.json"
npm version "${releaseVersion}" --no-git-tag-version

echo "*** update version in app.json"
sed -e '/"description": "Version of the JHipster Lite to deploy.",/{N;s/"value": ".*"/"value": "'$releaseVersion'"/1;}' app.json > app.json.sed
mv -f app.json.sed app.json

echo "*** git: commit, tag and push tag..."
git add . && git commit -m "Release v${releaseVersion}"
git tag -a v"${releaseVersion}" -m "Release v${releaseVersion}"
git push $GIT_REMOTE v"${releaseVersion}"

echo "*** Version: add SNAPSHOT"
echo "*** version: add SNAPSHOT"
./mvnw build-helper:parse-version versions:set \
-DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT \
versions:commit -q

echo "*** Git: commit, push to $GIT_MAIN_BRANCH..."
echo "*** git: commit, push to $GIT_MAIN_BRANCH..."
nextVersion=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
npm version "${nextVersion}" --no-git-tag-version
git add . && git commit -m "Update to next version v${nextVersion}"
Expand Down