[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_r312652913 ## 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; Review comment: We can simplify this to `"https://...${TRAVIS_REPO_SLUG}/..."` (no `"` around `${TRAVIS_REPO_SLUG}`). 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: us...@infra.apache.org With regards, Apache Git Services
[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_r312656958 ## 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 +export BASE_URL=https://arrow.apache.org +else +# On a fork, so we'll deploy to GitHub Pages +export TARGET_BRANCH=gh-pages +# You could supply an alternate BASE_URL, but that's not necessary +# because we can infer it based on GitHub Pages conventions +if [ -z "${BASE_URL}" ]; then +export BASE_URL="https://"$(echo $TRAVIS_REPO_SLUG | sed 's@/@.github.io/@') +fi +fi +# Set the site.baseurl +perl -pe 's@^baseurl.*@baseurl: '"${BASE_URL}"'@' -i _config.yml Review comment: I think that you run `sed -i ...` on macOS. `sed -i ...` on macOS doesn't work because `sed` on macOS is BSD sed not GNU sed. There isn't portable command line to rewrite a file in-place for BSD sed and GNU sed. We need to create a backup file and remove the backup file like we did in `dev/release/00-prepare.sh`: https://github.com/apache/arrow/blob/master/dev/release/00-prepare.sh#L46-L49 BTW, how about using `jekyll build --baseurl="${BASE_URL}"` instead of rewriting `_config.yml`? 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: us...@infra.apache.org With regards, Apache Git Services
[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: us...@infra.apache.org With regards, Apache Git Services
[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_r312653965 ## 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 +export BASE_URL=https://arrow.apache.org +else +# On a fork, so we'll deploy to GitHub Pages +export TARGET_BRANCH=gh-pages +# You could supply an alternate BASE_URL, but that's not necessary +# because we can infer it based on GitHub Pages conventions +if [ -z "${BASE_URL}" ]; then +export BASE_URL="https://"$(echo $TRAVIS_REPO_SLUG | sed 's@/@.github.io/@') Review comment: `BASE_URL=$(echo $TRAVIS_REPO_SLUG | sed -e 's@.*/@@')` 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: us...@infra.apache.org With regards, Apache Git Services
[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_r312654738 ## 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 +export BASE_URL=https://arrow.apache.org +else +# On a fork, so we'll deploy to GitHub Pages +export TARGET_BRANCH=gh-pages +# You could supply an alternate BASE_URL, but that's not necessary +# because we can infer it based on GitHub Pages conventions +if [ -z "${BASE_URL}" ]; then +export BASE_URL="https://"$(echo $TRAVIS_REPO_SLUG | sed 's@/@.github.io/@') +fi +fi +# Set the site.baseurl +perl -pe 's@^baseurl.*@baseurl: '"${BASE_URL}"'@' -i _config.yml + +# Build +gem install jekyll bundler Review comment: We don't need this because `language: ruby` job does this automatically. 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: us...@infra.apache.org With regards, Apache Git Services
[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_r312670565 ## File path: _includes/footer.html ## @@ -2,5 +2,7 @@ Apache Arrow, Arrow, Apache, the Apache feather logo, and the Apache Arrow project logo are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries. 2016-2019 The Apache Software Foundation - {% asset main.js %} + https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"> + https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"> + https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" crossorigin="anonymous"> Review comment: We don't need this change if we don't use `baseurl` with hostname. 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: us...@infra.apache.org With regards, Apache Git Services
[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_r312670062 ## 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 +export BASE_URL=https://arrow.apache.org Review comment: Jekyll's `baseurl` don't include hostname. So `BASE_URL=` is correct. https://jekyllrb.com/docs/configuration/default/ > baseurl : "" # does not include hostname 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: us...@infra.apache.org With regards, Apache Git Services
[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_r312669779 ## 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) Review comment: Should we need to `export` them? 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: us...@infra.apache.org With regards, Apache Git Services
[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_r312654766 ## 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 +export BASE_URL=https://arrow.apache.org +else +# On a fork, so we'll deploy to GitHub Pages +export TARGET_BRANCH=gh-pages +# You could supply an alternate BASE_URL, but that's not necessary +# because we can infer it based on GitHub Pages conventions +if [ -z "${BASE_URL}" ]; then +export BASE_URL="https://"$(echo $TRAVIS_REPO_SLUG | sed 's@/@.github.io/@') +fi +fi +# Set the site.baseurl +perl -pe 's@^baseurl.*@baseurl: '"${BASE_URL}"'@' -i _config.yml + +# Build +gem install jekyll bundler +bundle install Review comment: Ditto. 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: us...@infra.apache.org With regards, Apache Git Services