travis builds

pull/10/head
Hunter Long 2018-06-30 21:42:14 -07:00
parent c20cde567e
commit cdbdcc1dbf
2 changed files with 30 additions and 25 deletions

View File

@ -1,32 +1,37 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# update homebrew to newest version by building on travis # update homebrew to newest version by building on travis
body='{ #body='{
"request": { # "request": {
"branch":"master", # "branch":"master",
"config": { # "config": {
"merge_mode": "merge", # "merge_mode": "merge",
"env": { # "env": {
"VERSION": "'"$VERSION"'" # "VERSION": "'"$VERSION"'"
} # }
} # }
} # }
}' #}'
curl -s -X POST \ #curl -s -X POST \
-H "Content-Type: application/json" \ # -H "Content-Type: application/json" \
-H "Accept: application/json" \ # -H "Accept: application/json" \
-H "Travis-API-Version: 3" \ # -H "Travis-API-Version: 3" \
-H "Authorization: token $TRAVIS_API" \ # -H "Authorization: token $TRAVIS_API" \
-d "$body" \ # -d "$body" \
https://api.travis-ci.com/repo/hunterlong%2Fhomebrew-statup/requests # https://api.travis-ci.com/repo/hunterlong%2Fhomebrew-statup/requests
git clone https://$GH_USER:$GH_TOKEN@github.com/hunterlong/homebrew-statup.git
cd homebrew-statup
./build.sh
cd ../
docker login -u $DOCKER_USER -p $DOCKER_PASS $DOCKER_URL docker login -u $DOCKER_USER -p $DOCKER_PASS $DOCKER_URL
docker build -t $DOCKER_URL/hunterlong/statup . docker build -t $DOCKER_URL/hunterlong/statup .
docker push $DOCKER_URL/hunterlong/statup docker push $DOCKER_URL/hunterlong/statup
#if [ "$TRAVIS_BRANCH" == "master" ] if [ "$TRAVIS_BRANCH" != "master" ]
#then then
# curl -X POST $DOCKER > /dev/null curl -X POST $DOCKER > /dev/null
#else fi
# curl -H "Content-Type: application/json" --data '{"source_type": "Tag", "source_name": "v'"$VERSION"'"}' -X POST $DOCKER > /dev/null
#fi

View File

@ -110,7 +110,7 @@ func (s *Service) SmallText() string {
hits, _ := s.LimitedHits() hits, _ := s.LimitedHits()
if !s.Online { if !s.Online {
if len(last) > 0 { if len(last) > 0 {
return fmt.Sprintf("%v at %v", last[0].ParseError(), last[0].CreatedAt.Format("Monday 3:04PM, Jan _2 2006")) return fmt.Sprintf("%v on %v", last[0].ParseError(), last[0].CreatedAt.Format("Monday 3:04PM, Jan _2 2006"))
} else { } else {
return fmt.Sprintf("%v is currently offline", s.Name) return fmt.Sprintf("%v is currently offline", s.Name)
} }