more archs and fixes version

This commit is contained in:
Marvin Steadfast 2020-04-17 13:19:26 +02:00
parent 62a5558be7
commit 5102efe29e
4 changed files with 21 additions and 3 deletions

View File

@ -2,22 +2,27 @@
kind: pipeline kind: pipeline
name: default name: default
type: docker type: docker
steps: steps:
- name: lint - name: lint
image: golangci/golangci-lint:v1.24-alpine image: golangci/golangci-lint:v1.24-alpine
commands: commands:
- apk add --no-cache make - apk add --no-cache make
- make lint - make lint
- name: test - name: test
image: golang:1.14 image: golang:1.14
commands: commands:
- make test - make test
- name: build - name: build
image: golang:1.14 image: golang:1.14
commands: commands:
- (cd /go; go get -v github.com/mitchellh/gox) - (cd /go; go get -v github.com/mitchellh/gox)
- (cd /go; go get -v github.com/vektra/mockery/.../) - (cd /go; go get -v github.com/vektra/mockery/.../)
- make build - make build
- name: docker - name: docker
image: plugins/docker image: plugins/docker
settings: settings:
@ -28,11 +33,18 @@ steps:
from_secret: username from_secret: username
password: password:
from_secret: password from_secret: password
- name: publish to github - name: publish to github
image: plugins/github-release image: plugins/github-release
settings: settings:
api_key: api_key:
from_secret: github_token from_secret: github_token
files: jitsiexporter_linux_amd64 files:
- jitsiexporter_darwin_*
- jitsiexporter_freebsd_*
- jitsiexporter_linux_*
- jitsiexporter_netbsd_*
- jitsiexporter_openbsd_*
- jitsiexporter_windows_*
when: when:
event: tag event: tag

5
.gitignore vendored
View File

@ -1 +1,6 @@
jitsiexporter_darwin_*
jitsiexporter_freebsd_*
jitsiexporter_linux_* jitsiexporter_linux_*
jitsiexporter_netbsd_*
jitsiexporter_openbsd_*
jitsiexporter_windows_*

View File

@ -6,7 +6,7 @@ VERSION ?= $(shell git describe --tags --always --dirty --match=v* 2> /dev/null
build: build:
export GOFLAGS=-mod=vendor ; \ export GOFLAGS=-mod=vendor ; \
go generate ./...; \ go generate ./...; \
CGO_ENABLED=0 gox -osarch="linux/amd64" -mod vendor -ldflags '-extldflags "-static" -X "main.version=${VERSION}"' github.com/xsteadfastx/jitsiexporter/cmd/jitsiexporter CGO_ENABLED=0 gox -mod vendor -ldflags '-extldflags "-static" -X "main.version=${VERSION}"' github.com/xsteadfastx/jitsiexporter/cmd/jitsiexporter
clean: clean:
rm -f jitsiexporter rm -f jitsiexporter

View File

@ -10,8 +10,9 @@ import (
"github.com/xsteadfastx/jitsiexporter" "github.com/xsteadfastx/jitsiexporter"
) )
var version string = "development"
func main() { func main() {
version := "development"
ver := flag.Bool("version", false, "Prints version.") ver := flag.Bool("version", false, "Prints version.")
url := flag.String("url", "", "URL of Jitsi Videobridge Colibri Stats.") url := flag.String("url", "", "URL of Jitsi Videobridge Colibri Stats.")
debug := flag.Bool("debug", false, "Enable debug.") debug := flag.Bool("debug", false, "Enable debug.")