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

Commit de8b554

Browse files
joshfischer/asf site (#3414)
* add asf site redirect * git-site-role commit from publish_site.sh * updating compile docker script to run as host user * attempting to add host user * adding host user to docker container * remove user flag * add user flag back. Update path * update path * correcting user gropus * modifying directory path of volume in container * correcting npm command * adding encoding flag to javadocs command * comment out javadocs script * attempting to list heronpy version * changing environment variable name for debugging jenkins * attempting to remove heron version from pip script * adding back javadocs to makefile. tweaking version matrix * flipping encoding flag * correct javadoc path * creating paths for java and py docs * pivoting to use gh token * removing duplicated htacess file
1 parent d8d811a commit de8b554

File tree

7 files changed

+59
-26
lines changed

7 files changed

+59
-26
lines changed

website2/website/scripts/Dockerfile.ubuntu18.04

+11-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ FROM ubuntu:18.04
2121
ENV TARGET_PLATFORM ubuntu
2222
ENV bazelVersion 0.26.0
2323

24+
2425
RUN apt-get update && apt-get -y install \
2526
g++ \
2627
cmake \
@@ -51,9 +52,17 @@ RUN apt-get update && apt-get install -y nodejs
5152

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

55+
ARG UNAME
56+
ARG UID
57+
ARG GID
58+
RUN groupadd -g $GID -o $UNAME
59+
RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME
60+
USER $UNAME
61+
5462
RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
5563
&& chmod +x /tmp/bazel.sh \
56-
&& /tmp/bazel.sh
64+
&& /tmp/bazel.sh --user
5765

58-
ADD bazelrc /root/.bazelrc
66+
ADD bazelrc /home/$UNAME/.bazelrc
67+
ENV PATH="/home/$UNAME/bin:${PATH}"
5968

website2/website/scripts/build-site.sh

+6-5
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,18 @@ VERSION=0.20
2323
set -x -e
2424

2525
cd ${ROOT_DIR}/website2/website
26-
#npm install yarn
27-
npm build
26+
npm install yarn
27+
npm run-script build
2828

2929
node ./scripts/replace.js
3030

3131
rm -rf ${ROOT_DIR}/generated-site/content
32-
mkdir -p ${ROOT_DIR}/generated-site/content
32+
mkdir -p ${ROOT_DIR}/generated-site/content/api/java
33+
mkdir -p ${ROOT_DIR}/generated-site/content/api/python
3334
## copy generated site
3435
cp -R build/incubator-heron/* ${ROOT_DIR}/generated-site/content
35-
## copy java docs website2/website/static/api
36-
cp -R ${ROOT_DIR}/website2/website/static/api/* ${ROOT_DIR}/generated-site/content/api/java/
36+
## copy java docs
37+
cp -R ${ROOT_DIR}/website2/website/public/api/java/* ${ROOT_DIR}/generated-site/content/api/java/
3738
## copy pydocs
3839
cp -R ${ROOT_DIR}/website2/website/static/api/python/* ${ROOT_DIR}/generated-site/content/api/python/
3940
## remove bazelrc for dockerfile

website2/website/scripts/compile-docker.sh

+9-3
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,17 @@ echo "docker file"
5353
echo $DOCKER_FILE
5454

5555
echo "Building heron-compiler container"
56-
docker build -t heron-compiler:$TARGET_PLATFORM -f $DOCKER_FILE .
56+
docker build \
57+
--build-arg UNAME=$USER \
58+
--build-arg UID=$(id -u ${USER}) \
59+
--build-arg GID=$(id -g ${USER}) \
60+
-t heron-compiler:$TARGET_PLATFORM -f $DOCKER_FILE .
5761

5862

5963
docker run \
6064
--rm \
61-
-v $PROJECT_DIR/..:/dist \
62-
-t heron-compiler:$TARGET_PLATFORM make -C /dist/website2/website/ buildsite
65+
-u `id -u`:`id -g` \
66+
-v $PROJECT_DIR/..:/home/$USER/heron \
67+
-v /etc/passwd:/etc/passwd \
68+
-t heron-compiler:$TARGET_PLATFORM make -C /home/$USER/heron/website2/website/ buildsite
6369

website2/website/scripts/javadocs.sh

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ CLOSURE_CLASSES="$HERON_ROOT_DIR/bazel-bin/storm-compatibility/src/java/_javac/s
5959
export CLASSPATH=$BIN_JARS:$GEN_JARS:$SCRIBE_JARS:$PROTO_JARS:$CLOSURE_CLASSES
6060

6161
$JAVADOC $FLAGS \
62+
-encoding "UTF-8" \
6263
-windowtitle "Heron Java API" \
6364
-doctitle "The Heron Java API" \
6465
-overview $OVERVIEW_HTML_FILE \

website2/website/scripts/publish_site.sh

+24-11
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,34 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818

19+
set -e
20+
1921
ROOT_DIR=$(git rev-parse --show-toplevel)
2022
WORK_DIR=${ROOT_DIR}/generated-site/content
2123
ME=`basename $0`
2224

23-
# push all of the results to asf-site branch
24-
git checkout asf-site
25-
git clean -f -d
26-
git pull origin asf-site
25+
ORIGIN_REPO=$(git remote show origin | grep 'Push URL' | awk -F// '{print $NF}')
26+
echo "ORIGIN_REPO: $ORIGIN_REPO"
27+
28+
HERON_SITE_TMP=/tmp/heron-site
29+
(
30+
31+
cd $ROOT_DIR
32+
rm -rf $HERON_SITE_TMP
33+
mkdir $HERON_SITE_TMP
34+
cd $HERON_SITE_TMP
2735

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

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

34-
git add ${ROOT_DIR}/content
35-
git commit -m "git-site-role commit from $ME"
36-
git push origin asf-site
49+
)

website2/website/scripts/python-doc-gen.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
set -e
2020

21-
HERONPY_VERSION=$1
21+
TEMP_HERONPY_VERSION=$1
2222
HERON_ROOT_DIR=$(git rev-parse --show-toplevel)
2323
cd ${HERON_ROOT_DIR}
2424

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

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

website2/website/scripts/replace.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ const versions = getVersions();
3535
const latestVersion = versions[0];
3636

3737
const bazelVersions = {
38-
'0.20.0': '0.14.1',
39-
'0.20.1': '0.26',
40-
'latest': '0.26',
38+
'0.20.0-incubating': '0.14.1',
39+
'0.20.1-incubating': '0.26.0',
40+
'latest': '0.26.0',
4141
}
4242

4343
function replaceBazel(version) {

0 commit comments

Comments
 (0)