pull/10/head
Hunter Long 2018-06-22 01:48:47 -07:00
parent 0ad1bd01be
commit 2f8fbb9d1e
3 changed files with 4 additions and 3 deletions

View File

@ -49,7 +49,7 @@ after_success:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- export REPO=hunterlong/statup
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
- docker build -f Dockerfile -t $REPO:$VERSION .
- docker build -f Dockerfile -t $REPO:$TAG .
- docker tag $REPO:$COMMIT $REPO:$TAG
- docker tag $REPO:$COMMIT $REPO:$VERSION
- docker push $REPO

View File

@ -146,10 +146,11 @@ func (u *Service) Update() {
func (u *Service) Create() (int64, error) {
u.CreatedAt = time.Now()
uuid, err := serviceCol().Insert(u)
services, _ = SelectAllServices()
if uuid == nil {
return 0, err
}
u.Id = uuid.(int64)
services = append(services, u)
OnNewService(u)
return uuid.(int64), err
}

2
web.go
View File

@ -132,7 +132,7 @@ func CreateServiceHandler(w http.ResponseWriter, r *http.Request) {
port, _ := strconv.Atoi(r.PostForm.Get("port"))
checkType := r.PostForm.Get("check_type")
service := Service{
service := &Service{
Name: name,
Domain: domain,
Method: method,