forked from htck/bayeux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·41 lines (37 loc) · 833 Bytes
/
deploy.sh
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
#!/bin/bash
branch=${1:-"master"}
remote=${2:-"https://github.com/htck/bayeux.git"}
echo "Deploying $branch to gh-pages $remote"
git checkout $branch
cd htck
# Update all dependencies
npm cache clean
npm install
bower install
# Build app
grunt build --force
cd ..
# Create dist zip file
cd htck
cp -R dist htck-Bayeux
zip -r htck-Bayeux.zip htck-Bayeux/
mv htck-Bayeux.zip dist/
rm -rf htck-Bayeux
cd ..
######
echo "Creating temporary deployment folder"
rm -rf /tmp/bayeux-ghost
mkdir /tmp/bayeux-ghost
cp -R htck/dist/* /tmp/bayeux-ghost/
cp -R htck/app/images /tmp/bayeux-ghost/
cd /tmp/bayeux-ghost
echo "Initing ghost git"
git init
echo "Add remote $remote"
git remote add origin $remote
git checkout -b gh-pages
rm .gitignore
git add .
git commit -am "Deploying $branch to gh-pages"
git push --force origin gh-pages
######