Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

joshfischer/asf site #3414

Merged
merged 24 commits into from
Dec 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
76a1316
add asf site redirect
kramasamy Apr 24, 2018
3b8a881
merge
joshfischer1108 May 6, 2019
0d0bb7b
git-site-role commit from publish_site.sh
Oct 20, 2019
89a6fb0
updating compile docker script to run as host user
joshfischer1108 Nov 13, 2019
734b426
attempting to add host user
joshfischer1108 Nov 13, 2019
cb796d0
adding host user to docker container
joshfischer1108 Nov 26, 2019
f7a4798
remove user flag
joshfischer1108 Nov 26, 2019
43ca1e7
add user flag back. Update path
joshfischer1108 Nov 26, 2019
f215158
update path
joshfischer1108 Nov 26, 2019
50f11ee
correcting user gropus
joshfischer1108 Nov 27, 2019
f9afbf1
modifying directory path of volume in container
joshfischer1108 Nov 27, 2019
9a432d5
correcting npm command
joshfischer1108 Nov 29, 2019
c7a8501
adding encoding flag to javadocs command
joshfischer1108 Nov 30, 2019
e41a82e
comment out javadocs script
joshfischer1108 Nov 30, 2019
e004baa
attempting to list heronpy version
joshfischer1108 Nov 30, 2019
3083c07
changing environment variable name for debugging jenkins
joshfischer1108 Nov 30, 2019
1e28c21
attempting to remove heron version from pip script
joshfischer1108 Nov 30, 2019
abb926b
adding back javadocs to makefile. tweaking version matrix
joshfischer1108 Nov 30, 2019
f7cb411
flipping encoding flag
joshfischer1108 Nov 30, 2019
2732a7f
correct javadoc path
joshfischer1108 Nov 30, 2019
3248d93
creating paths for java and py docs
joshfischer1108 Nov 30, 2019
58eb65e
fix merge
joshfischer1108 Nov 30, 2019
2bd8339
pivoting to use gh token
joshfischer1108 Dec 4, 2019
847e342
removing duplicated htacess file
joshfischer1108 Dec 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions website2/website/scripts/Dockerfile.ubuntu18.04
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ FROM ubuntu:18.04
ENV TARGET_PLATFORM ubuntu
ENV bazelVersion 0.26.0


RUN apt-get update && apt-get -y install \
g++ \
cmake \
Expand Down Expand Up @@ -51,9 +52,17 @@ RUN apt-get update && apt-get install -y nodejs

ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64

ARG UNAME
ARG UID
ARG GID
RUN groupadd -g $GID -o $UNAME
RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME
USER $UNAME

RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
&& chmod +x /tmp/bazel.sh \
&& /tmp/bazel.sh
&& /tmp/bazel.sh --user

ADD bazelrc /root/.bazelrc
ADD bazelrc /home/$UNAME/.bazelrc
ENV PATH="/home/$UNAME/bin:${PATH}"

11 changes: 6 additions & 5 deletions website2/website/scripts/build-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@ VERSION=0.20
set -x -e

cd ${ROOT_DIR}/website2/website
#npm install yarn
npm build
npm install yarn
npm run-script build

node ./scripts/replace.js

