forked from cdnjs/cdnjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto-update.sh
executable file
·37 lines (31 loc) · 855 Bytes
/
auto-update.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
#!/bin/sh
# Exit if any errors
set -e
cd /root/cdnjs
echo Getting latest libraries
git add .
git diff --quiet --exit-code --cached || git commit -m 'bla'
ls
git pull --rebase origin master
git rebase master
echo npm install for good measure
/usr/local/bin/npm install
/usr/local/bin/npm install -g vows
echo Starting auto update script
/usr/local/bin/node auto-update.js run >> node.log
echo Starting npm test
/usr/local/bin/npm test
if [ "$?" != 0 ]; then
echo Something wrong, force exit.
exit 1
fi
git add .
git diff --quiet --exit-code --cached || git commit -am "Updated packages via NPM auto-update.js"
echo Pushing new versionis if there is a real changing
git push origin autoupdate
#if [ "`git diff -w`" != "" ]; then
# git add .
# git commit -am "Updated packages via auto-update.js"
# git pull --rebase
# git push
#fi