Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
*.iml
.flattened-pom.xml
*.ipr
*.iws
*.orig
Expand Down
1 change: 1 addition & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Drevision=0.14.0-SNAPSHOT
1 change: 1 addition & 0 deletions .yetus/excludes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ precommit/src/test/resources/brokenfiles/a.*\.txt
precommit/src/test/resources/brokenfiles/[2-3]\.txt
^precommit/src/test/resources/brokenfiles/4\.txt
precommit/src/test/resources/brokenfiles/perlcritic.pl
.mvn/maven.config
2 changes: 1 addition & 1 deletion asf-site-src/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.yetus</groupId>
<artifactId>yetus-project</artifactId>
<version>0.14.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>..</relativePath>
</parent>
<artifactId>asf-site</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.yetus</groupId>
<artifactId>yetus-project</artifactId>
<version>0.14.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>audience-annotations</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion audience-annotations-component/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.yetus</groupId>
<artifactId>yetus-project</artifactId>
<version>0.14.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>..</relativePath>
</parent>
<artifactId>audience-annotations-component</artifactId>
Expand Down
29 changes: 27 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</parent>
<groupId>org.apache.yetus</groupId>
<artifactId>yetus-project</artifactId>
<version>0.14.0-SNAPSHOT</version>
<version>${revision}</version>
<description>Project-wide definitions for Apache Yetus</description>
<name>Apache Yetus Project</name>
<packaging>pom</packaging>
Expand Down Expand Up @@ -67,6 +67,7 @@
<checkstyle.version>9.0</checkstyle.version>
<commons.io.version>2.11.0</commons.io.version>
<exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
<flatten.version>1.2.7</flatten.version>
<junit.version>5.8.2</junit.version>
<maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
<maven-javadoc-plugin.version>3.3.1</maven-javadoc-plugin.version>
Expand All @@ -93,7 +94,6 @@

<pluginManagement>
<plugins>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand Down Expand Up @@ -194,6 +194,31 @@


<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${flatten.version}</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
2 changes: 1 addition & 1 deletion precommit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.yetus</groupId>
<artifactId>yetus-project</artifactId>
<version>0.14.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>..</relativePath>
</parent>
<artifactId>precommit</artifactId>
Expand Down
8 changes: 3 additions & 5 deletions precommit/src/main/shell/core.d/01-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ function importplugins
# shellcheck disable=SC1090
files+=("${PERSONALITY}")
else
if [[ "${PERSONALITY}" != "${BASEDIR}/.yetus/personality.sh" ]]; then
if [[ -n "${PERSONALITY}" && "${PERSONALITY}" != "${BASEDIR}/.yetus/personality.sh" ]]; then
yetus_error "ERROR: ${PERSONALITY} does not exist."
exit 1
fi
Expand Down Expand Up @@ -764,11 +764,9 @@ function set_yetus_version
elif [[ -f "${BINDIR}/VERSION" ]]; then
# dist version file
VERSION=$(cat "${BINDIR}/VERSION")
elif [[ -f "${BINDIR}/../../../pom.xml" ]]; then
elif [[ -f "${BINDIR}/../../../../.mvn/maven.config" ]]; then
# this way we have no dependency on Maven being installed
VERSION=$("${GREP}" "<version>" "${BINDIR}/../../../pom.xml" 2>/dev/null \
| head -1 \
| "${SED}" -e 's|^ *<version>||' -e 's|</version>.*$||' 2>/dev/null)
VERSION=$("${GREP}" "revision" "${BINDIR}/../../../../.mvn/maven.config" 2>/dev/null | cut -f2 -d= 2>/dev/null)
fi
}

Expand Down
2 changes: 1 addition & 1 deletion precommit/src/main/shell/test-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2241,7 +2241,7 @@ function cleanup_and_exit
big_console_header "Finished build."
fi

if [[ "${DOCKERMODE}" != true ]]; then
if [[ "${DOCKERMODE}" != true && -f "${PATCH_DIR}/pidfile.txt" ]]; then
rm "${PATCH_DIR}/pidfile.txt"
fi

Expand Down
43 changes: 26 additions & 17 deletions release/initial-patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ if [[ ! -d precommit ]]; then
exit 1
fi

