Skip to content

Commit

Permalink
RATIS-2118. Improve assembly process (#1117)
Browse files Browse the repository at this point in the history
  • Loading branch information
adoroszlai committed Jul 1, 2024
1 parent c31806d commit 1cb6908
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 195 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/post-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions dev-support/make_rc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand All @@ -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
Expand Down
9 changes: 0 additions & 9 deletions ratis-assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand Down
43 changes: 0 additions & 43 deletions ratis-assembly/src/main/assembly/bin-pkg.xml

This file was deleted.

57 changes: 56 additions & 1 deletion ratis-assembly/src/main/assembly/bin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
73 changes: 0 additions & 73 deletions ratis-assembly/src/main/assembly/examples-bin.xml

This file was deleted.

61 changes: 0 additions & 61 deletions ratis-assembly/src/main/assembly/shell-bin.xml

This file was deleted.

1 change: 1 addition & 0 deletions ratis-assembly/src/main/assembly/src.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
-->
<id>src</id>
<baseDirectory>apache-ratis-${project.version}-src</baseDirectory>
<formats>
<format>tar.gz</format>
</formats>
Expand Down

0 comments on commit 1cb6908

Please sign in to comment.