Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
utkuozdemir committed Jun 8, 2021
0 parents commit ac29e33
Show file tree
Hide file tree
Showing 8 changed files with 1,610 additions and 0 deletions.
145 changes: 145 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# Created by https://www.toptal.com/developers/gitignore/api/go,macos,jetbrains+all
# Edit at https://www.toptal.com/developers/gitignore?templates=go,macos,jetbrains+all

### Go ###
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

### Go Patch ###
/vendor/
/Godeps/

### JetBrains+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### JetBrains+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360

.idea/

# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023

*.iml
modules.xml
.idea/misc.xml
*.ipr

# Sonarlint plugin
.idea/sonarlint

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# End of https://www.toptal.com/developers/gitignore/api/go,macos,jetbrains+all

/dist
95 changes: 95 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
before:
hooks:
- go mod download

builds:
- id: nvidia-gpu-exporter
main: ./cmd/nvidia-gpu-exporter
binary: nvidia-gpu-exporter
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm
- arm64
goarm:
- 7
ignore:
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
- goos: darwin
goarch: arm
- goos: darwin
goarch: arm64

archives:
- id: nvidia-gpu-exporter-archive
builds:
- nvidia-gpu-exporter
replacements:
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip
files:
- LICENSE

checksum:
name_template: checksums.txt
algorithm: sha256

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- '^cicd:'
- '^refactor:'
- '^docker:'
- Merge pull request
- Merge branch
- go mod tidy

dockers:
- image_templates:
- docker.io/utkuozdemir/nvidia-gpu-exporter:{{ .Version }}-amd64
use_buildx: true
dockerfile: Dockerfile
build_flag_templates:
- --platform=linux/amd64
- image_templates:
- docker.io/utkuozdemir/nvidia-gpu-exporter:{{ .Version }}-arm64
use_buildx: true
goarch: arm64
dockerfile: Dockerfile
build_flag_templates:
- --platform=linux/arm64
- image_templates:
- docker.io/utkuozdemir/nvidia-gpu-exporter:{{ .Version }}-armv7
use_buildx: true
goarch: arm
goarm: 7
dockerfile: Dockerfile
build_flag_templates:
- --platform=linux/arm/v7

docker_manifests:
- name_template: docker.io/utkuozdemir/nvidia-gpu-exporter:{{ .Version }}
image_templates:
- docker.io/utkuozdemir/nvidia-gpu-exporter:{{ .Version }}-amd64
- docker.io/utkuozdemir/nvidia-gpu-exporter:{{ .Version }}-arm64
- docker.io/utkuozdemir/nvidia-gpu-exporter:{{ .Version }}-armv7

# To test docker image push, uncomment the following and run
# goreleaser release --skip-validate --rm-dist --debug
#release:
# disable: true
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM alpine:3

RUN apk add --no-cache tini
COPY nvidia-gpu-exporter /usr/local/bin/nvidia-gpu-exporter
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/usr/local/bin/nvidia-gpu-exporter"]
Loading

0 comments on commit ac29e33

Please sign in to comment.