Repository: incubator-ratis
Updated Branches:
  refs/heads/master 3bf0b50d9 -> af1c0d77a


RATIS-65. Add a script to automate the release process.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ratis/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ratis/commit/af1c0d77
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ratis/tree/af1c0d77
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ratis/diff/af1c0d77

Branch: refs/heads/master
Commit: af1c0d77acbc4463afdeff6a440350b124f38c0b
Parents: 3bf0b50
Author: Tsz-Wo Nicholas Sze <[email protected]>
Authored: Fri Apr 28 14:22:34 2017 -0700
Committer: Tsz-Wo Nicholas Sze <[email protected]>
Committed: Fri Apr 28 14:22:34 2017 -0700

----------------------------------------------------------------------
 dev-support/make_rc.sh                   | 105 ++++++++++++++++++++++++
 pom.xml                                  |   2 +-
 ratis-assembly/pom.xml                   |   6 +-
 ratis-assembly/src/main/assembly/src.xml | 110 ++++++++++++++++++++++++++
 ratis-proto-shaded/pom.xml               |  17 ++++
 5 files changed, 236 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ratis/blob/af1c0d77/dev-support/make_rc.sh
----------------------------------------------------------------------
diff --git a/dev-support/make_rc.sh b/dev-support/make_rc.sh
new file mode 100755
index 0000000..7ec02d7
--- /dev/null
+++ b/dev-support/make_rc.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+# 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.
+
+
+# Script that assembles all you need to make an RC. Does build of the tar.gzs
+# which it stashes into a dir above $(pwd) named for the script with a
+# timestamp suffix. Deploys builds to maven.
+#
+# To finish, check what was build.  If good copy to people.apache.org and
+# close the maven repos.  Call a vote. 
+#
+# Presumes your settings.xml all set up so can sign artifacts published to 
mvn, etc.
+
+set -e
+
+# Set mvn and mvnopts
+mvn=mvn
+if [ "$MAVEN" != "" ]; then
+  mvn="${MAVEN}"
+fi
+mvnopts="-Xmx3g"
+if [ "$MAVEN_OPTS" != "" ]; then
+  mvnopts="${MAVEN_OPTS}"
+fi
+
+# Check project name
+projectname=`${mvn} help:evaluate -Dexpression=project.name | grep -v '[INFO]'`
+if [ "${projectname}" = "Apache Ratis" ]; then
+  echo
+  echo "Prepare release artifacts for $projectname"
+  echo
+else
+  echo "Unexpected project name \"${projectname}\"."
+  echo
+  echo "Please run this script ($0) under the root directory of Apache Ratis."
+  exit 1;
+fi
+
+# Set projectdir and archivedir
+projectdir=$(pwd)
+echo "Project dir ${projectdir}"
+archivedir="${projectdir}/../`basename ${projectdir}`.`date -u 
+"%Y%m%d-%H%M%S"`"
+echo "Archive dir ${archivedir}"
+if [ -d "${archivedir}" ]; then
+  echo "${archivedir} already exists"
+  exit 1;
+fi
+# Set repodir
+repodir=${projectdir}/../`basename ${projectdir}`.repository
+echo "Repo dir ${repodir}"
+
+# clean shaded source
+MAVEN_OPTS="${mvnopts}" ${mvn} clean -Pclean-shade
+
+artifactid=`${mvn} help:evaluate -Dexpression=project.artifactId | grep -v 
'[INFO]'`
+assemblydir="$(pwd)/${artifactid}-assembly"
+
+# generate tar.gz
+MAVEN_OPTS="${mvnopts}" ${mvn} install -DskipTests assembly:single \
+  -Prelease \
+  -Dmaven.javadoc.skip=true \
+  -Dmaven.repo.local=${repodir}
+repodir=`cd ${repodir} > /dev/null; pwd`
+
+mkdir "${archivedir}"
+archivedir=`cd ${archivedir} > /dev/null; pwd`
+mv ${assemblydir}/target/${artifactid}-*.tar.gz "${archivedir}"
+
+echo
+echo "Generated artifacts successfully."
+ls -l ${archivedir}
+echo
+echo "Check the content of ${archivedir}."
+echo "If good, sign and push to dist.apache.org"
+echo "  cd ${archivedir}"
+echo '  for i in *.tar.gz; do echo $i; gpg --print-mds $i > $i.mds ; done'
+echo '  for i in *.tar.gz; do echo $i; gpg --print-md MD5 $i > $i.md5 ; done'
+echo '  for i in *.tar.gz; do echo $i; gpg --print-md SHA512 $i > $i.sha ; 
done'
+echo '  for i in *.tar.gz; do echo $i; gpg --armor --output $i.asc 
--detach-sig $i ; done'
+echo "  rsync -av ${archivedir}/*.gz ${archivedir}/*.mds ${archivedir}/*.asc 
~/repos/dist-dev/${artifactid}-VERSION/"
+echo
+echo "Check the content deployed to maven."
+echo "If good, close the repo and record links of temporary staging repo"
+echo "  MAVEN_OPTS=\"${mvnopts}\" ${mvn} deploy -DskipTests -Papache-release 
-Prelease -Dmaven.repo.local=${repodir}"
+echo
+echo "If all good tag the RC"
+echo
+echo "Finally, you may want to remove archivedir and repodir"
+echo "  rm -rf ${archivedir}"
+echo "  rm -rf ${repodir}"

http://git-wip-us.apache.org/repos/asf/incubator-ratis/blob/af1c0d77/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 77bb8ea..d9aaa3e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -129,7 +129,7 @@
 
     <!-- Maven plugin versions -->
     <maven-antrun-plugin.version>1.7</maven-antrun-plugin.version>
-    <maven-assembly-plugin.version>2.4</maven-assembly-plugin.version>
+    <maven-assembly-plugin.version>3.0.0</maven-assembly-plugin.version>
     <maven-bundle-plugin.version>2.5.3</maven-bundle-plugin.version>
     <maven-checkstyle-plugin.version>2.15</maven-checkstyle-plugin.version>
     <maven-clean-plugin.version>3.0.0</maven-clean-plugin.version>

http://git-wip-us.apache.org/repos/asf/incubator-ratis/blob/af1c0d77/ratis-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/ratis-assembly/pom.xml b/ratis-assembly/pom.xml
index f026239..d10cd67 100644
--- a/ratis-assembly/pom.xml
+++ b/ratis-assembly/pom.xml
@@ -101,9 +101,9 @@
           <skipAssembly>false</skipAssembly>
           <appendAssemblyId>true</appendAssemblyId>
           <tarLongFileMode>gnu</tarLongFileMode>
-          <!--<descriptors> TODO
-            <descriptor>${assembly.file}</descriptor>
-          </descriptors>-->
+          <descriptors>
+            <descriptor>src/main/assembly/src.xml/</descriptor>
+          </descriptors>
         </configuration>
       </plugin>
       <plugin>

http://git-wip-us.apache.org/repos/asf/incubator-ratis/blob/af1c0d77/ratis-assembly/src/main/assembly/src.xml
----------------------------------------------------------------------
diff --git a/ratis-assembly/src/main/assembly/src.xml 
b/ratis-assembly/src/main/assembly/src.xml
new file mode 100644
index 0000000..6bedaba
--- /dev/null
+++ b/ratis-assembly/src/main/assembly/src.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0"?>
+<assembly 
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1
 http://maven.apache.org/xsd/assembly-1.1.1.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>release</id>
+  <formats>
+    <format>tar.gz</format>
+  </formats>
+  <moduleSets>
+    <moduleSet>
+      <useAllReactorProjects>true</useAllReactorProjects>
+      <includes>
+        <include>org.apache.ratis:ratis-hadoop-shaded</include>
+        <include>org.apache.ratis:ratis-proto-shaded</include>
+      </includes>
+      <sources>
+        <excludeSubModuleDirectories>false</excludeSubModuleDirectories>
+        <fileSets>
+          <fileSet>
+            <includes>
+              <include>**</include>
+            </includes>
+            <excludes>
+              <!-- For shaded modules, exclude generated sources -->
+              <exclude>src/main/java/</exclude>
+
+              <exclude>target/</exclude>
+              <exclude>test/</exclude>
+              <exclude>.classpath</exclude>
+              <exclude>.project</exclude>
+              <exclude>.settings/</exclude>
+              <exclude>*.iml/</exclude>
+            </excludes>
+          </fileSet>
+        </fileSets>
+      </sources>
+    </moduleSet>
+    <moduleSet>
+      <useAllReactorProjects>true</useAllReactorProjects>
+      <includes>
+        <include>org.apache.ratis:ratis-assembly</include>
+        <include>org.apache.ratis:ratis-client</include>
+        <include>org.apache.ratis:ratis-common</include>
+        <include>org.apache.ratis:ratis-examples</include>
+        <include>org.apache.ratis:ratis-grpc</include>
+        <include>org.apache.ratis:ratis-hadoop</include>
+        <include>org.apache.ratis:ratis-netty</include>
+        <include>org.apache.ratis:ratis-replicated-map</include>
+        <include>org.apache.ratis:ratis-server</include>
+      </includes>
+      <sources>
+        <excludeSubModuleDirectories>false</excludeSubModuleDirectories>
+        <fileSets>
+          <fileSet>
+            <includes>
+              <include>**</include>
+            </includes>
+            <excludes>
+              <exclude>target/</exclude>
+              <exclude>test/</exclude>
+              <exclude>.classpath</exclude>
+              <exclude>.project</exclude>
+              <exclude>.settings/</exclude>
+              <exclude>*.iml/</exclude>
+            </excludes>
+          </fileSet>
+        </fileSets>
+      </sources>
+    </moduleSet>
+  </moduleSets>
+  <fileSets>
+    <!-- Include dev support tools -->
+    <fileSet>
+      <directory>${project.basedir}/../dev-support</directory>
+      <outputDirectory>dev-support</outputDirectory>
+      <fileMode>0644</fileMode>
+      <directoryMode>0755</directoryMode>
+    </fileSet>
+    <!-- Include files in root dir -->
+    <fileSet>
+      <directory>${project.basedir}/..</directory>
+      <outputDirectory>.</outputDirectory>
+      <includes>
+        <include>BUILDING.md</include>
+        <include>LICENSE.txt</include>
+        <include>NOTICE.txt</include>
+        <include>README.md</include>
+        <include>pom.xml</include>
+      </includes>
+      <fileMode>0644</fileMode>
+    </fileSet>
+  </fileSets>
+</assembly>

http://git-wip-us.apache.org/repos/asf/incubator-ratis/blob/af1c0d77/ratis-proto-shaded/pom.xml
----------------------------------------------------------------------
diff --git a/ratis-proto-shaded/pom.xml b/ratis-proto-shaded/pom.xml
index 343c433..2bab939 100644
--- a/ratis-proto-shaded/pom.xml
+++ b/ratis-proto-shaded/pom.xml
@@ -63,6 +63,23 @@
           <skipAssembly>true</skipAssembly>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
+        <configuration>
+          <excludes>
+            <exclude>${shaded.sources.dir}/</exclude>
+          </excludes>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 

Reply via email to