forked from apache/mahout
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_site.sh
executable file
·65 lines (57 loc) · 2.2 KB
/
build_site.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Big thanks to Project Aria Tosca Incubating! (rawkintrevo lifted/modded their script Nov 29, 2017))
WORKDIR=/tmp/mahout-site
rm -rf $WORKDIR
mkdir -p $WORKDIR/docs/latest
export RUBY_PATH=~/shared/.rvm
export GEM_HOME=${RUBY_PATH}/gems
curl -sSL https://get.rvm.io | bash -s -- --path ${RUBY_PATH}
mkdir -p ${GEM_HOME}/gems
gem install --install-dir ${GEM_HOME} bundler
export PATH=${GEM_HOME}/bin:$PATH
(cd website && bundle install --path ${GEM_HOME})
(cd website && bundle)
(cd website && bundle exec jekyll build --destination $WORKDIR)
# Set env for docs
MAHOUT_VERSION=0.13.0
git checkout asf-site
git clean -f -d
git pull origin asf-site
if [ ! -d "/docs/$MAHOUT_VERSION/api" ]; then
echo "API docs for $MAHOUT_VERSION not found, downloading them"
DISTFILE=apache-mahout-distribution-$MAHOUT_VERSION.tar.gz
DISTPATH=https://dist.apache.org/repos/dist/release/mahout/$MAHOUT_VERSION/$DISTFILE
# Copy API docs into _site
wget -q --directory-prefix=$WORKDIR $DISTPATH
echo "Unzipping..."
tar -C $WORKDIR -xzf $WORKDIR/$DISTFILE apache-mahout-distribution-$MAHOUT_VERSION/docs
mkdir -p $WORKDIR/docs/$MAHOUT_VERSION/api
echo "Moving directory..."
mv $WORKDIR/apache-mahout-distribution-$MAHOUT_VERSION/docs $WORKDIR/docs/$MAHOUT_VERSION/api
rm -f $WORKDIR/$DISTFILE
echo "done."
fi
# rm -rf *
#cp -a $WORKDIR/* .
#cp -r $WORKDIR/* .
#git add .
#git commit -m "Automatic Site Publish by Buildbot"
#git push origin asf-site