aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Häggqvist <[email protected]>2018-07-26 23:46:55 +0200
committerVictor Häggqvist <[email protected]>2018-07-26 23:46:55 +0200
commit39fd32f5541eb845844fd3e5269737bdcfcbc3bb (patch)
treedfb2456e03c8b32ea2a66b536941cfd3784565de
parentd329b0bbfaab27e0ef9d925c4902c1f7f7d19ea5 (diff)
deploy docsHEADmaster
-rw-r--r--publishJavadoc.sh44
1 files changed, 35 insertions, 9 deletions
diff --git a/publishJavadoc.sh b/publishJavadoc.sh
index c2f3811..c3545c4 100644
--- a/publishJavadoc.sh
+++ b/publishJavadoc.sh
@@ -1,12 +1,38 @@
-gradle releaseJavadoc
-git clone --branch=gh-pages --single-branch [email protected]:victorhaggqvist/AboutIt.git ghpages
-pushd ghpages
+#!/bin/bash
+
+set -ex
+
+REPO="[email protected]:victorhaggqvist/AboutIt.git"
+GROUP_ID="com.snilius.aboutit"
+ARTIFACT_ID="aboutit"
+
+DIR=temp-clone
+
+# Delete any existing temporary website clone
+rm -rf $DIR
+
+# Clone the current repo into temp folder
+git clone --branch=gh-pages --single-branch $REPO $DIR
+
+# Move working directory into temp folder
+pushd $DIR
+
+# Delete everything
rm -rf *
-popd
-cp -r aboutit/build/docs/javadoc/* ghpages
-pushd ghpages
+
+# Download the latest javadoc
+curl -L "https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=$GROUP_ID&a=$ARTIFACT_ID&v=LATEST&c=javadoc" > javadoc.zip
+unzip javadoc.zip
+rm javadoc.zip
+
+# Stage all files in git and create a commit
git add .
-git commit -m "Update JavaDoc"
-git push --force
+git add -u
+git commit -m "Update JavaDoc at $(date)"
+
+# Push the new files up to GitHub
+git push origin gh-pages
+
+# Delete our temp folder
popd
-rm -rf ghpages \ No newline at end of file
+rm -rf $DIR \ No newline at end of file