-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.sh
37 lines (32 loc) · 860 Bytes
/
make.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
# Require: GitHub[User/Email/Key]
# Repo/Branch
#NOTE: Key means GitHub API Personal Access Key
gitConfig() { # (user, email)
git config --global push.default matching
git config --global user.name "$1"
git config --global user.email "$2"
}
gitInitPull() { # (repo, branch, key)
git init
git remote add origin https://$3@github.com/$1
git pull origin $2
}
gitPushPwdToBranch() { # (branch, message)
git add --all .
git commit -m "$2"
git push --quiet --force origin HEAD:$1
}
# Run build in build/, move results back
deploy() {
mkdir build; pushd build
gitConfig ${GitHubUser} ${GitHubEmail}
pushd ..; runBuildTo build; popd
gitInitPull ${Repo} ${Branch} ${GitHubKey}
gitPushPwdToBranch ${Branch} "Automatic build by Travis CI"
popd; rm -rf build
}
runBuildTo() { # (destination)
tsc; webpack
mv dist/* $1
mv *.md $1
}