Skip to content

Commit

Permalink
Update CI config to include a release stage to publish github binaries
Browse files Browse the repository at this point in the history
Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com>
  • Loading branch information
jesusvazquez committed Dec 22, 2022
1 parent e400281 commit 20d1ca1
Show file tree
Hide file tree
Showing 4 changed files with 6,194 additions and 186 deletions.
63 changes: 44 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,38 @@
version: 2
version: 2.1
workflows:
pr_acceptance:
jobs:
- test
- build
build_accept_deploy:
jobs:
- test
- build
- package:
requires:
- build
- deploy:
requires:
- test
- build
- package
publish_release:
jobs:
- test:
filters:
branches:
ignore: /.*/
tags:
only: /v[0-9]+(\.[0-9]+)*(-.*)*/
- github_binaries:
requires:
- test
filters:
branches:
ignore: /.*/
tags:
only: /v[0-9]+(\.[0-9]+)*(-.*)*/

jobs:
test:
working_directory: /home/circleci/go/src/github.com/grafana/carbon-relay-ng
Expand Down Expand Up @@ -96,21 +130,12 @@ jobs:
docker push grafana/carbon-relay-ng:$tag
fi
workflows:
version: 2
pr_acceptance:
jobs:
- test
- build
build_accept_deploy:
jobs:
- test
- build
- package:
requires:
- build
- deploy:
requires:
- test
- build
- package
github_binaries:
docker:
- image: cimg/go:1.18
steps:
- checkout
- run: curl -sfL https://goreleaser.com/static/run | bash
# For dry runs use the following and comment the above
# - run: curl -sfL https://goreleaser.com/static/run | bash -s -- --rm-dist --skip-publish --snapshot
20 changes: 10 additions & 10 deletions go-whisper/whisper.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ func parseRetentionPart(retentionPart string) (int, error) {
}

/*
Parse a retention definition as you would find in the storage-schemas.conf of a Carbon install.
Note that this only parses a single retention definition, if you have multiple definitions (separated by a comma)
you will have to split them yourself.
Parse a retention definition as you would find in the storage-schemas.conf of a Carbon install.
Note that this only parses a single retention definition, if you have multiple definitions (separated by a comma)
you will have to split them yourself.
ParseRetentionDef("10s:14d") Retention{10, 120960}
ParseRetentionDef("10s:14d") Retention{10, 120960}
See: http://graphite.readthedocs.org/en/1.0/config-carbon.html#storage-schemas-conf
See: http://graphite.readthedocs.org/en/1.0/config-carbon.html#storage-schemas-conf
*/
func ParseRetentionDef(retentionDef string) (*Retention, error) {
parts := strings.Split(retentionDef, ":")
Expand Down Expand Up @@ -128,10 +128,10 @@ func validateRetentions(retentions Retentions) error {
}

/*
A retention level.
A retention level.
Retention levels describe a given archive in the database. How detailed it is and how far back
it records.
Retention levels describe a given archive in the database. How detailed it is and how far back
it records.
*/
type Retention struct {
secondsPerPoint int
Expand Down Expand Up @@ -178,8 +178,8 @@ func (r retentionsByPrecision) Less(i, j int) bool {
}

/*
Implementation of modulo that works like Python
Thanks @timmow for this
Implementation of modulo that works like Python
Thanks @timmow for this
*/
func mod(a, b int) int {
return a - (b * int(math.Floor(float64(a)/float64(b))))
Expand Down
6,270 changes: 6,127 additions & 143 deletions ui/web/bindata.go

Large diffs are not rendered by default.

27 changes: 13 additions & 14 deletions ui/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,21 +266,20 @@ func parseRewriterRequest(r *http.Request) (rewriter.RW, *handlerError) {
return rw, nil
}

/*
needs updating, but using what api?
func updateRoute(w http.ResponseWriter, r *http.Request) (interface{}, *handlerError) {
payload, err := parseRouteRequest(r)
if err != nil {
return nil, err
}
e := routes.Update(payload.Key, &payload.Addr, &payload.Patt)
if e != nil {
return nil, &handlerError{e, "Could not update route (" + e.Error() + ")", http.StatusBadRequest}
}
return routes.Map[payload.Key], nil
/* needs updating, but using what api?
func updateRoute(w http.ResponseWriter, r *http.Request) (interface{}, *handlerError) {
payload, err := parseRouteRequest(r)
if err != nil {
return nil, err
}
e := routes.Update(payload.Key, &payload.Addr, &payload.Patt)
if e != nil {
return nil, &handlerError{e, "Could not update route (" + e.Error() + ")", http.StatusBadRequest}
}
return routes.Map[payload.Key], nil
}
*/
func addAggregate(w http.ResponseWriter, r *http.Request) (interface{}, *handlerError) {
aggregate, err := parseAggregateRequest(r)
Expand Down

0 comments on commit 20d1ca1

Please sign in to comment.