forked from SanderRonde/CustomRightClickMenu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
63 lines (47 loc) · 1.6 KB
/
build.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
set -e
http-server -p 1234 . -s &
echo "Build tests" && echo -en "travis_fold:start:build_tests\\r"
grunt testBuild
echo -en "travis_fold:end:build_tests\\r"
echo "Unit tests" && echo -en "travis_fold:start:unit_tests\\r"
mocha test/test.js
echo -en "travis_fold:end:unit_tests\\r"
echo "UI Tests for old browser" && echo -en "travis_fold:start:ui_tests.1\\r"
mocha test/UITest.js
echo -en "travis_fold:end:ui_tests.1\\r"
echo "UI Tests for new browser" && echo -en "travis_fold:start:ui_tests.2\\r"
cp test/UITest.js test/UITest-1.js
mocha test/UITest-1.js
rm test/UITest-1.js
echo -en "travis_fold:end:ui_tests.2\\r"
if [ "$TRAVIS_BRANCH" = "master" ]; then
echo "Changing branches"
echo "Pushing to gh-pages" && echo -en "travis_fold:start:gh_pages\\r"
grunt documentationWebsite
grunt demoWebsite
git config user.name "Travis CI"
git config user.email "[email protected]"
git config --global push.default simple
git remote set-branches --add origin gh-pages
git fetch
git reset --hard
git checkout -b gh-pages
echo "Changed branches"
npm install
grunt moveDocumentationWebsite
set +e
git diff-index --quiet HEAD
echo "Committing changes"
git add -A .
git commit -m "Deploy to Github Pages" --quiet
echo "Committed changes"
echo "Pushing changes"
if [ $? -ne 0 ] ; then #Something went wrong committing, don't push
echo "Faulty commit, abort push"
exit 0
fi
git push "https://${GITHUB_ACCESS_TOKEN}@github.com/SanderRonde/CustomRightClickMenu.git" --force --quiet
echo "Pushed github pages to branch"
echo -en "travis_fold:end:gh_pages\\r"
fi