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

3.x: update helidon-version-is-release in doc files when updating release to fix links #6689

Merged
Merged
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
21 changes: 20 additions & 1 deletion etc/scripts/release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2018, 2022 Oracle and/or its affiliates.
# Copyright (c) 2018, 2023 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -121,6 +121,7 @@ update_version(){
# Hack to update helidon.version
for pom in `egrep "<helidon.version>.*</helidon.version>" -r . --include pom.xml | cut -d ':' -f 1 | sort | uniq `
do
echo "Updating helidon.version property in ${pom} to ${FULL_VERSION}"
cat ${pom} | \
sed -e s@'<helidon.version>.*</helidon.version>'@"<helidon.version>${FULL_VERSION}</helidon.version>"@g \
> ${pom}.tmp
Expand All @@ -130,6 +131,7 @@ update_version(){
# Hack to update helidon.version in build.gradle files
for bfile in `egrep "helidonversion = .*" -r . --include build.gradle | cut -d ':' -f 1 | sort | uniq `
do
echo "Updating helidonversion property in ${bfile} to ${FULL_VERSION}"
cat ${bfile} | \
sed -e s@'helidonversion = .*'@"helidonversion = \'${FULL_VERSION}\'"@g \
> ${bfile}.tmp
Expand All @@ -139,12 +141,29 @@ update_version(){
# Hack to update helidon-version in doc files
for dfile in `egrep ":helidon-version: .*" -r . --include attributes.adoc | cut -d ':' -f 1 | sort | uniq `
do
echo "Updating helidon-version property in ${dfile} to ${FULL_VERSION}"
cat ${dfile} | \
sed -e s@':helidon-version: .*'@":helidon-version: ${FULL_VERSION}"@g \
> ${dfile}.tmp
mv ${dfile}.tmp ${dfile}
done

# Hack to update helidon-version-is-release in doc files
# We are a released version if we are not a SNAPSHOT version
if [[ ${HELIDON_VERSION} == *-SNAPSHOT ]]; then
readonly IS_RELEASED="false"
else
readonly IS_RELEASED="true"
fi
for dfile in `egrep ":helidon-version-is-release: .*" -r . --include attributes.adoc | cut -d ':' -f 1 | sort | uniq `
do
echo "Updating helidon-version-is-release property in ${dfile} to ${IS_RELEASED}"
cat ${dfile} | \
sed -e s@':helidon-version-is-release: .*'@":helidon-version-is-release: ${IS_RELEASED}"@g \
> ${dfile}.tmp
mv ${dfile}.tmp ${dfile}
done

# Invoke prepare hook
if [ -n "${PREPARE_HOOKS}" ]; then
for prepare_hook in ${PREPARE_HOOKS} ; do
Expand Down