aboutsummaryrefslogtreecommitdiff
path: root/publishJavadoc.sh
blob: c3545c48e60c1e0fdc125fddc016ccb7a6ae814b (plain)
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
#!/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 *

# 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 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 $DIR