This is an automated email from the ASF dual-hosted git repository. szetszwo pushed a commit to branch branch-3.1.1_review in repository https://gitbox.apache.org/repos/asf/ratis.git
commit 8383845ddb77c64888bf8987fa30eb29a89461c1 Author: Doroszlai, Attila <[email protected]> AuthorDate: Mon Jul 1 07:27:49 2024 +0200 RATIS-2118. Improve assembly process (#1117) --- .github/workflows/post-commit.yml | 10 ++-- dev-support/make_rc.sh | 6 +- ratis-assembly/pom.xml | 9 --- ratis-assembly/src/main/assembly/bin-pkg.xml | 43 ------------- ratis-assembly/src/main/assembly/bin.xml | 57 +++++++++++++++++- ratis-assembly/src/main/assembly/examples-bin.xml | 73 ----------------------- ratis-assembly/src/main/assembly/shell-bin.xml | 61 ------------------- ratis-assembly/src/main/assembly/src.xml | 1 + 8 files changed, 65 insertions(+), 195 deletions(-) diff --git a/.github/workflows/post-commit.yml b/.github/workflows/post-commit.yml index 2aafb9031..4a0905754 100644 --- a/.github/workflows/post-commit.yml +++ b/.github/workflows/post-commit.yml @@ -50,14 +50,14 @@ jobs: with: name: ratis-bin path: | - ratis-assembly/target/apache-ratis-*.tar.gz - !ratis-assembly/target/apache-ratis-*-src.tar.gz + ratis-assembly/target/ratis-assembly-*.tar.gz + !ratis-assembly/target/ratis-assembly-*-src.tar.gz retention-days: 1 - name: Store source tarball for compilation uses: actions/upload-artifact@v4 with: name: ratis-src - path: ratis-assembly/target/apache-ratis-*-src.tar.gz + path: ratis-assembly/target/ratis-assembly-*-src.tar.gz retention-days: 1 compile: needs: @@ -75,7 +75,7 @@ jobs: name: ratis-src - name: Untar sources run: | - tar --strip-components 1 -xzvf apache-ratis-*-src.tar.gz + tar --strip-components 1 -xzvf ratis-assembly-*-src.tar.gz - name: Cache for maven dependencies uses: actions/cache/restore@v4 with: @@ -256,7 +256,7 @@ jobs: - name: Untar binaries run: | mkdir -p ratis-assembly/target - tar xzvf target/artifacts/ratis-bin/apache-ratis*.tar.gz -C ratis-assembly/target + tar xzvf target/artifacts/ratis-bin/ratis-assembly-*.tar.gz -C ratis-assembly/target - name: Calculate combined coverage run: ./dev-support/checks/coverage.sh - name: Upload coverage to Sonar diff --git a/dev-support/make_rc.sh b/dev-support/make_rc.sh index 6394d1427..64a6d3d41 100755 --- a/dev-support/make_rc.sh +++ b/dev-support/make_rc.sh @@ -114,7 +114,7 @@ prepare-bin() { rm -rf "$WORKINGDIR" mkdir -p "$WORKINGDIR" cd "$WORKINGDIR" - tar zvxf "$projectdir/ratis-assembly/target/apache-ratis-${RATISVERSION}-src.tar.gz" + tar zvxf "$projectdir/ratis-assembly/target/ratis-assembly-${RATISVERSION}-src.tar.gz" mv "apache-ratis-${RATISVERSION}-src" "apache-ratis-${RATISVERSION}" cd "apache-ratis-${RATISVERSION}" @@ -126,8 +126,8 @@ assembly() { RCDIR="$SVNDISTDIR/${RATISVERSION}/${RC#-}" mkdir -p "$RCDIR" cd "$RCDIR" - cp "$WORKINGDIR/apache-ratis-${RATISVERSION}/ratis-assembly/target/apache-ratis-${RATISVERSION}-bin.tar.gz" "apache-ratis-${RATISVERSION}-bin.tar.gz" - cp "$projectdir/ratis-assembly/target/apache-ratis-${RATISVERSION}-src.tar.gz" "apache-ratis-${RATISVERSION}-src.tar.gz" + cp "$WORKINGDIR/apache-ratis-${RATISVERSION}/ratis-assembly/target/ratis-assembly-${RATISVERSION}-bin.tar.gz" "apache-ratis-${RATISVERSION}-bin.tar.gz" + cp "$projectdir/ratis-assembly/target/ratis-assembly-${RATISVERSION}-src.tar.gz" "apache-ratis-${RATISVERSION}-src.tar.gz" for i in *.tar.gz; do gpg -u "${CODESIGNINGKEY}" --armor --output "${i}.asc" --detach-sig "${i}"; done for i in *.tar.gz; do gpg --print-md SHA512 "${i}" > "${i}.sha512"; done for i in *.tar.gz; do gpg --print-mds "${i}" > "${i}.mds"; done diff --git a/ratis-assembly/pom.xml b/ratis-assembly/pom.xml index 91a48c290..90ac0ac60 100644 --- a/ratis-assembly/pom.xml +++ b/ratis-assembly/pom.xml @@ -120,8 +120,6 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <configuration> - <!--Else will use ratis-assembly as final name.--> - <finalName>apache-ratis-${project.version}</finalName> <skipAssembly>false</skipAssembly> <appendAssemblyId>true</appendAssemblyId> <tarLongFileMode>gnu</tarLongFileMode> @@ -137,8 +135,6 @@ <descriptors> <descriptor>src/main/assembly/src.xml</descriptor> </descriptors> - <finalName>apache-ratis-${project.version}-src</finalName> - <appendAssemblyId>false</appendAssemblyId> </configuration> </execution> <execution> @@ -149,13 +145,8 @@ </goals> <configuration> <descriptors> - <descriptor>src/main/assembly/examples-bin.xml</descriptor> - <descriptor>src/main/assembly/shell-bin.xml</descriptor> <descriptor>src/main/assembly/bin.xml</descriptor> - <descriptor>src/main/assembly/bin-pkg.xml</descriptor> </descriptors> - <finalName>apache-ratis-${project.version}-bin</finalName> - <appendAssemblyId>false</appendAssemblyId> </configuration> </execution> </executions> diff --git a/ratis-assembly/src/main/assembly/bin-pkg.xml b/ratis-assembly/src/main/assembly/bin-pkg.xml deleted file mode 100644 index 4d8986957..000000000 --- a/ratis-assembly/src/main/assembly/bin-pkg.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0"?> -<!-- - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. See accompanying LICENSE file. ---> -<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd"> - <id>bin-pkg</id> - <formats> - <format>tar.gz</format> - </formats> - <fileSets> - <fileSet> - <directory>${project.basedir}/target/apache-ratis-${project.version}-bin/apache-ratis-${project.version}-bin</directory> - <outputDirectory>..</outputDirectory> - <excludes> - <exclude>bin/ratis</exclude> - <exclude>libexec/*.sh</exclude> - <exclude>examples/bin/*.sh</exclude> - </excludes> - </fileSet> - <fileSet> - <directory>${project.basedir}/target/apache-ratis-${project.version}-bin/apache-ratis-${project.version}-bin</directory> - <outputDirectory>..</outputDirectory> - <includes> - <include>bin/ratis</include> - <include>libexec/*.sh</include> - <include>examples/bin/*.sh</include> - </includes> - <fileMode>0755</fileMode> - </fileSet> - </fileSets> -</assembly> diff --git a/ratis-assembly/src/main/assembly/bin.xml b/ratis-assembly/src/main/assembly/bin.xml index abf4d40aa..7fd3cc0df 100644 --- a/ratis-assembly/src/main/assembly/bin.xml +++ b/ratis-assembly/src/main/assembly/bin.xml @@ -22,9 +22,18 @@ */ --> <id>bin</id> + <baseDirectory>apache-ratis-${project.version}-bin</baseDirectory> <formats> - <format>dir</format> + <format>tar.gz</format> </formats> + <dependencySets> + <dependencySet> + <includes> + <include>org.apache.ratis:ratis-examples</include> + </includes> + <outputDirectory>examples/lib</outputDirectory> + </dependencySet> + </dependencySets> <moduleSets> <moduleSet> <useAllReactorProjects>true</useAllReactorProjects> @@ -42,6 +51,7 @@ <include>org.apache.ratis:ratis-metrics-api</include> <include>org.apache.ratis:ratis-metrics-default</include> <include>org.apache.ratis:ratis-metrics-dropwizard3</include> + <include>org.apache.ratis:ratis-shell</include> <include>org.apache.ratis:ratis-tools</include> <include>org.apache.ratis:ratis-resource-bundle</include> </includes> @@ -80,5 +90,50 @@ <fileMode>0644</fileMode> <directoryMode>0755</directoryMode> </fileSet> + <fileSet> + <directory>${project.basedir}/../ratis-shell/src/main/bin</directory> + <outputDirectory>bin</outputDirectory> + <fileMode>0755</fileMode> + </fileSet> + <fileSet> + <directory>${project.basedir}/../ratis-shell/src/main/libexec</directory> + <outputDirectory>libexec</outputDirectory> + <fileMode>0755</fileMode> + <directoryMode>0755</directoryMode> + </fileSet> + <fileSet> + <directory>${project.basedir}/../ratis-shell/src/main/conf</directory> + <outputDirectory>conf</outputDirectory> + <fileMode>644</fileMode> + </fileSet> + <fileSet> + <directory>${project.basedir}/../ratis-shell/target/lib/</directory> + <outputDirectory>jars</outputDirectory> + </fileSet> + <fileSet> + <directory>${project.basedir}/../ratis-examples</directory> + <outputDirectory>examples</outputDirectory> + <includes> + <include>README.md</include> + </includes> + <fileMode>0644</fileMode> + </fileSet> + <fileSet> + <directory>${project.basedir}/../ratis-examples/src/main/bin</directory> + <outputDirectory>examples/bin</outputDirectory> + <includes> + <include>*.*</include> + </includes> + <fileMode>0755</fileMode> + </fileSet> + <fileSet> + <directory>${project.basedir}/../ratis-examples/src/main/resources</directory> + <outputDirectory>examples/conf</outputDirectory> + <includes> + <include>conf.properties</include> + <include>log4j.properties</include> + </includes> + <fileMode>644</fileMode> + </fileSet> </fileSets> </assembly> diff --git a/ratis-assembly/src/main/assembly/examples-bin.xml b/ratis-assembly/src/main/assembly/examples-bin.xml deleted file mode 100644 index 21cc7eced..000000000 --- a/ratis-assembly/src/main/assembly/examples-bin.xml +++ /dev/null @@ -1,73 +0,0 @@ -<?xml version="1.0"?> -<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd"> - <!-- - /** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - --> - <id>examples-bin</id> - <formats> - <format>dir</format> - </formats> - <dependencySets> - <dependencySet> - <includes> - <include>org.apache.ratis:ratis-examples</include> - </includes> - <outputDirectory>examples/lib</outputDirectory> - </dependencySet> - </dependencySets> - <fileSets> - <fileSet> - <directory>${project.basedir}/src/main/resources</directory> - <outputDirectory>.</outputDirectory> - <includes> - <include>README.md</include> - <include>LICENSE</include> - <include>NOTICE</include> - </includes> - <fileMode>0644</fileMode> - </fileSet> - <fileSet> - <directory>${project.basedir}/../ratis-examples</directory> - <outputDirectory>examples</outputDirectory> - <includes> - <include>README.md</include> - </includes> - <fileMode>0644</fileMode> - </fileSet> - <fileSet> - <directory>${project.basedir}/../ratis-examples/src/main/bin</directory> - <outputDirectory>examples/bin</outputDirectory> - <includes> - <include>*.*</include> - </includes> - <fileMode>0755</fileMode> - </fileSet> - <fileSet> - <directory>${project.basedir}/../ratis-examples/src/main/resources</directory> - <outputDirectory>examples/conf</outputDirectory> - <includes> - <include>conf.properties</include> - <include>log4j.properties</include> - </includes> - <fileMode>644</fileMode> - </fileSet> - </fileSets> -</assembly> diff --git a/ratis-assembly/src/main/assembly/shell-bin.xml b/ratis-assembly/src/main/assembly/shell-bin.xml deleted file mode 100644 index 470870f41..000000000 --- a/ratis-assembly/src/main/assembly/shell-bin.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0"?> -<!-- - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. See accompanying LICENSE file. ---> -<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd"> - <id>shell</id> - <formats> - <format>dir</format> - </formats> - <fileSets> - <fileSet> - <directory>${project.basedir}/../ratis-shell/target/</directory> - <outputDirectory>jars</outputDirectory> - <includes> - <include>ratis-shell-${project.version}.jar</include> - </includes> - </fileSet> - <fileSet> - <directory>${project.basedir}/../ratis-shell/target/lib/</directory> - <outputDirectory>jars</outputDirectory> - </fileSet> - <fileSet> - <directory>${project.basedir}/src/main/resources</directory> - <outputDirectory>.</outputDirectory> - <includes> - <include>README.md</include> - <include>LICENSE</include> - <include>NOTICE</include> - </includes> - <fileMode>0644</fileMode> - </fileSet> - <fileSet> - <directory>${project.basedir}/../ratis-shell/src/main/bin</directory> - <outputDirectory>bin</outputDirectory> - <fileMode>0755</fileMode> - </fileSet> - <fileSet> - <directory>${project.basedir}/../ratis-shell/src/main/libexec</directory> - <outputDirectory>libexec</outputDirectory> - <fileMode>0755</fileMode> - <directoryMode>0755</directoryMode> - </fileSet> - <fileSet> - <directory>${project.basedir}/../ratis-shell/src/main/conf</directory> - <outputDirectory>conf</outputDirectory> - <fileMode>644</fileMode> - </fileSet> - </fileSets> -</assembly> diff --git a/ratis-assembly/src/main/assembly/src.xml b/ratis-assembly/src/main/assembly/src.xml index 98e06c573..8c025c9c6 100644 --- a/ratis-assembly/src/main/assembly/src.xml +++ b/ratis-assembly/src/main/assembly/src.xml @@ -22,6 +22,7 @@ */ --> <id>src</id> + <baseDirectory>apache-ratis-${project.version}-src</baseDirectory> <formats> <format>tar.gz</format> </formats>
