Skip to content

Commit

Permalink
feat (deploy) : ajout du script shell de déploiement
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdi committed Oct 20, 2015
1 parent 58d4c25 commit 31309f0
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions deploy_website.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

set -ex

REPO="[email protected]:mslimani/smoothy.git"
GROUP_ID="mslimani"
ARTIFACT_ID="smoothy"

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

# 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

0 comments on commit 31309f0

Please sign in to comment.