mirror of https://github.com/statping/statping
include netgo tag during golang build process
parent
96be7f96da
commit
5d66e34e56
|
@ -1,3 +1,6 @@
|
|||
# 0.90.44 (05-25-2020)
|
||||
- Modified Makefile to include "netgo" tag during golang build
|
||||
|
||||
# 0.90.43 (05-21-2020)
|
||||
- Fixed service TLS checkbox form for edit and create
|
||||
- Modified ICMP ping's to use system's "ping" command (doesn't need root access)
|
||||
|
|
6
Makefile
6
Makefile
|
@ -162,13 +162,13 @@ build-win:
|
|||
go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION}" -o releases/statping-windows-386/statping.exe ./cmd
|
||||
|
||||
build-darwin:
|
||||
GO111MODULE="on" GOOS=darwin GOARCH=amd64 go build -a -ldflags "-s -w -X main.VERSION=${VERSION}" -o releases/statping-darwin-amd64/statping --tags "darwin" ./cmd
|
||||
GO111MODULE="on" GOOS=darwin GOARCH=amd64 go build -a -ldflags "-s -w -X main.VERSION=${VERSION}" -o releases/statping-darwin-amd64/statping --tags "netgo darwin" ./cmd
|
||||
|
||||
build-linux:
|
||||
CGO_ENABLED=1 GO111MODULE="on" GOOS=linux GOARCH=amd64 \
|
||||
go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION}" -o releases/statping-linux-amd64/statping --tags "linux" ./cmd
|
||||
go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION}" -o releases/statping-linux-amd64/statping --tags "netgo linux" ./cmd
|
||||
CGO_ENABLED=1 GO111MODULE="on" GOOS=linux GOARCH=386 \
|
||||
go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION}" -o releases/statping-linux-386/statping --tags "linux" ./cmd
|
||||
go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION}" -o releases/statping-linux-386/statping --tags "netgo linux" ./cmd
|
||||
|
||||
build-linux-arm:
|
||||
CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc-6 CXX=arm-linux-gnueabihf-g++-6 GO111MODULE="on" GOOS=linux GOARCH=arm GOARM=7 \
|
||||
|
|
|
@ -114,8 +114,9 @@ func start() {
|
|||
}
|
||||
|
||||
if utils.Params.GetBool("SAMPLE_DATA") {
|
||||
log.Infoln("Adding Sample Data")
|
||||
if err := configs.TriggerSamples(); err != nil {
|
||||
exit(errors.Wrap(err, "error creating database"))
|
||||
exit(errors.Wrap(err, "error adding sample data"))
|
||||
}
|
||||
} else {
|
||||
if err := core.Samples(); err != nil {
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
)
|
||||
|
||||
func Samples() error {
|
||||
log.Infoln("Inserting Sample Checkins...")
|
||||
checkin1 := &Checkin{
|
||||
Name: "Demo Checkin 1",
|
||||
ServiceId: 1,
|
||||
|
@ -31,6 +32,7 @@ func Samples() error {
|
|||
}
|
||||
|
||||
func SamplesChkHits() error {
|
||||
log.Infoln("Inserting Sample Checkins Hits...")
|
||||
checkTime := utils.Now().Add(-3 * time.Minute)
|
||||
|
||||
for i := int64(1); i <= 2; i++ {
|
||||
|
|
|
@ -28,9 +28,8 @@ type Sampler interface {
|
|||
func TriggerSamples() error {
|
||||
return createSamples(
|
||||
core.Samples,
|
||||
//users.Samples,
|
||||
messages.Samples,
|
||||
services.Samples,
|
||||
messages.Samples,
|
||||
checkins.Samples,
|
||||
checkins.SamplesChkHits,
|
||||
failures.Samples,
|
||||
|
|
|
@ -9,10 +9,11 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
log = utils.Log
|
||||
log = utils.Log.WithField("type", "failure")
|
||||
)
|
||||
|
||||
func Samples() error {
|
||||
log.Infoln("Inserting Sample Service Failures...")
|
||||
createdAt := utils.Now().Add(-3 * types.Day)
|
||||
|
||||
for i := int64(1); i <= 4; i++ {
|
||||
|
|
|
@ -3,10 +3,14 @@ package groups
|
|||
import (
|
||||
"github.com/statping/statping/database"
|
||||
"github.com/statping/statping/types/errors"
|
||||
"github.com/statping/statping/utils"
|
||||
"sort"
|
||||
)
|
||||
|
||||
var db database.Database
|
||||
var (
|
||||
db database.Database
|
||||
log = utils.Log.WithField("type", "group")
|
||||
)
|
||||
|
||||
func SetDB(database database.Database) {
|
||||
db = database.Model(&Group{})
|
||||
|
|
|
@ -5,6 +5,7 @@ import (
|
|||
)
|
||||
|
||||
func Samples() error {
|
||||
log.Infoln("Inserting Sample Groups...")
|
||||
group1 := &Group{
|
||||
Name: "Main Services",
|
||||
Public: null.NewNullBool(true),
|
||||
|
|
|
@ -14,6 +14,7 @@ import (
|
|||
var SampleHits = 99900.
|
||||
|
||||
func Samples() error {
|
||||
log.Infoln("Inserting Sample Service Hits...")
|
||||
for i := int64(1); i <= 5; i++ {
|
||||
records := createHitsAt(i)
|
||||
if err := gormbulk.BulkInsert(db.GormDB(), records, db.ChunkSize()); err != nil {
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
package incidents
|
||||
|
||||
import "github.com/statping/statping/database"
|
||||
import (
|
||||
"github.com/statping/statping/database"
|
||||
"github.com/statping/statping/utils"
|
||||
)
|
||||
|
||||
var (
|
||||
db database.Database
|
||||
dbUpdate database.Database
|
||||
log = utils.Log.WithField("type", "service")
|
||||
)
|
||||
|
||||
func SetDB(database database.Database) {
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
)
|
||||
|
||||
func Samples() error {
|
||||
log.Infoln("Inserting Sample Incidents...")
|
||||
incident1 := &Incident{
|
||||
Title: "Github Issues",
|
||||
Description: "There are new features for Statping, if you have any issues please visit the Github Repo.",
|
||||
|
|
|
@ -3,9 +3,13 @@ package messages
|
|||
import (
|
||||
"github.com/statping/statping/database"
|
||||
"github.com/statping/statping/types/errors"
|
||||
"github.com/statping/statping/utils"
|
||||
)
|
||||
|
||||
var db database.Database
|
||||
var (
|
||||
db database.Database
|
||||
log = utils.Log.WithField("type", "message")
|
||||
)
|
||||
|
||||
func SetDB(database database.Database) {
|
||||
db = database.Model(&Message{})
|
||||
|
|
|
@ -5,6 +5,7 @@ import (
|
|||
)
|
||||
|
||||
func Samples() error {
|
||||
log.Infoln("Inserting Sample Messages...")
|
||||
m1 := &Message{
|
||||
Title: "Routine Downtime",
|
||||
Description: "This is an example a upcoming message for a service!",
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
)
|
||||
|
||||
func Samples() error {
|
||||
log.Infoln("Inserting Sample Services...")
|
||||
createdOn := utils.Now().Add(((-24 * 30) * 3) * time.Hour)
|
||||
s1 := &Service{
|
||||
Name: "Google",
|
||||
|
|
|
@ -5,6 +5,7 @@ import (
|
|||
)
|
||||
|
||||
func Samples() error {
|
||||
log.Infoln("Inserting Sample Users...")
|
||||
u2 := &User{
|
||||
Username: "testadmin",
|
||||
Password: "password123",
|
||||
|
|
|
@ -7,15 +7,16 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
Params *viper.Viper
|
||||
Params *viper.Viper
|
||||
configLog = Log.WithField("type", "configs")
|
||||
)
|
||||
|
||||
func InitCLI() {
|
||||
Params = viper.New()
|
||||
Params.AutomaticEnv()
|
||||
setDefaults()
|
||||
Directory = Params.GetString("STATPING_DIR")
|
||||
//Params.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
|
||||
setDefaults()
|
||||
Params.SetConfigName("config")
|
||||
Params.SetConfigType("yml")
|
||||
Params.AddConfigPath(Directory)
|
||||
|
@ -30,16 +31,12 @@ func InitCLI() {
|
|||
}
|
||||
|
||||
func setDefaults() {
|
||||
if Directory == "" {
|
||||
defaultDir, err := os.Getwd()
|
||||
if err != nil {
|
||||
defaultDir = "."
|
||||
}
|
||||
Params.SetDefault("STATPING_DIR", defaultDir)
|
||||
Directory = defaultDir
|
||||
defaultDir, err := os.Getwd()
|
||||
if err != nil {
|
||||
configLog.Errorln(err)
|
||||
defaultDir = "."
|
||||
}
|
||||
Directory = Params.GetString("STATPING_DIR")
|
||||
Params.SetDefault("STATPING_DIR", Directory)
|
||||
Params.SetDefault("STATPING_DIR", defaultDir)
|
||||
Params.SetDefault("GO_ENV", "")
|
||||
Params.SetDefault("DB_CONN", "")
|
||||
Params.SetDefault("DISABLE_LOGS", false)
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.90.43
|
||||
0.90.44
|
||||
|
|
Loading…
Reference in New Issue