You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by GitBox <gi...@apache.org> on 2019/08/09 23:07:01 UTC

[GitHub] [arrow-site] kou commented on a change in pull request #9: ARROW-4473: [Website] Support test site deployment (take 2)

kou commented on a change in pull request #9: ARROW-4473: [Website] Support test site deployment (take 2)
URL: https://github.com/apache/arrow-site/pull/9#discussion_r312669799
 
 

 ##########
 File path: build-and-deploy.sh
 ##########
 @@ -0,0 +1,52 @@
+#!/bin/bash
+set -ev
+
+if [ "${TRAVIS_BRANCH}" = "master" ] && [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
+
+    if [ -z "${GITHUB_PAT}" ]; then
+        # Don't build because we can't publish
+        echo "To publish the site, you must set a GITHUB_PAT at"
+        echo "https://travis-ci.org/"${TRAVIS_REPO_SLUG}"/settings"
+        exit 1
+    fi
+
+    # Set git config so that the author of the deployed site commit is the same
+    # as the author of the commit we're building
+    export AUTHOR_EMAIL=$(git log -1 --pretty=format:%ae)
+    export AUTHOR_NAME=$(git log -1 --pretty=format:%an)
+    git config --global user.email "${AUTHOR_EMAIL}"
+    git config --global user.name "${AUTHOR_NAME}"
+
+    if [ "${TRAVIS_REPO_SLUG}" = "apache/arrow-site" ]; then
+        # Production
+        export TARGET_BRANCH=asf-site
 
 Review comment:
   We don't need to `export` this.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services