You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@htrace.apache.org by st...@apache.org on 2015/09/16 05:55:44 UTC

[1/2] incubator-htrace git commit: HTRACE-249 Script and doc on how to publish website

Repository: incubator-htrace
Updated Branches:
  refs/heads/master 23e1b5302 -> 7e4530a24


HTRACE-249 Script and doc on how to publish website

bin/publish_hbase_website.sh

  Script copied from hbase written by Misty Stanley Jones.
  Changed the hbase references to htrace and removed hbase-specific
  checking.

htrace-hbase/pom.xml
  Need hbase-common to build javadoc so can build htrace site

src/main/site/markdown/building.md
  New file on how to build, release and publish to website.
  Currently just how to publish to website.

src/main/site/markdown/index.md
  Add news of releases.

src/main/site/site.xml
  Add references to new building.md file so shows in menu.


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

Branch: refs/heads/master
Commit: 5162d67c5cf2574f47c395797b3e6ff3050cd245
Parents: d7a7659
Author: stack <st...@duboce.net>
Authored: Tue Sep 15 14:41:55 2015 -0700
Committer: stack <st...@duboce.net>
Committed: Tue Sep 15 14:41:55 2015 -0700

----------------------------------------------------------------------
 bin/publish_hbase_website.sh       | 217 ++++++++++++++++++++++++++++++++
 htrace-hbase/pom.xml               |   7 ++
 src/main/site/markdown/building.md |  45 +++++++
 src/main/site/markdown/index.md    |   2 +
 src/main/site/site.xml             |   1 +
 5 files changed, 272 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/5162d67c/bin/publish_hbase_website.sh
