diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..bbf2e89 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,67 @@ +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 2 + +before: + hooks: + - go mod tidy + +gitea_urls: + api: https://codeberg.org/api/v1 + download: https://codeberg.org + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - freebsd + +archives: + - formats: [tar.gz] + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }}_{{ .Tag }} + # use zip for windows archives + format_overrides: + - goos: windows + formats: [zip] + - goos: linux + formats: [tar.gz,binary] + files: + - src: "*.md" + strip_parent: true + - src: "docs/*" + strip_parent: true + - src: Makefile.dist + dst: Makefile + wrap_in_directory: true + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" + groups: + - title: Improved + regexp: '^.*?(feat|add|new)(\([[:word:]]+\))??!?:.+$' + order: 0 + - title: Fixed + regexp: '^.*?(bug|fix)(\([[:word:]]+\))??!?:.+$' + order: 1 + - title: Changed + order: 999 + +release: + header: "# Release Notes" + footer: >- + + --- + + Full Changelog: [{{ .PreviousTag }}...{{ .Tag }}](https://codeberg.org/scip/io-exporter/compare/{{ .PreviousTag }}...{{ .Tag }}) diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml new file mode 100644 index 0000000..d370fc9 --- /dev/null +++ b/.woodpecker/build.yaml @@ -0,0 +1,27 @@ +matrix: + platform: + - linux/amd64 + goversion: + - 1.24 + +labels: + platform: ${platform} + +steps: + build: + when: + event: [push] + image: golang:${goversion} + commands: + - go get + - go build + - go test + + linter: + when: + event: [push] + image: golang:${goversion} + commands: + - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.5.0 + - golangci-lint --version + - golangci-lint run ./... diff --git a/.woodpecker/image.yaml b/.woodpecker/image.yaml new file mode 100644 index 0000000..b06ebd1 --- /dev/null +++ b/.woodpecker/image.yaml @@ -0,0 +1,32 @@ +# https://woodpecker-ci.org/plugins/docker-buildx +# enable Package unit and go to /scip/-/packages after building to link to proj + +variables: + - &repo codeberg.org/${CI_REPO_OWNER}/io-exporter + +steps: + dryrun: + image: docker.io/woodpeckerci/plugin-docker-buildx:latest + settings: + dockerfile: Dockerfile + platforms: linux/amd64 + dry_run: true + repo: *repo + tags: latest + when: + event: [pull_request] + + publish: + image: docker.io/woodpeckerci/plugin-docker-buildx:latest + settings: + dockerfile: Dockerfile + platforms: linux/amd64 + repo: *repo + registry: codeberg.org + tags: latest,${CI_COMMIT_SHA:0:8},${CI_COMMIT_TAG} + username: ${CI_REPO_OWNER} + password: + from_secret: REGISTRY_TOKEN + when: + event: [tag] + branch: main diff --git a/.woodpecker/release.yaml b/.woodpecker/release.yaml new file mode 100644 index 0000000..916c008 --- /dev/null +++ b/.woodpecker/release.yaml @@ -0,0 +1,15 @@ +# build release + +labels: + platform: linux/amd64 + +steps: + goreleaser: + image: goreleaser/goreleaser + when: + event: [tag] + environment: + GITEA_TOKEN: + from_secret: DEPLOY_TOKEN + commands: + - goreleaser release --clean --verbose diff --git a/Dockerfile b/Dockerfile index 98d9379..a931244 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.24-alpine as builder +FROM golang:1.24-alpine AS builder RUN apk update RUN apk upgrade diff --git a/README.md b/README.md index 3cc03d4..565b06b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -[![Actions](https://github.com/tlinden/io-exporter/actions/workflows/ci.yaml/badge.svg)](https://github.com/tlinden/io-exporter/actions) -[![License](https://img.shields.io/badge/license-GPL-blue.svg)](https://github.com/tlinden/io-exporter/blob/master/LICENSE) -[![Go Report Card](https://goreportcard.com/badge/github.com/tlinden/io-exporter)](https://goreportcard.com/report/github.com/tlinden/io-exporter) +[![Actions](https://codeberg.org/scip/io-exporter/actions/workflows/ci.yaml/badge.svg)](https://codeberg.org/scip/io-exporter/actions) +[![License](https://img.shields.io/badge/license-GPL-blue.svg)](https://codeberg.org/scip/io-exporter/raw/branch/master/LICENSE) +[![Go Report Card](https://goreportcard.com/badge/codeberg.org/scip/io-exporter)](https://goreportcard.com/report/codeberg.org/scip/io-exporter) # io-exporter @@ -88,7 +88,7 @@ docker compose run -v ./t:/pvc ioexporter /pvc/testfile Or use the pre-build image: ```default -docker run -u `id -u $USER` -v ./t:/pvc ghcr.io/tlinden/io-exporter:latest /pvc/testfile +docker run -u `id -u $USER` -v ./t:/pvc codeberg.org/scip/io-exporter:latest /pvc/testfile ``` ## Grafana @@ -98,11 +98,11 @@ as a starting point to integrate it into your monitoring setup. It looks like this: -![Screenshot](https://github.com/TLINDEN/io-exporter/blob/main/grafana/screenshot.png) +![Screenshot](https://codeberg.org/scip/io-exporter/raw/branch/main/grafana/screenshot.png) # Report bugs -[Please open an issue](https://github.com/TLINDEN/io-exporter/issues). Thanks! +[Please open an issue](https://codeberg.org/scip/io-exporter/issues). Thanks! # License diff --git a/go.mod b/go.mod index e0b7e5e..261cbae 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/tlinden/io-exporter +module codeberg.org/scip/io-exporter go 1.23.5 diff --git a/main.go b/main.go index 89ee6ff..dfebf24 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,6 @@ package main -import "github.com/tlinden/io-exporter/cmd" +import "codeberg.org/scip/io-exporter/cmd" func main() { cmd.Run()