Skip to content

Commit

Permalink
add dependence
Browse files Browse the repository at this point in the history
  • Loading branch information
duguying committed Aug 16, 2017
1 parent 82c3a61 commit ccf436d
Show file tree
Hide file tree
Showing 209 changed files with 52,170 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/static/deps/* linguist-vendored
*.tpl linguist-vendored
/vendor/* linguist-vendored

3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
language: go
branches:
only:
- master
go:
- tip
script:
Expand Down
136 changes: 136 additions & 0 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Godeps/Readme

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

104 changes: 104 additions & 0 deletions control.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/bin/bash

WORKSPACE=$(cd $(dirname $0)/; pwd)
cd $WORKSPACE

mkdir -p var

app=blog
pidfile=var/app.pid
logfile=var/app.log

function check_pid() {
if [ -f $pidfile ];then
pid=`cat $pidfile`
if [ -n $pid ]; then
running=`ps -p $pid|grep -v "PID TTY" |wc -l`
return $running
fi
fi
return 0
}

function build() {
CGO_ENABLED=0 GOOS=linux go build -v -a -installsuffix cgo -o $app .
rm -rf release
mkdir release
cp blog release/
cp -r static release/
cp -r conf release/
cp -r custom release/
cp -r etc release/
}

function start() {
check_pid
running=$?
if [ $running -gt 0 ];then
echo -n "$app now is running already, pid="
cat $pidfile
return 1
fi


nohup ./$app &>> $logfile &
echo $! > $pidfile
echo "$app started..., pid=$!"
}

function stop() {
pid=`cat $pidfile`
kill $pid
echo "$app stoped..."
}

function restart() {
stop
sleep 1
start
}

function status() {
check_pid
running=$?
if [ $running -gt 0 ];then
echo started
else
echo stoped
fi
}

function tailf() {
tail -f $logfile
}

function pack() {
build
git log -1 --pretty=%h > gitversion
version=`./$app -v`
file_list="public control cfg.example.json $app"
echo "...tar $app-$version.tar.gz <= $file_list"
tar zcf $app-$version.tar.gz gitversion $file_list
}

function help() {
echo "$0 build|start|stop|restart|status|tail"
}

if [ "$1" == "" ]; then
help
elif [ "$1" == "build" ];then
build
elif [ "$1" == "stop" ];then
stop
elif [ "$1" == "start" ];then
start
elif [ "$1" == "restart" ];then
restart
elif [ "$1" == "status" ];then
status
elif [ "$1" == "tail" ];then
tailf
else
help
fi
1 change: 1 addition & 0 deletions vendor/github.com/PuerkitoBio/goquery/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions vendor/github.com/PuerkitoBio/goquery/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions vendor/github.com/PuerkitoBio/goquery/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions vendor/github.com/PuerkitoBio/goquery/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ccf436d

Please sign in to comment.