Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
dwillcocks committed Apr 18, 2021
0 parents commit 3b84b51
Show file tree
Hide file tree
Showing 24 changed files with 12,205 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
proto/
dist/
make.sh
README.md
.gitignore
Binary file added .docs/assets/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .docs/assets/sample.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: pull_request

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Lint
uses: golangci/golangci-lint-action@v2
with:
skip-go-installation: true

- name: Build
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --snapshot --rm-dist
35 changes: 35 additions & 0 deletions .github/workflows/readme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Push README to Docker Hub

on:
push:
branches:
- main
paths:
- README.md
- .github/workflows/readme.yaml

env:
dockerpushrm_version: "1.7.0"

jobs:
PushContainerReadme:
runs-on: ubuntu-latest
name: Push README to Docker Hub
steps:
- name: git checkout
uses: actions/checkout@v2

- name: Login DockerHub
id: dockerLogin
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_BOT_USERNAME }}
password: ${{ secrets.DOCKERHUB_BOT_TOKEN }}

- name: push README to Dockerhub
run: |
wget https://github.com/christian-korneck/docker-pushrm/releases/download/v${dockerpushrm_version}/docker-pushrm_linux_amd64
mkdir -p $HOME/.docker/cli-plugins/
mv docker-pushrm_linux_amd64 $HOME/.docker/cli-plugins/docker-pushrm
chmod +x $HOME/.docker/cli-plugins/docker-pushrm
docker pushrm danopstech/starlink_exporter --file "./README.md" --short "${{ github.event.repository.description }}"
72 changes: 72 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: goreleaser

on:
push:
tags:
- v*

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Slack Start Report
uses: act10ns/slack@v1
if: always()
with:
status: starting
channel: '#github-actions'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TOKEN }}

- name: Checkout
id: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Login DockerHub
id: dockerLogin
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_BOT_USERNAME }}
password: ${{ secrets.DOCKERHUB_BOT_TOKEN }}

- name: Login Github Container Registry
id: githubContainerRegistryLogin
uses: docker/login-action@v1
with:
registry: "ghcr.io"
username: "danopstech"
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Go
id: installGo
uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Lint
id: lint
uses: golangci/golangci-lint-action@v2
with:
skip-go-installation: true

- name: Create Release
id: createRelease
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Slack Finish Report
uses: act10ns/slack@v1
if: always()
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: '#github-actions'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TOKEN }}

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
proto/
dist/
make.sh
.idea/
36 changes: 36 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
project_name: starlink_exporter

before:
hooks:
- go mod tidy
- go test ./...
builds:
- main: ./cmd/starlink_exporter/main.go
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
archives:
-
name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}"
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip
files:
- none*
dockers:
- image_templates:
- ghcr.io/danopstech/{{.ProjectName}}:latest
- ghcr.io/danopstech/{{.ProjectName}}:{{ .Tag }}
- danopstech/{{.ProjectName}}:latest
- danopstech/{{.ProjectName}}:{{ .Tag }}
checksum:
name_template: 'checksums.txt'
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM gcr.io/distroless/static
ENTRYPOINT ["/starlink_exporter"]
COPY starlink_exporter /
Loading

0 comments on commit 3b84b51

Please sign in to comment.