You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Sean Busbey (JIRA)" <ji...@apache.org> on 2016/06/17 17:43:05 UTC

[jira] [Commented] (HBASE-15553) "publish hbase website" section is out of date

    [ https://issues.apache.org/jira/browse/HBASE-15553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15336541#comment-15336541 ] 

Sean Busbey commented on HBASE-15553:
-------------------------------------

jenkins job build step:

{code}
#!/bin/bash

LOCAL_REPO=${WORKSPACE}/.m2/repo
# Uncomment this to nuke the local maven repo each time, to start with a known environment
#rm -Rf $LOCAL_REPO
mkdir -p "${LOCAL_REPO}"

export JAVA_HOME=$JDK_1_7_LATEST__HOME
export PATH=$JAVA_HOME/bin:$MAVEN_3_3_3_HOME/bin:$PATH
export MAVEN_OPTS="-XX:MaxPermSize=256m -Dmaven.repo.local=${LOCAL_REPO}"

mvn -version

# Clean any leftover files in case we are reusing the workspace
rm -Rf -- *.patch *.patch.zip target

# Build HBase
cd hbase || exit -1

GIT_SHA=$(git log --pretty=format:%H -n1)

git reset --hard origin/master

echo "Building at commit:"
git log -n1
echo

# Build the site
mvn -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dfindbugs.skip=true clean install && mvn clean site -DskipTests
status=$?

if [ $status -ne 0 ]; then
  echo "Failure: mvn clean site"
  exit $status
fi

mvn site:stage
status=$?

if [ $status -ne 0 ] || [ ! -d target/staging ]; then
  echo "Failure: mvn site:stage"
  exit $status
fi

# Update the website
cd "${WORKSPACE}/hbase-site" || exit -1

git checkout asf-site
git reset --hard origin/asf-site
rm -Rf -- hbase-* apidocs devapidocs testapidocs testdevapidocs xref xref-test *book* *.html *.pdf* css js images
cp -au "${WORKSPACE}"/hbase/target/staging/* .

if [ ! -f index.html ]; then
  echo "The index.html is missing. Aborting."
  exit 1
else
  echo "Adding all the files we know about"
  git add --all -- hbase-* apidocs devapidocs testapidocs testdevapidocs xref xref-test *book* *.html *.pdf* css js images
  git status --short |grep '??' |while read -r i; do
    filename="echo $i |awk {'print $2'}"
    git add "$filename"
    echo "Added new file $filename"
  done
  echo
  
  COMMIT_MSG="Published site at $GIT_SHA."
  git commit -m "$COMMIT_MSG" -a
  git format-patch --stdout origin/asf-site > "${WORKSPACE}/$GIT_SHA.patch"
  
  echo "This commit changed these files (excluding Modified files):"
  git diff --name-status --diff-filter=ADCRTXUB origin/asf-site
  
  cd "${WORKSPACE}" || exit -1
  zip website.patch.zip "$GIT_SHA.patch"
fi

echo "GIT_SHA=$GIT_SHA" > git_sha.txt
{code}

And publishing email:

{code}
Build status: ${BUILD_STATUS}

If successful, the website and docs have been generated. If failed, skip to the bottom of this email.

Use the following commands to download the patch and apply it to a clean branch based on origin/asf-site. If you prefer to keep the hbase-site repo around permanently, you can skip the clone step.

  git clone https://git-wip-us.apache.org/repos/asf/hbase-site.git

  cd hbase-site
  wget -O- ${BUILD_URL}artifact/website.patch.zip | funzip > ${GIT_SHA}.patch
  git fetch
  git checkout -b asf-site-${GIT_SHA} origin/asf-site
  git am --whitespace=fix $GIT_SHA.patch

At this point, you can preview the changes by opening index.html or any of the other HTML pages in your local asf-site-${GIT_SHA} branch.

There are lots of spurious changes, such as timestamps and CSS styles in tables, so a generic git diff is not very useful. To see a list of files that have been added, deleted, renamed, changed type, or are otherwise interesting, use the following command:

  git diff --name-status --diff-filter=ADCRTXUB origin/asf-site

To see only files that had 100 or more lines changed:

  git diff --stat origin/asf-site | grep -E '[1-9][0-9]{2,}'

When you are satisfied, publish your changes to origin/asf-site using these commands:

  git commit --allow-empty -m "Empty commit" # to work around a current ASF INFRA bug
  git push origin asf-site-${GIT_SHA}:asf-site
  git checkout asf-site
  git branch -d asf-site-${GIT_SHA}

Changes take a couple of minutes to be propagated. You can verify whether they have been propagated by looking at the Last Published date at the bottom of http://hbase.apache.org/. It should match the date in the index.html on the asf-site branch in Git.

  



If failed, see ${BUILD_URL}console
{code}

the former can probably get ported into the codebase?

> "publish hbase website" section is out of date
> ----------------------------------------------
>
>                 Key: HBASE-15553
>                 URL: https://issues.apache.org/jira/browse/HBASE-15553
>             Project: HBase
>          Issue Type: Bug
>          Components: documentation, website
>            Reporter: Sean Busbey
>
> the current [ref guide section on publishing the webste|http://hbase.apache.org/book.html#website_publish] refers to using hte asf-site branch.
> it should reference the [hbase-site repo|git-wip-us.apache.org/repos/asf/hbase-site.git] and the [jenkins job|https://builds.apache.org/view/H-L/view/HBase/job/hbase_generate_website/]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)