Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Commit

Permalink
replace travis with circle
Browse files Browse the repository at this point in the history
  • Loading branch information
jakesylvestre committed Feb 9, 2020
2 parents 3451e2c + 264f6ba commit a38df10
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 31 deletions.
58 changes: 58 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
workflows:
version: 2
commit:
jobs:
- release

jobs:
release:
machine:
image: ubuntu-1604:201903-01
steps:
- add_ssh_keys:
fingerprints:
- "8f:6b:bb:e6:82:aa:7c:39:df:c2:d1:28:82:1b:f6:54"
- checkout
- run:
name: setup git
command: git branch --set-upstream-to origin $CIRCLE_BRANCH
- run:
name: Identify myself
command: |
git config --global user.email "service+oss@entropy.engineer" && \
git config --global user.name "Service User"
- run:
name: go fmt
command: |
export WORKPATH=/go/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
docker run --entrypoint "/usr/local/go/bin/go" -v $PWD:$WORKPATH -w $WORKPATH goreleaser/goreleaser mod tidy
docker run --entrypoint "/usr/local/go/bin/go" -v $PWD:$WORKPATH -w $WORKPATH goreleaser/goreleaser fmt ./...
docker run --entrypoint "/usr/local/go/bin/go" -v $PWD:$WORKPATH -w $WORKPATH goreleaser/goreleaser mod vendor
- run:
name: Tidy up
command: |
git add -A
git commit -m "[ci skip] go mod tidy/gofmt" || true
git push origin HEAD
- run:
name: Get git version
command: |
docker pull gittools/gitversion:latest-linux-netcoreapp2.1 && \
docker run --rm -v "$(pwd):/repo" gittools/gitversion:latest-linux-netcoreapp2.1 /repo > out.version
- run:
name: Tag release
command: |
git tag $(jq -r '.NuGetVersion' out.version) -m "release" || true
git tag v$(jq -r '.NuGetVersion' out.version) -m "release" || true
rm -rf out.version
- run:
name: Go release
command: |
docker run -v /var/run/docker.sock:/var/run/docker.sock -v $PWD:/go/src/github.com/xplorfin/$CIRCLE_PROJECT_NAME -w /go/src/github.com/xplorfin/$CIRCLE_PROJECT_NAME -e CIRCLE_PROJECT_REPONAME -e GITHUB_TOKEN -e DOCKER_USERNAME -e DOCKER_PASSWORD -e DOCKER_REGISTRY goreleaser/goreleaser release --rm-dist
- run:
name: Push tag
command: |
git pull
git push --tags || true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor/
101 changes: 101 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
project_name: ganalytics
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- 386
- amd64
- arm
- arm64
ignore:
- goos: darwin
goarch: 386
checksum:
name_template: '{{ .ProjectName }}_checksums.txt'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- Merge pull request
- Merge branch
dockers:
- image_templates:
- 'docker.pkg.github.com/xplorfin/googleanalytics_exporter/googleanalytics_exporter:{{ .Tag }}'
- 'docker.pkg.github.com/xplorfin/googleanalytics_exporter/googleanalytics_exporter:v{{ .Major }}.{{ .Minor }}'
- 'docker.pkg.github.com/xplorfin/googleanalytics_exporter/googleanalytics_exporter:latest'
dockerfile: Dockerfile
binaries:
- ganalytics
goos: linux
goarch: amd64
goarm: ''
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--label=com.github.actions.name={{.ProjectName}}"
- "--label=com.github.actions.description=Prometheus Google Annalytics Exporter"
- "--label=com.github.actions.icon=terminal"
- "--label=com.github.actions.color=blue"
- "--label=repository=http://github.com/ganalytics/ganalytics"
archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip
brews:
- github:
owner: xplorfin
name: homebrewtap-oss
folder: Formula
homepage: https://github.com/xplorfin/googleanalytics_exporter
description: Prometheus Google Analytics Exporter
test: |
system "#{bin}/ganalytics -v"
scoop:
bucket:
owner: xplorfin
name: scoop-bucket-oss
homepage: https://github.com/xplorfin/googleanalytics_exporter
description: Prometheus Google Analytics Exporter
license: MIT
nfpms:
- name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
homepage: https://ganalytics.com
description: Prometheus Google Analytics Exporter
maintainer: Carlos Alexandro Becker <root@carlosbecker.com>
license: MIT
vendor: GoReleaser
formats:
- deb
- rpm
dependencies:
- git
# TODO: ATTENTION: Currently, the provided docker image does not support the generation of snapcraft packages. @goreleaser
#snapcrafts:
# - name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
# summary: Deliver Go binaries as fast and easily as possible
# description: Prometheus Google Analytics Exporter
# grade: stable
# confinement: classic
# publish: true
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LABEL description="Obtains Google Analytics RealTime API metrics, and presents t
RUN apk add --update ca-certificates
ENV APP_PATH /ga
RUN mkdir $APP_PATH
ADD ganalytics $APP_PATH/
COPY ganalytics $APP_PATH/

WORKDIR $APP_PATH
ENTRYPOINT $APP_PATH"/ganalytics"
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[![Build Status](https://travis-ci.org/paha/googleanalytics_exporter.svg?branch=master)](https://travis-ci.org/paha/googleanalytics_exporter)
[![Go Report Card](https://goreportcard.com/badge/github.com/paha/googleanalytics_exporter)](https://goreportcard.com/report/github.com/paha/googleanalytics_exporter)
[![Docker Repository on Quay](https://quay.io/repository/paha/ga-prom/status "Docker Repository on Quay")](https://quay.io/repository/paha/ga-prom)
[![CircleCI](https://circleci.com/gh/xplorfin/googleanalytics_exporter.svg?style=svg)](https://circleci.com/gh/xplorfin/googleanalytics_exporter)
[![Go Report Card](https://goreportcard.com/badge/github.com/xplorfin/googleanalytics_exporter)](https://goreportcard.com/report/github.com/xplorfin/googleanalytics_exporter)

# Google Real Time Analytics to Prometheus

Expand Down

0 comments on commit a38df10

Please sign in to comment.