pull/429/head
hunterlong 2020-02-25 22:39:54 -08:00
parent b0ce98074e
commit f4b11f0d17
4 changed files with 15 additions and 7 deletions

View File

@ -28,6 +28,10 @@ frontend-build:
# build and push the images to docker hub # build and push the images to docker hub
docker: docker-build-all docker-publish-all docker: docker-build-all docker-publish-all
push-vue:
docker build -t hunterlong/statping:vue .
docker push hunterlong/statping:vue
# test all versions of Statping, golang testing and then cypress UI testing # test all versions of Statping, golang testing and then cypress UI testing
test-all: dev-deps test test-all: dev-deps test

View File

@ -182,12 +182,14 @@ func ExportIndexHTML() []byte {
} }
func updateDisplay() error { func updateDisplay() error {
var err error gitCurrent, err := checkGithubUpdates()
var gitCurrent githubResponse if err != nil {
if gitCurrent, err = checkGithubUpdates(); err != nil {
fmt.Printf("Issue connecting to https://github.com/hunterlong/statping\n%v\n", err) fmt.Printf("Issue connecting to https://github.com/hunterlong/statping\n%v\n", err)
return err return err
} }
if gitCurrent.TagName == "" {
return nil
}
if len(gitCurrent.TagName) < 2 { if len(gitCurrent.TagName) < 2 {
return nil return nil
} }

View File

@ -87,7 +87,7 @@ func main() {
log.Info(fmt.Sprintf("Starting Statping v%v", VERSION)) log.Info(fmt.Sprintf("Starting Statping v%v", VERSION))
updateDisplay() updateDisplay()
_, err = core.LoadConfigFile(utils.Directory) config, err := core.LoadConfigFile(utils.Directory)
if err != nil { if err != nil {
log.Errorln(err) log.Errorln(err)
core.CoreApp.Setup = false core.CoreApp.Setup = false
@ -102,6 +102,9 @@ func main() {
log.Fatalln(err) log.Fatalln(err)
} }
} }
core.CoreApp.Config = config.DbConfig
if err := mainProcess(); err != nil { if err := mainProcess(); err != nil {
log.Fatalln(err) log.Fatalln(err)
os.Exit(2) os.Exit(2)

View File

@ -22,7 +22,6 @@ import (
"github.com/hunterlong/statping/database" "github.com/hunterlong/statping/database"
"github.com/hunterlong/statping/types" "github.com/hunterlong/statping/types"
"github.com/hunterlong/statping/utils" "github.com/hunterlong/statping/utils"
"io/ioutil"
) )
// ErrorResponse is used for HTTP errors to show to User // ErrorResponse is used for HTTP errors to show to User
@ -41,12 +40,12 @@ func LoadConfigFile(directory string) (*DbConfig, error) {
return LoadUsingEnv() return LoadUsingEnv()
} }
log.Debugln("Attempting to read config file at: " + directory + "/config.yml") log.Debugln("Attempting to read config file at: " + directory + "/config.yml")
file, err := ioutil.ReadFile(directory + "/config.yml") file, err := utils.OpenFile(directory + "/config.yml")
if err != nil { if err != nil {
CoreApp.Setup = false CoreApp.Setup = false
return nil, errors.New("config.yml file not found at " + directory + "/config.yml - starting in setup mode") return nil, errors.New("config.yml file not found at " + directory + "/config.yml - starting in setup mode")
} }
err = yaml.Unmarshal(file, &configs) err = yaml.Unmarshal([]byte(file), &configs)
if err != nil { if err != nil {
return nil, err return nil, err
} }