rm -rf ${ROOT_DIR}/generated-site/content
mkdir -p ${ROOT_DIR}/generated-site/content
mkdir -p ${ROOT_DIR}/generated-site/content/api/java
mkdir -p ${ROOT_DIR}/generated-site/content/api/python
## copy generated site
cp -R build/incubator-heron/* ${ROOT_DIR}/generated-site/content
## copy java docs website2/website/static/api
cp -R ${ROOT_DIR}/website2/website/static/api/* ${ROOT_DIR}/generated-site/content/api/java/
## copy java docs
cp -R ${ROOT_DIR}/website2/website/public/api/java/* ${ROOT_DIR}/generated-site/content/api/java/
## copy pydocs
cp -R ${ROOT_DIR}/website2/website/static/api/python/* ${ROOT_DIR}/generated-site/content/api/python/
## remove bazelrc for dockerfile
Expand Down
12 changes: 9 additions & 3 deletions website2/website/scripts/compile-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,17 @@ echo "docker file"
echo $DOCKER_FILE

echo "Building heron-compiler container"
docker build -t heron-compiler:$TARGET_PLATFORM -f $DOCKER_FILE .
docker build \
--build-arg UNAME=$USER \
--build-arg UID=$(id -u ${USER}) \
--build-arg GID=$(id -g ${USER}) \
-t heron-compiler:$TARGET_PLATFORM -f $DOCKER_FILE .


docker run \
--rm \
-v $PROJECT_DIR/..:/dist \
-t heron-compiler:$TARGET_PLATFORM make -C /dist/website2/website/ buildsite
-u `id -u`:`id -g` \
-v $PROJECT_DIR/..:/home/$USER/heron \
-v /etc/passwd:/etc/passwd \
-t heron-compiler:$TARGET_PLATFORM make -C /home/$USER/heron/website2/website/ buildsite

1 change: 1 addition & 0 deletions website2/website/scripts/javadocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ CLOSURE_CLASSES="$HERON_ROOT_DIR/bazel-bin/storm-compatibility/src/java/_javac/s
export CLASSPATH=$BIN_JARS:$GEN_JARS:$SCRIBE_JARS:$PROTO_JARS:$CLOSURE_CLASSES

$JAVADOC $FLAGS \
-encoding "UTF-8" \
-windowtitle "Heron Java API" \
-doctitle "The Heron Java API" \
-overview $OVERVIEW_HTML_FILE \
Expand Down
35 changes: 24 additions & 11 deletions website2/website/scripts/publish_site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,34 @@
# specific language governing permissions and limitations
# under the License.

set -e

ROOT_DIR=$(git rev-parse --show-toplevel)
WORK_DIR=${ROOT_DIR}/generated-site/content
ME=`basename $0`

# push all of the results to asf-site branch
git checkout asf-site
git clean -f -d
git pull origin asf-site
ORIGIN_REPO=$(git remote show origin | grep 'Push URL' | awk -F// '{print $NF}')
echo "ORIGIN_REPO: $ORIGIN_REPO"

HERON_SITE_TMP=/tmp/heron-site
(

cd $ROOT_DIR
rm -rf $HERON_SITE_TMP
mkdir $HERON_SITE_TMP
cd $HERON_SITE_TMP

rm -rf ${ROOT_DIR}/content
mkdir ${ROOT_DIR}/content
git clone "https://$GH_TOKEN@$ORIGIN_REPO" .
git config user.name "Heron Site Updater"
git config user.email "[email protected]"
git checkout asf-site

cp -a $WORK_DIR/* ${ROOT_DIR}/content
cp -a ${ROOT_DIR}/.htaccess ${ROOT_DIR}/content
# copy the generated dir
cp -r $WORK_DIR/* $HERON_SITE_TMP/content
cp -a ${ROOT_DIR}/.htaccess ${ROOT_DIR}/content
# push all of the results to asf-site branch
git add -A .
git diff-index --quiet HEAD || (git commit -m "git-site-role commit from $ME" && git push -q origin HEAD:asf-site)
rm -rf $HERON_SITE_TMP

git add ${ROOT_DIR}/content
git commit -m "git-site-role commit from $ME"
git push origin asf-site
)
7 changes: 5 additions & 2 deletions website2/website/scripts/python-doc-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

set -e

HERONPY_VERSION=$1
TEMP_HERONPY_VERSION=$1
HERON_ROOT_DIR=$(git rev-parse --show-toplevel)
cd ${HERON_ROOT_DIR}

Expand All @@ -41,7 +41,10 @@ source "$VENV/bin/activate"
pip install pdoc==0.3.2
pip install --ignore-installed six
# Install the heronpy
pip install $PIP_LOCATION/heronpy-${HERONPY_VERSION}-py2.py3-none-any.whl
echo "list heronpy location"
ls $PIP_LOCATION
pip install $PIP_LOCATION/heronpy-*-py2.py3-none-any.whl


mkdir -p static/api && rm -rf static/api/python

Expand Down
6 changes: 3 additions & 3 deletions website2/website/scripts/replace.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ const versions = getVersions();
const latestVersion = versions[0];

const bazelVersions = {
'0.20.0': '0.14.1',
'0.20.1': '0.26',
'latest': '0.26',
'0.20.0-incubating': '0.14.1',
'0.20.1-incubating': '0.26.0',
'latest': '0.26.0',
}

function replaceBazel(version) {
Expand Down