Skip to content

Commit 3b84b51

Browse files
committed
init
0 parents  commit 3b84b51

24 files changed

+12205
-0
lines changed

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
proto/
2+
dist/
3+
make.sh
4+
README.md
5+
.gitignore

.docs/assets/logo.jpg

20.8 KB
Loading

.docs/assets/sample.jpg

275 KB
Loading

.github/workflows/pr.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: pull_request
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
13+
- name: Set up Go
14+
uses: actions/setup-go@v2
15+
with:
16+
go-version: 1.16
17+
18+
- name: Lint
19+
uses: golangci/golangci-lint-action@v2
20+
with:
21+
skip-go-installation: true
22+
23+
- name: Build
24+
uses: goreleaser/goreleaser-action@v2
25+
with:
26+
version: latest
27+
args: release --snapshot --rm-dist

.github/workflows/readme.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Push README to Docker Hub
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- README.md
9+
- .github/workflows/readme.yaml
10+
11+
env:
12+
dockerpushrm_version: "1.7.0"
13+
14+
jobs:
15+
PushContainerReadme:
16+
runs-on: ubuntu-latest
17+
name: Push README to Docker Hub
18+
steps:
19+
- name: git checkout
20+
uses: actions/checkout@v2
21+
22+
- name: Login DockerHub
23+
id: dockerLogin
24+
uses: docker/login-action@v1
25+
with:
26+
username: ${{ secrets.DOCKERHUB_BOT_USERNAME }}
27+
password: ${{ secrets.DOCKERHUB_BOT_TOKEN }}
28+
29+
- name: push README to Dockerhub
30+
run: |
31+
wget https://github.com/christian-korneck/docker-pushrm/releases/download/v${dockerpushrm_version}/docker-pushrm_linux_amd64
32+
mkdir -p $HOME/.docker/cli-plugins/
33+
mv docker-pushrm_linux_amd64 $HOME/.docker/cli-plugins/docker-pushrm
34+
chmod +x $HOME/.docker/cli-plugins/docker-pushrm
35+
docker pushrm danopstech/starlink_exporter --file "./README.md" --short "${{ github.event.repository.description }}"

.github/workflows/release.yaml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
goreleaser:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Slack Start Report
13+
uses: act10ns/slack@v1
14+
if: always()
15+
with:
16+
status: starting
17+
channel: '#github-actions'
18+
env:
19+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TOKEN }}
20+
21+
- name: Checkout
22+
id: checkout
23+
uses: actions/checkout@v2
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Login DockerHub
28+
id: dockerLogin
29+
uses: docker/login-action@v1
30+
with:
31+
username: ${{ secrets.DOCKERHUB_BOT_USERNAME }}
32+
password: ${{ secrets.DOCKERHUB_BOT_TOKEN }}
33+
34+
- name: Login Github Container Registry
35+
id: githubContainerRegistryLogin
36+
uses: docker/login-action@v1
37+
with:
38+
registry: "ghcr.io"
39+
username: "danopstech"
40+
password: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- name: Set up Go
43+
id: installGo
44+
uses: actions/setup-go@v2
45+
with:
46+
go-version: 1.16
47+
48+
- name: Lint
49+
id: lint
50+
uses: golangci/golangci-lint-action@v2
51+
with:
52+
skip-go-installation: true
53+
54+
- name: Create Release
55+
id: createRelease
56+
uses: goreleaser/goreleaser-action@v2
57+
with:
58+
version: latest
59+
args: release --rm-dist
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
63+
- name: Slack Finish Report
64+
uses: act10ns/slack@v1
65+
if: always()
66+
with:
67+
status: ${{ job.status }}
68+
steps: ${{ toJson(steps) }}
69+
channel: '#github-actions'
70+
env:
71+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TOKEN }}
72+

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
proto/
2+
dist/
3+
make.sh
4+
.idea/

.goreleaser.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
project_name: starlink_exporter
2+
3+
before:
4+
hooks:
5+
- go mod tidy
6+
- go test ./...
7+
builds:
8+
- main: ./cmd/starlink_exporter/main.go
9+
env:
10+
- CGO_ENABLED=0
11+
goos:
12+
- linux
13+
- windows
14+
- darwin
15+
archives:
16+
-
17+
name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}"
18+
replacements:
19+
darwin: Darwin
20+
linux: Linux
21+
windows: Windows
22+
386: i386
23+
amd64: x86_64
24+
format_overrides:
25+
- goos: windows
26+
format: zip
27+
files:
28+
- none*
29+
dockers:
30+
- image_templates:
31+
- ghcr.io/danopstech/{{.ProjectName}}:latest
32+
- ghcr.io/danopstech/{{.ProjectName}}:{{ .Tag }}
33+
- danopstech/{{.ProjectName}}:latest
34+
- danopstech/{{.ProjectName}}:{{ .Tag }}
35+
checksum:
36+
name_template: 'checksums.txt'

Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM gcr.io/distroless/static
2+
ENTRYPOINT ["/starlink_exporter"]
3+
COPY starlink_exporter /

0 commit comments

Comments
 (0)