You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@milagro.apache.org by br...@apache.org on 2019/06/26 23:08:50 UTC
[incubator-milagro] branch dev updated: added asf-site-build.sh
This is an automated email from the ASF dual-hosted git repository.
brianspector pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-milagro.git
The following commit(s) were added to refs/heads/dev by this push:
new 6d6c322 added asf-site-build.sh
6d6c322 is described below
commit 6d6c32203829005be70777c1ad588053b8543bf3
Author: Brian Spector <br...@apache.org>
AuthorDate: Thu Jun 27 00:08:36 2019 +0100
added asf-site-build.sh
---
asf-site-build.sh | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/asf-site-build.sh b/asf-site-build.sh
new file mode 100755
index 0000000..326fac3
--- /dev/null
+++ b/asf-site-build.sh
@@ -0,0 +1,35 @@
+BRANCH=$(git branch | grep '^*' | sed 's/* //' )
+if [[ $BRANCH == "master" ]]; then
+ location=$PWD # get current dir
+ printf "\nThe current directory is %s\n" $location # print current dir
+ cd website # change to website dir
+ printf "\nThis directory should end in ../website: %s\n" $PWD # echo website directory just to be safe
+ printf "\nThe script is going to build the website now, this make take a few minutes.\n"
+ npm run build # build website
+ # for i in ./*; do
+ # echo $i
+ # done
+ printf "\nThe script will make a temporary directory at /tmp/asf-site-prep/\n" $USER # describe action
+ mkdir /tmp/asf-site-prep/ # making temp director
+ printf "\nThe script will move the contents of the /build directory to /tmp/asf-site-prep/\n" # describe action
+ mv ./build/* /tmp/asf-site-prep/ # copy contents of directory
+ printf "\nThe script will make a temporary directory at /tmp/asf-site/ and will clone the asf-site branch into it.\n" # describe action
+ mkdir /tmp/asf-site # make directory
+ cd /tmp/asf-site # switch directory
+ git clone -b asf-site --single-branch https://github.com/apache/incubator-milagro # cloning website
+ cd incubator-milagro # into directory
+ printf "\nThe script will push the new asf-site branch and begin cleanup.\n\n" # describe action
+ git rm -r *
+ git commit -m "removing asf-site files"
+ cp -R /tmp/asf-site-prep/incubator-milagro\ /* /tmp/asf-site/incubator-milagro/
+ git add .
+ git commit -m "new asf-site"
+ git push origin asf-site
+ cd $location
+ printf "\nRemoving the /tmp directories.\n\n" # describe action
+ rm -rf /tmp/asf-site-prep
+ rm -rf /tmp/asf-site
+ printf "\nAll done!\n" # describe action
+elif [[ $BRANCH != "master" ]]; then
+ printf "\nThis script must be run off the master branch.\n"
+fi