-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·59 lines (45 loc) · 1.23 KB
/
deploy.sh
File metadata and controls
executable file
·59 lines (45 loc) · 1.23 KB
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
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env bash
#
# Build and deploy jeky site..
#
echo "git checkout dev"
git checkout dev
echo "Building site..."
rm -rf _site/
jekyll build
echo "Backup .gitmodules & .gitignore"
cp .gitmodules .gitmodules.backup
cp .gitignore .gitignore.backup
echo "git checkout master"
git checkout master
echo "Committing files..."
echo "Save site and submodules"
mv ./_site ./._site
mv ./photos ./.photos
echo "Delete existing files"
rm -rf *
git rm -r *
echo "Add files"
mv ./._site ./_site
mv _site/* ./
rm -rf _site/
echo "Add photos"
rm -rf ./photos
mv ./.photos ./photos
echo "Add .gitmodules & .gitignore"
cp .gitmodules.backup .gitmodules
cp .gitignore.backup .gitignore
rm .gitmodules.backup .gitignore.backup
echo "git add website"
git add ./ ./photos ./.gitmodules
echo "Commit and push"
git commit -m "Release $(date +%b_%d_%G_%Hh%Mm%Ss)"
git push
echo "git checkout dev"
git checkout dev
# Not required anymore..
# git rm --ignore-unmatch $(git ls-files --deleted) ./._.inva.lid_78.${RANDOM}.99
# Sample command to add submodules:
# git submodule add git@github.com:rohit01/photos-endurance-to-nandi-hills.git photos/album/endurance-to-nandi-hills
# Easy way pull latest of all submodules..
# git submodule update --recursive --remote