File: deploy-website.sh

package info (click to toggle)
objenesis 3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,324 kB
  • sloc: java: 3,858; xml: 1,601; sh: 71; makefile: 2
file content (49 lines) | stat: -rwxr-xr-x 1,052 bytes parent folder | download | duplicates (6)
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
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash

function pause {
    echo
    read -p "Press [enter]  to continue"
}

# to exit in case of error
set -e

# make sure the script is launched from the project root directory
if [ "$(dirname $0)" != "." ]; then
    echo "The script should be launched from Objenesis root directory"
    exit 1
fi

# clone the website branch
echo "************** CLONE ************************"
git clone --depth=1 --branch gh-pages git@github.com:easymock/objenesis.git site

pushd site

# delete all none hidden directories (keep .git for instance)
ls -1 | xargs rm -rf

# compile de new website
pushd ../website
mvn clean package
popd

# copy the new site to the branch
cp -R ../website/target/xsite/* .

# to help debugging in case of issue
echo "************** STATUS************************"
git status

# push the site
echo "************** COMMIT ***********************"
git add --ignore-removal .
git commit -m "from master $(git log | head -n 1)"

pause
echo "************** PUSH ************************"
git push origin gh-pages

popd

rm -rf site