SYSTEM=$(uname -s)
if [[ "${SYSTEM}" == Darwin ]]; then
SEDI=("-i" '')
else
SEDI=("-i")
fi

#shellcheck source=SCRIPTDIR/../precommit/src/main/shell/core.d/00-yetuslib.sh
. precommit/src/main/shell/core.d/00-yetuslib.sh

Expand Down Expand Up @@ -82,6 +75,20 @@ option_parse()
fi
}

function check_basedir_repo
{
if [[ ! -e "${BASEDIR}/.git" ]]; then
yetus_error "ERROR: ${BASEDIR} is not a git repo."
cleanup_and_exit 1
fi

GIT_DIR="${BASEDIR}/.git"
export GIT_DIR

GIT_CEILING_DIRECTORIES="${BASEDIR}"
export GIT_CEILING_DIRECTORIES
}

docker_run() {
docker run -i --rm \
-v "${PWD}:/src" \
Expand All @@ -106,7 +113,7 @@ determine_versions() {
declare micro
declare microinc

OLD_BRANCH_VERSION=$(docker_run mvn -Dmaven.repo.local="${HOME}/.m2" help:evaluate -Dexpression=project.version -q -DforceStdout)
OLD_BRANCH_VERSION=$(grep revision .mvn/maven.config | cut -f2 -d=)

if [[ ${OLD_BRANCH_VERSION} =~ -SNAPSHOT ]]; then
if [[ -n "${NEW_BRANCH_VERSION}" ]]; then
Expand All @@ -128,17 +135,20 @@ determine_versions() {
}

update_version() {
declare oldversion=${1//\./\\.}
declare newversion=$2
declare newversion=$1

# *MOST* systems have sed -i these days
while read -r file; do
sed "${SEDI[@]}" "s,${oldversion},${newversion},g" "${file}"
done < <( find . -name 'pom.xml')
if ! grep -q .mvn/maven.config .yetus/excludes.txt; then
echo ".mvn/maven.config" >> .yetus/excludes.txt
fi
mkdir -p "${BASEDIR}/.mvn"
echo "-Drevision=${newversion}" > "${BASEDIR}/.mvn/maven.config"
git add "${BASEDIR}/.mvn/maven.config"
}

option_parse "$@"

check_basedir_repo

trap cleanup INT QUIT TRAP ABRT BUS SEGV TERM ERR

set -x
Expand All @@ -158,16 +168,15 @@ determine_versions

git checkout -b "${JIRAISSUE}-release"

update_version "${OLD_BRANCH_VERSION}" "${NEW_BRANCH_VERSION}"
update_version "${NEW_BRANCH_VERSION}"

git commit -a -m "${JIRAISSUE}. Stage version ${NEW_BRANCH_VERSION}"

if [[ -n "${NEW_MAIN_VERSION}" ]]; then
git checkout --force main
git checkout -b "${JIRAISSUE}-${STARTING_BRANCH}"
update_version "${OLD_BRANCH_VERSION}" "${NEW_MAIN_VERSION}"
update_version "${NEW_MAIN_VERSION}"
git commit -a -m "${JIRAISSUE}. Bump main version to ${NEW_MAIN_VERSION}"

fi

git checkout "${JIRAISSUE}-release"
Expand Down
2 changes: 1 addition & 1 deletion releasedocmaker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.yetus</groupId>
<artifactId>yetus-project</artifactId>
<version>0.14.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>..</relativePath>
</parent>
<artifactId>releasedocmaker</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion shelldocs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.yetus</groupId>
<artifactId>yetus-project</artifactId>
<version>0.14.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>..</relativePath>
</parent>
<artifactId>shelldocs</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion yetus-assemblies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.yetus</groupId>
<artifactId>yetus-project</artifactId>
<version>0.14.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>..</relativePath>
</parent>
<artifactId>yetus-assemblies</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion yetus-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.yetus</groupId>
<artifactId>yetus-project</artifactId>
<version>0.14.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>..</relativePath>
</parent>
<artifactId>yetus-dist</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion yetus-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.yetus</groupId>
<artifactId>yetus-project</artifactId>
<version>0.14.0-SNAPSHOT</version>
<version>${revision}</version>
<relativePath>..</relativePath>
</parent>
<artifactId>yetus-maven-plugin</artifactId>
Expand Down