forked from square/retrofit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c77d068
commit 0bc5629
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
REPO="[email protected]:square/retrofit.git" | ||
GROUP_ID="com.squareup.retrofit" | ||
ARTIFACT_ID="retrofit" | ||
|
||
DIR=temp-clone | ||
|
||
# Delete any existing temporary website clone | ||
rm -rf $DIR | ||
|
||
# Clone the current repo into temp folder | ||
git clone $REPO $DIR | ||
|
||
# Move working directory into temp folder | ||
cd $DIR | ||
|
||
# Checkout and track the gh-pages branch | ||
git checkout -t origin/gh-pages | ||
|
||
# Delete everything | ||
rm -rf * | ||
|
||
# Copy website files from real repo | ||
cp -R ../website/* . | ||
|
||
# Download the latest javadoc | ||
curl -L "http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=$GROUP_ID&a=$ARTIFACT_ID&v=LATEST&c=javadoc" > javadoc.zip | ||
mkdir javadoc | ||
unzip javadoc.zip -d javadoc | ||
rm javadoc.zip | ||
|
||
exit 0 | ||
|
||
# Stage all files in git and create a commit | ||
git add . | ||
git add -u | ||
git commit -m "Website at $(date)" | ||
|
||
# Push the new files up to GitHub | ||
git push origin gh-pages | ||
|
||
# Delete our temp folder | ||
cd .. | ||
rm -rf $DIR |