----------------------------------------------------------------------
diff --git a/bin/publish_hbase_website.sh b/bin/publish_hbase_website.sh
new file mode 100755
index 0000000..0248fe4
--- /dev/null
+++ b/bin/publish_hbase_website.sh
@@ -0,0 +1,217 @@
+#!/usr/bin/env 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.
+
+USAGE="Usage: $0 [-i | -a] [-g <dir>] [-s <dir>]\n\
+-h          Show this message\n\
+-i          Prompts the user for input\n\
+-a          Does not prompt the user. Potentially dangerous.\n\
+-g          The local location of the HTrace git repository\n\
+-s          The local location of the HTrace website svn checkout\n\
+Either -i or -a is required.\n\
+Edit the script to set default Git and SVN directories."
+
+if [ "$#" == "0" ]; then
+  echo -e "$USAGE"
+  exit 1
+fi
+
+# Process args
+INTERACTIVE=
+AUTO=
+GIT_DIR=
+SVN_DIR=
+while getopts "hiag:s:" OPTION
+do
+  case $OPTION in
+    h)
+      echo -e "$USAGE"
+      exit
+      ;;
+    i)
+      INTERACTIVE=1
+      ;;
+    a)
+      # We don't actually use this variable but require it to be 
+      # set explicitly because it will commit changes without asking
+      AUTO=1
+      ;;
+    g)
+      GIT_DIR=$OPTARG
+      ;;
+    s)
+      SVN_DIR=$OPTARG
+      ;;
+  esac
+done
+
+if [ $INTERACTIVE ] && [ $AUTO ]; then
+    echo "Only one of -i or -a can be used."
+    echo -e $USAGE
+    exit 1
+fi
+
+# Set GIT_DIR and SVN_DIR to defaults if not given
+if [ ! "${GIT_DIR}" ]; then
+  GIT_DIR=~/git/htrace
+fi
+if [ ! "${SVN_DIR}" ]; then
+  SVN_DIR=~/svn/htrace.incubator.apache.org/master
+fi
+
+# Check that GIT_DIR and SVN_DIR exist
+if [ ! -d "${GIT_DIR}" -o ! -d "${SVN_DIR}" ]; then
+  echo "Both the GIT and SVN directories must exist."
+  echo -e $USAGE
+  exit 1
+fi
+
+cd $GIT_DIR
+
+# Get the latest
+echo "Updating Git"
+git checkout master
+git pull
+
+# Generate the site to ~/git/htrace/target/stage
+if [ $INTERACTIVE ]; then
+    read -p "Build the site? (y/n)" yn
+    case $yn in
+        [Yy]* ) 
+    			mvn clean package javadoc:aggregate site site:stage -DskipTests
+          status=$?
+          if [ $status != 0 ]; then
+            echo "The website does not build. Aborting."
+            exit $status
+          fi
+    			;;
+        [Nn]* ) 
+          echo "Not building the site."
+        ;;
+    esac
+else
+  echo "Building the site in auto mode."
+  mvn clean package javadoc:aggregate site site:stage -DskipTests
+  status=$?
+  if [ $status != 0 ]; then
+    echo "The website does not build. Aborting."
+    exit $status
+  fi
+fi
+
+
+# Refresh the local copy of the live website
+echo "Updating Subversion..."
+cd $SVN_DIR
+# Be aware that this will restore all the files deleted a few lines down 
+# if you are debugging this script 
+# and need to run it multiple times without svn committing
+svn update > /dev/null
+
+# Get current size of svn directory and # files, for sanity checking before commit
+SVN_OLD_SIZE=`du -sm . |awk '{print $1}'`
+SVN_OLD_NUMFILES=`find . -type f |wc -l |awk '{print $1}'`
+
+# Delete known auto-generated  content from trunk
+echo "Deleting known auto-generated content from SVN"
+rm -rf apidocs devapidocs xref xref-test book book.html java.html
+
+# Copy generated site to svn -- cp takes different options on Darwin and GNU
+echo "Copying the generated site to SVN"
+if [ `uname` == "Darwin" ]; then
+  COPYOPTS='-r'
+elif [ `uname` == "Linux" ]; then
+  COPYOPTS='-au'
+fi
+
+cp $COPYOPTS "${GIT_DIR}"/target/site/* .
+
+# Look for things we need to fix up in svn
+
+echo "Untracked files: svn add"
+svn status |grep '?' |sed -e "s/[[:space:]]//g"|cut -d '?' -f 2|while read i
+  do svn add $i 
+done
+
+echo "Locally deleted files: svn del"
+svn status |grep '!' |sed -e "s/[[:space:]]//g"|cut -d '!' -f 2|while read i
+  do svn del $i 
+done
+
+# Display the proposed changes. I filtered out 
+# modified because there are so many.
+if [ $INTERACTIVE ]; then
+  svn status |grep -v '^M'|less -P "Enter 'q' to exit the list."
+else
+  echo "The following changes will be made to SVN."
+  svn status
+fi
+
+# Get current size of svn directory, for sanity checking before commit
+SVN_NEW_SIZE=`du -sm . |awk '{print $1}'`
+SVN_NEW_NUMFILES=`find . -type f |wc -l |awk '{print $1}'`
+
+# Get difference between new and old size and number of files
+# We don't care about negatives so remove the sign
+SVN_SIZE_DIFF=`expr $SVN_NEW_SIZE - $SVN_OLD_SIZE|sed 's/-//g'`
+SVN_NUM_DIFF=`expr $SVN_NEW_NUMFILES - $SVN_OLD_NUMFILES|sed 's/-//g'`
+
+# The whole site is only 500 MB so a difference of 10 MB is huge
+# In this case, we should abort because something is wrong
+# Leaving this commented out for now until we get some benchmarks
+#if [ $SVN_SIZE_DIFF > 10 -o $SVN_NUM_DIFF > 50 ]; then
+#  echo "This commit would cause the website to change sizes by \
+#  $SVN_DIFF MB and $SVN_NUM_DIFF files. There is likely a problem. 
+#  Aborting."
+#  exit 1
+#fi
+
+
+if [ $INTERACTIVE ]; then
+  read -p "Commit changes? This will publish the website. (y/n)" yn
+  case $yn in
+  [Yy]* ) 
+    echo "Published website using script in interactive mode. \
+This commit changed the size of the website by $SVN_SIZE_DIFF MB \
+and the number of files by $SVN_NUM_DIFF files." |tee commit.txt
+    cat /tmp/out.txt >> /tmp/commit.txt
+    svn commit -F /tmp/commit.txt
+    exit
+    ;;
+  [Nn]* ) 
+    read -p "Revert SVN changes? (y/n)" revert
+    case $revert in
+    [Yy]* ) 
+      svn revert -R .
+      svn update
+      exit
+      ;;
+    [Nn]* ) 
+      exit
+      ;;
+    esac
+    ;;
+  esac
+else
+  echo "Published website using script in auto mode. This commit \
+changed the size of the website by $SVN_SIZE_DIFF MB and the number of files \
+by $SVN_NUM_DIFF files." |tee /tmp/commit.txt
+  cat /tmp/out.txt >> /tmp/commit.txt
+  svn commit -F /tmp/commit.txt
+fi
+

http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/5162d67c/htrace-hbase/pom.xml
----------------------------------------------------------------------
diff --git a/htrace-hbase/pom.xml b/htrace-hbase/pom.xml
index 4cd6375..89db195 100644
--- a/htrace-hbase/pom.xml
+++ b/htrace-hbase/pom.xml
@@ -156,6 +156,13 @@ language governing permissions and limitations under the License. -->
     </dependency>
     <!-- HBase specific deps. -->
     <dependency>
+      <!--Needed for javadoc generation-->
+      <groupId>org.apache.hbase</groupId>
+      <artifactId>hbase-common</artifactId>
+      <version>${hbase.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
       <groupId>org.apache.hbase</groupId>
       <artifactId>hbase-client</artifactId>
       <version>${hbase.version}</version>

http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/5162d67c/src/main/site/markdown/building.md
----------------------------------------------------------------------
diff --git a/src/main/site/markdown/building.md b/src/main/site/markdown/building.md
new file mode 100644
index 0000000..d5755af
--- /dev/null
+++ b/src/main/site/markdown/building.md
@@ -0,0 +1,45 @@
+<!---
+  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.
+-->
+
+# Building HTrace
+## Publishing a Release Candidate
+TODO
+
+## Publishing htrace.incubator.apache.org website
+Checkout the current website. It is in svn (that's right, subversion).
+The website is in a distinct location such that when its' content is svn
+committed, the commit is published as `htrace.incubator.apache.org`.
+
+Here is how you'd check out the current site into a directory named
+`htrace.incubator.apache.org` in the current directory:
+
+ $ svn checkout https://svn.apache.org/repos/asf/incubator/htrace/site/publish htrace.incubator.apache.org
+
+Next, run the site publishing script at `${HTRACE_CHECKOUT_DIR}/bin/publish_hbase_website.sh`.
+It will dump out usage information that looks like this:
+ $ ./bin/publish_hbase_website.sh
+ Usage: ./bin/publish_hbase_website.sh [-i | -a] [-g &lt;dir>] [-s &lt;dir>]
+ -h          Show this message
+ -i          Prompts the user for input
+ -a          Does not prompt the user. Potentially dangerous.
+ -g          The local location of the HTrace git repository
+ -s          The local location of the HTrace website svn checkout
+Either -i or -a is required.
+Edit the script to set default Git and SVN directories.
+
+To run the publish site script interactively, here is an example where
+the git checkout is at `~/checkouts/incubator-htrace` and the svn checkout
+is at `~/checkouts/htrace.incubator.apache.org`:
+
+ $ ./bin/publish_hbase_website.sh -i -g ~/checkouts/incubator-htrace -s ~/checkouts/htrace.incubator.apache.org/

http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/5162d67c/src/main/site/markdown/index.md
----------------------------------------------------------------------
diff --git a/src/main/site/markdown/index.md b/src/main/site/markdown/index.md
index 9207690..96d0e91 100644
--- a/src/main/site/markdown/index.md
+++ b/src/main/site/markdown/index.md
@@ -18,6 +18,8 @@ project. To add HTrace to your project, see detail on how to add it as a
 
 Formerly, HTrace was available at org.htrace.
 
+* htrace-4.0.0-incubating published September 15th, 2015. [Download it!](http://www.apache.org/dyn/closer.cgi/incubator/htrace/)
+* htrace-3.2.0-incubating published June 2nd, 2015. [Download it!](http://www.apache.org/dyn/closer.cgi/incubator/htrace/)
 * We made our first release from Apache Incubator, htrace-3.1.0-incubating, January 20th, 2015. [Download it!](http://www.apache.org/dyn/closer.cgi/incubator/htrace/)
 
 

http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/5162d67c/src/main/site/site.xml
----------------------------------------------------------------------
diff --git a/src/main/site/site.xml b/src/main/site/site.xml
index ce97490..4197159 100644
--- a/src/main/site/site.xml
+++ b/src/main/site/site.xml
@@ -45,6 +45,7 @@
       <item name="Modules" href="modules.html" />
       <item name="Project Info" href="project-info.html" />
       <item name="Team" href="team-list.html" />
+      <item name="Building" href="building.html" />
     </menu>
     <menu name="ASF">
         <item name="Apache Software Foundation"      href="http://www.apache.org/foundation/" />


[2/2] incubator-htrace git commit: HTRACE-249 Script and doc on how to publish website

Posted by st...@apache.org.
HTRACE-249 Script and doc on how to publish website

Addendum adding how to make release candidate


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

Branch: refs/heads/master
Commit: 7e4530a24a443188ef7d086140998d7afd9a76b8
Parents: 5162d67 23e1b53
Author: stack <st...@duboce.net>
Authored: Tue Sep 15 20:13:25 2015 -0700
Committer: stack <st...@duboce.net>
Committed: Tue Sep 15 20:55:20 2015 -0700

----------------------------------------------------------------------
 Dockerfile                         |  67 ++++++++++++++++
 src/main/site/markdown/building.md | 131 +++++++++++++++++++++++++++++---
 2 files changed, 188 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/7e4530a2/src/main/site/markdown/building.md
----------------------------------------------------------------------
diff --cc src/main/site/markdown/building.md
index d5755af,0000000..afa7e4e
mode 100644,000000..100644
--- a/src/main/site/markdown/building.md
+++ b/src/main/site/markdown/building.md
@@@ -1,45 -1,0 +1,156 @@@
 +<!---
 +  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.
 +-->
 +
 +# Building HTrace
 +## Publishing a Release Candidate
- TODO
++### Generating the PGP key (if you haven't already)
++Create new pgp key.  See http://www.apache.org/dev/openpgp.html
++
++    sudo zypper -y install gpg
++    gpg --version
++    gpg (GnuPG) 2.0.22
++
++This is a new enough version according to the apache site.
++
++Generate a new key via
++
++    gpg --gen-key --s2k-digest-algo sha512
++
++Answer 4096 bits, no expiration time.
++
++Uploaded key to http://pgp.mit.edu/ It now appears as
++
++    http://pgp.mit.edu/pks/lookup?op=get&amp;search=0xDE78987A9CD4D9D3
++
++Get the pgp key signed by others.
++
++Add the new pgp key to the KEYS file
++
++### JIRA maintenance
++From hadoop HowToRelease at https://wiki.apache.org/hadoop/HowToRelease :
++Bulk update Jira to unassign from this release all issues that are open
++non-blockers.
++
++#### Maven and build
++Update the versions in Maven.
++
++    mvn versions:set -DnewVersion=4.0.0
++
++or do it manually by editing the pom.xml files.  Commit the new versions.
++
++Add a settings.xml in `~/.m2/settings.xml` with the appropriate logins.
++
++Create the release branch:
++
++   git checkout -b 4.0
++
++Create the release tag via git
++
++    git tag -s 4.0.0RC0 -m '4.0 release candidate 0' -u 9CD4D9D3
++
++For some reason, I get a message about needing a password.  But no password
++is actually asked for.  Perhaps it is supplied by the window manager via its
++keyring-like program.
++
++Push branch-X.Y.Z and the newly created tag to the remote repo.
++
++    git push apache 4.0 4.0.0RC0
++
++Upload the build to Sonatype's servers.
++
++    git clean -fdqx .
++    mvn clean deploy -Psign,src,dist -DskipTests
++
++This will take a while because it needs to upload to the servers.
++
++Log into repository.apache.org and go to
++https://repository.apache.org/#stagingRepositories
++Select the repo you uploaded earlier.  You can browse the files
++here to verify it looks right.  When you are satisfied, click "Close".
++
++Generate the source tarball via:
++
++    mvn clean install -DskipTests assembly:single -Pdist
++
++Generate the side files.
++
++    gpg --print-mds /home/cmccabe/src/htrace2d/target/htrace-4.0.0-incubating-src.tar.gz > \
++    /home/cmccabe/src/htrace2d/target/htrace-4.0.0-incubating-src.tar.gz.mds
++    gpg --armor --output /home/cmccabe/src/htrace2d/target/htrace-4.0.0-incubating-src.tar.gz.asc \
++      --detach-sig /home/cmccabe/src/htrace2d/target/htrace-4.0.0-incubating-src.tar.gz
++
++rsync up to your public_html directory in people.apache.org.
++
++    rsync -avi /home/cmccabe/src/htrace2d/target/htrace-4.0.0-incubating-src.tar.* \
++    people.apache.org:~/public_html/htrace/releases/4.0.0
++
++Generate release notes via JIRA at
++https://issues.apache.org/jira/browse/HTRACE/
++by clicking on the release and then clicking the grey "release notes"
++button in the top right.
++
++### Mailing list
++Propose a new release on the mailing list.  Wait 1 day for responses.
++
++Post a message with the form:
++
++     > I've posted the first release candidate here:
++     >
++     > http://people.apache.org/~cmccabe/htrace/releases/4.0.0/rc0
++     >
++     > The jars have been staged here:
++     >
++     > https://repository.apache.org/content/repositories/orgapachehtrace-1017
++     >
++     > There's a lot of great stuff in this release [description]
++     >
++     > The vote will run for 5 days.
++     >
++     > cheers,
++     > Colin
++     >
++     > [release notes]
 +
 +## Publishing htrace.incubator.apache.org website
 +Checkout the current website. It is in svn (that's right, subversion).
 +The website is in a distinct location such that when its' content is svn
 +committed, the commit is published as `htrace.incubator.apache.org`.
 +
 +Here is how you'd check out the current site into a directory named
 +`htrace.incubator.apache.org` in the current directory:
 +
++~~~
 + $ svn checkout https://svn.apache.org/repos/asf/incubator/htrace/site/publish htrace.incubator.apache.org
++~~~
 +
 +Next, run the site publishing script at `${HTRACE_CHECKOUT_DIR}/bin/publish_hbase_website.sh`.
 +It will dump out usage information that looks like this:
-  $ ./bin/publish_hbase_website.sh
-  Usage: ./bin/publish_hbase_website.sh [-i | -a] [-g &lt;dir>] [-s &lt;dir>]
-  -h          Show this message
-  -i          Prompts the user for input
-  -a          Does not prompt the user. Potentially dangerous.
-  -g          The local location of the HTrace git repository
-  -s          The local location of the HTrace website svn checkout
- Either -i or -a is required.
- Edit the script to set default Git and SVN directories.
++
++    $ ./bin/publish_hbase_website.sh
++    Usage: ./bin/publish_hbase_website.sh [-i | -a] [-g &lt;dir>] [-s &lt;dir>]
++    -h          Show this message
++    -i          Prompts the user for input
++    -a          Does not prompt the user. Potentially dangerous.
++    -g          The local location of the HTrace git repository
++    -s          The local location of the HTrace website svn checkout
++    Either -i or -a is required.
++    Edit the script to set default Git and SVN directories.
 +
 +To run the publish site script interactively, here is an example where
 +the git checkout is at `~/checkouts/incubator-htrace` and the svn checkout
 +is at `~/checkouts/htrace.incubator.apache.org`:
 +
++~~~
 + $ ./bin/publish_hbase_website.sh -i -g ~/checkouts/incubator-htrace -s ~/checkouts/htrace.incubator.apache.org/
++~~~