Skip to content

Commit

Permalink
.travis.yml: initial implementation
Browse files Browse the repository at this point in the history
- travis: include tools install
- travis.yml: test only the model
- travis: build binaries
- travis: deploy artifacts
- travis: include static compilation
- travis: include different arch executables
- travis: fix output file
- travis: explicit names
- travis: disable windows for now
- travis: output in gopath
- travis: include version
- *: include version
- dep: update
- travis: fix yml
- travis: export variable
- travis: hardcode version flags
- travis only on master and tags
  • Loading branch information
thypon committed Sep 18, 2017
1 parent f6a25cc commit 19ad553
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 6 deletions.
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
language: go
go:
- 1.8
install:
- go get -u github.com/golang/dep/cmd/dep
- dep ensure
script:
- go test -v github.com/Cleafy/promqueen/model
- GOOS=linux GOARCH=386 CGO_ENABLED=0 go build -o "$GOPATH/bin/promrec.elf" -a -ldflags "-extldflags '-static' -X github.com/ropes/go-linker-vars-example/src/version.GitTag=$(git describe --tags) -X github.com/ropes/go-linker-vars-example/src/version.BuildUser=${USER} -X github.com/ropes/go-linker-vars-example/src/version.Version=$(git describe --tags --abbrev=0)" github.com/Cleafy/promqueen/bin/promrec
- GOOS=linux GOARCH=386 CGO_ENABLED=0 go build -o "$GOPATH/bin/promplay.elf" -a -ldflags "-extldflags '-static' -X github.com/ropes/go-linker-vars-example/src/version.GitTag=$(git describe --tags) -X github.com/ropes/go-linker-vars-example/src/version.BuildUser=${USER} -X github.com/ropes/go-linker-vars-example/src/version.Version=$(git describe --tags --abbrev=0)" github.com/Cleafy/promqueen/bin/promplay
- GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -o "$GOPATH/bin/promrec.exe" -a -ldflags "-extldflags '-static' -X github.com/ropes/go-linker-vars-example/src/version.GitTag=$(git describe --tags) -X github.com/ropes/go-linker-vars-example/src/version.BuildUser=${USER} -X github.com/ropes/go-linker-vars-example/src/version.Version=$(git describe --tags --abbrev=0)" github.com/Cleafy/promqueen/bin/promrec
- GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -o "$GOPATH/bin/promplay.exe" -a -ldflags "-extldflags '-static'-X github.com/ropes/go-linker-vars-example/src/version.GitTag=$(git describe --tags) -X github.com/ropes/go-linker-vars-example/src/version.BuildUser=${USER} -X github.com/ropes/go-linker-vars-example/src/version.Version=$(git describe --tags --abbrev=0)" github.com/Cleafy/promqueen/bin/promplay
- GOOS=darwin GOARCH=386 CGO_ENABLED=0 go build -o "$GOPATH/bin/promrec" -a -ldflags "-extldflags '-static' -X github.com/ropes/go-linker-vars-example/src/version.GitTag=$(git describe --tags) -X github.com/ropes/go-linker-vars-example/src/version.BuildUser=${USER} -X github.com/ropes/go-linker-vars-example/src/version.Version=$(git describe --tags --abbrev=0)" github.com/Cleafy/promqueen/bin/promrec
- GOOS=darwin GOARCH=386 CGO_ENABLED=0 go build -o "$GOPATH/bin/promplay" -a -ldflags "-extldflags '-static' -X github.com/ropes/go-linker-vars-example/src/version.GitTag=$(git describe --tags) -X github.com/ropes/go-linker-vars-example/src/version.BuildUser=${USER} -X github.com/ropes/go-linker-vars-example/src/version.Version=$(git describe --tags --abbrev=0)" github.com/Cleafy/promqueen/bin/promplay
deploy:
provider: releases
api_key:
secure: G1FtHnchisi9145HM8gA6v7X+JzKO7kD3dL12OPegMVOVnjE5c73aMDALuqogl0c4N00IAlrMoj1NaddW0xQKYULqG0X3mswVA3Bmgcrl93XKAxCmymzYZSoq1Q2vcehXihmbpZQfl76DPrJwKIYrFWVtJoE9tH3yrkxpsGmTh3YgLtRr1PpCuUE5xFILDwEu1AsIlQeMzLxERkykSSMq2iNtABPsaPKLU0NUmkN4/WM2i/7bzMQE+lYQnZe7p3TjTf7/+9ht9KyHWH49I+6kTDsANMTH+Q6tHZNggBTtSloStCQmm1L7IQkIpYw3gDzVNfNQWuhKwICE0Z8iWX3VFKiolRSC9nfuf6LEaNyFvMhB7wcf+9rF5thZVf+cZVjh7wSGoYPAPvh3ld0vm35uX0B7MA6LjAFNbURpt8no1urNuJirTzyP9H6Ym0KfOCjWLxDtUIDzZZ89zieP1atoaCmP+/4rbS74p0WPp32OnrY6uAym9TQPuHWp7S3Iq9DBOHxHidFEC4pmWJgT4wD5fDQk/g2kleidtcq28sPVrxKUZFyN578z9FIEi80AHkl8bL4iKLFDFsklt8IyWodl6rbx0flFosjVJ1rUr+IDMuFxmnkJbHamg2W5fysbtHplWDpODlDj2KQyYJC4ltZyDe4TS4sGr9wwQKoGNEphWU=
file:
- "$GOPATH/bin/promrec"
- "$GOPATH/bin/promplay"
- "$GOPATH/bin/promrec.elf"
- "$GOPATH/bin/promplay.elf"
- "$GOPATH/bin/promrec.exe"
- "$GOPATH/bin/promplay.exe"
on:
repo: Cleafy/promqueen
branch: master
tags: true
8 changes: 7 additions & 1 deletion Gopkg.lock

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

