Skip to content

Commit

Permalink
Merge branch 'master' into feature/auto-discovery-for-directory-services
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiangreco authored Dec 19, 2024
2 parents cc4a7d1 + bd6b01e commit b4b71d3
Show file tree
Hide file tree
Showing 128 changed files with 2,411 additions and 966 deletions.
33 changes: 14 additions & 19 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
version: 2
updates:
- package-ecosystem: gomod
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 10
groups:
aws-sdk-v2:
patterns:
- "github.com/aws/aws-sdk-go-v2*"
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 10
- package-ecosystem: docker
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 10
- package-ecosystem: gomod
directory: /
schedule:
interval: monthly
open-pull-requests-limit: 10
groups:
aws-sdk-v2:
patterns:
- "github.com/aws/aws-sdk-go-v2*"
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
open-pull-requests-limit: 10
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Go

on:
pull_request:
workflow_call:

jobs:
build:
name: Build
runs-on: ubuntu-latest
container:
image: quay.io/prometheus/golang-builder:1.23-base
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5
- uses: ./.github/promci/actions/setup_environment
- run: make
- run: git diff --exit-code

verify-example-configs:
name: verify
runs-on: ubuntu-latest
container:
image: quay.io/prometheus/golang-builder:1.23-base
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: make build
- name: Verify example configs
run: find ./examples -name "*.yml" -print0 | xargs -0 -I % ./yace verify-config -config.file %
57 changes: 57 additions & 0 deletions .github/workflows/container_description.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: Push README to Docker Hub
on:
push:
paths:
- "README.md"
- "README-containers.md"
- ".github/workflows/container_description.yml"
branches: [ main, master ]

permissions:
contents: read

jobs:
PushDockerHubReadme:
runs-on: ubuntu-latest
name: Push README to Docker Hub
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
steps:
- name: git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set docker hub repo name
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
- name: Push README to Dockerhub
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
env:
DOCKER_USER: ${{ secrets.DOCKER_HUB_LOGIN }}
DOCKER_PASS: ${{ secrets.DOCKER_HUB_PASSWORD }}
with:
destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
provider: dockerhub
short_description: ${{ env.DOCKER_REPO_NAME }}
# Empty string results in README-containers.md being pushed if it
# exists. Otherwise, README.md is pushed.
readme_file: ''

PushQuayIoReadme:
runs-on: ubuntu-latest
name: Push README to quay.io
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
steps:
- name: git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set quay.io org name
run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV
- name: Set quay.io repo name
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
- name: Push README to quay.io
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
env:
DOCKER_APIKEY: ${{ secrets.QUAY_IO_API_TOKEN }}
with:
destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
provider: quay
# Empty string results in README-containers.md being pushed if it
# exists. Otherwise, README.md is pushed.
readme_file: ''
61 changes: 0 additions & 61 deletions .github/workflows/go.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
# This action is synced from https://github.com/prometheus/prometheus
name: golangci-lint
on:
push:
paths:
- "go.sum"
- "go.mod"
- "**.go"
- "scripts/errcheck_excludes.txt"
- ".github/workflows/golangci-lint.yml"
- ".golangci.yml"
pull_request:

permissions: # added using https://github.com/step-security/secure-repo
contents: read

jobs:
golangci:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: 1.23.x
- name: Install snmp_exporter/generator dependencies
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
if: github.repository == 'prometheus/snmp_exporter'
- name: Lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
args: --verbose
version: v1.62.0
15 changes: 11 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ on: push
name: Build and test
jobs:
buildDockerImage:
name: Build docker image
name: Publish master branch artifacts
runs-on: ubuntu-latest
needs: [build, verify]
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Build docker image
run: docker build -t yace --build-arg VERSION=${{github.event.release.tag_name}} .
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5
- uses: ./.github/promci/actions/publish_master
with:
docker_hub_login: ${{ secrets.docker_hub_login }}
docker_hub_password: ${{ secrets.docker_hub_password }}
quay_io_login: ${{ secrets.quay_io_login }}
quay_io_password: ${{ secrets.quay_io_password }}
47 changes: 16 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,24 @@ name: Publish Docker image and binaries
on:
push:
tags:
- 'v*'
- 'v*'

jobs:
buildDockerImage:
if: github.repository == 'nerdswords/yet-another-cloudwatch-exporter'
name: Build docker image
name: Publish release artefacts
runs-on: ubuntu-latest
needs: [build, verify]
if: |
(*github.repository == 'prometheus-community/yet-another-cloudwatch-exporter')
&&
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v.'))
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: ^1.23

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log into docker
env:
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
DOCKER_REGISTRY_URL: ghcr.io
DOCKER_USERNAME: ${{ github.actor }}
run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL

- name: Build and Publish docker image
run: docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t ghcr.io/nerdswords/yet-another-cloudwatch-exporter:${{github.ref_name}} --build-arg VERSION=${{github.ref_name}} --push .

- name: Build && release binaries
uses: goreleaser/goreleaser-action@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: release --clean
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5
- uses: ./.github/promci/actions/publish_release
with:
docker_hub_login: ${{ secrets.docker_hub_login }}
docker_hub_password: ${{ secrets.docker_hub_password }}
quay_io_login: ${{ secrets.quay_io_login }}
quay_io_password: ${{ secrets.quay_io_password }}
github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.build
yet-another-cloudwatch-exporter
!charts/yet-another-cloudwatch-exporter
vendor
dist
/yace
.idea
*.tar.gz
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ linters-settings:
exclude-functions:
- (github.com/go-kit/log.Logger).Log
goimports:
local-prefixes: "github.com/nerdswords/yet-another-cloudwatch-exporter"
local-prefixes: "github.com/prometheus-community/yet-another-cloudwatch-exporter"
22 changes: 0 additions & 22 deletions .goreleaser.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .promu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
go:
# This must match .circle/config.yml.
version: 1.23
repository:
path: github.com/prometheus-community/yet-another-cloudwatch-exporter
build:
binaries:
- name: yace
path: ./cmd/yace
ldflags: |
-X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
-X github.com/prometheus/common/version.Branch={{.Branch}}
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
tarball:
files:
- LICENSE
- NOTICE
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

25 changes: 25 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
extends: default
ignore: |
**/node_modules

rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
commas: disable
comments: disable
comments-indentation: disable
document-start: disable
indentation:
spaces: consistent
indent-sequences: consistent
key-duplicates:
ignore: |
config/testdata/section_key_dup.bad.yml
line-length: disable
truthy:
check-keys: false
Loading

0 comments on commit b4b71d3

Please sign in to comment.