7 changes: 4 additions & 3 deletions bin/promplay/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ import (
"sort"
"time"

cm "github.com/Cleafy/promqueen/model"
cm "github.com/cleafy/promqueen/model"
"github.com/mattetti/filebuffer"
dto "github.com/prometheus/client_model/go"
"github.com/prometheus/common/expfmt"
"github.com/prometheus/common/log"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/storage/local"
"github.com/ropes/go-linker-vars-example/src/version"
"github.com/sirupsen/logrus"
kingpin "gopkg.in/alecthomas/kingpin.v2"
filetype "gopkg.in/h2non/filetype.v1"
Expand All @@ -38,7 +39,7 @@ var (
nopromcfg = kingpin.Flag("nopromcfg", "Disable the generation of the prometheus cfg file (prometheus.yml)").Bool()
dir = kingpin.Flag("dir", "Input directory.").Short('d').OverrideDefaultFromEnvar("INPUT_DIRECTORY").Default(".").String()
framereader = make(<-chan cm.Frame)
version = "0.0.1"
Version = version.GitTag
cfgMemoryStorage = local.MemorySeriesStorageOptions{
MemoryChunks: 1024,
MaxChunksToPersist: 1024,
Expand Down Expand Up @@ -144,7 +145,7 @@ func updateURLTimestamp(timestamp int64, name string, url string, body io.Reader
}

func main() {
kingpin.Version(version)
kingpin.Version(Version)

kingpin.Flag("storage.path", "Directory path to create and fill the data store under.").Default("data").StringVar(&cfgMemoryStorage.PersistenceStoragePath)
kingpin.Flag("storage.retention-period", "Period of time to store data for").Default("360h").DurationVar(&cfgMemoryStorage.PersistenceRetentionPeriod)
Expand Down
5 changes: 3 additions & 2 deletions bin/promrec/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"time"

"github.com/cleafy/promqueen/model"
"github.com/ropes/go-linker-vars-example/src/version"
"github.com/sirupsen/logrus"
"gopkg.in/alecthomas/kingpin.v2"
)
Expand All @@ -19,7 +20,7 @@ var (
interval = kingpin.Flag("interval", "Timeout waiting for ping.").Default("60s").OverrideDefaultFromEnvar("ACTION_INTERVAL").Short('i').Duration()
umap = kingpin.Flag("umap", "stringmap [eg. service.name=http://get.uri:port/uri].").Short('u').StringMap()
output = kingpin.Flag("output", "Output file.").Short('o').OverrideDefaultFromEnvar("OUTPUT_FILE").Default("metrics").String()
version = "0.0.1"
Version = version.GitTag
filewriter io.WriteCloser
)

Expand Down Expand Up @@ -50,7 +51,7 @@ func writerFor() (io.Writer, error) {
}

func main() {
kingpin.Version(version)
kingpin.Version(Version)
kingpin.Parse()

if *debug {
Expand Down

0 comments on commit 19ad553

Please sign in to comment.