Skip to content

Commit b4b71d3

Browse files
Merge branch 'master' into feature/auto-discovery-for-directory-services
2 parents cc4a7d1 + bd6b01e commit b4b71d3

File tree

128 files changed

+2411
-966
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+2411
-966
lines changed

.github/dependabot.yml

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
version: 2
22
updates:
3-
- package-ecosystem: gomod
4-
directory: /
5-
schedule:
6-
interval: weekly
7-
open-pull-requests-limit: 10
8-
groups:
9-
aws-sdk-v2:
10-
patterns:
11-
- "github.com/aws/aws-sdk-go-v2*"
12-
- package-ecosystem: github-actions
13-
directory: /
14-
schedule:
15-
interval: weekly
16-
open-pull-requests-limit: 10
17-
- package-ecosystem: docker
18-
directory: /
19-
schedule:
20-
interval: weekly
21-
open-pull-requests-limit: 10
3+
- package-ecosystem: gomod
4+
directory: /
5+
schedule:
6+
interval: monthly
7+
open-pull-requests-limit: 10
8+
groups:
9+
aws-sdk-v2:
10+
patterns:
11+
- "github.com/aws/aws-sdk-go-v2*"
12+
- package-ecosystem: github-actions
13+
directory: /
14+
schedule:
15+
interval: monthly
16+
open-pull-requests-limit: 10

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Go
2+
3+
on:
4+
pull_request:
5+
workflow_call:
6+
7+
jobs:
8+
build:
9+
name: Build
10+
runs-on: ubuntu-latest
11+
container:
12+
image: quay.io/prometheus/golang-builder:1.23-base
13+
steps:
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
- uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5
16+
- uses: ./.github/promci/actions/setup_environment
17+
- run: make
18+
- run: git diff --exit-code
19+
20+
verify-example-configs:
21+
name: verify
22+
runs-on: ubuntu-latest
23+
container:
24+
image: quay.io/prometheus/golang-builder:1.23-base
25+
steps:
26+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
- run: make build
28+
- name: Verify example configs
29+
run: find ./examples -name "*.yml" -print0 | xargs -0 -I % ./yace verify-config -config.file %
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: Push README to Docker Hub
3+
on:
4+
push:
5+
paths:
6+
- "README.md"
7+
- "README-containers.md"
8+
- ".github/workflows/container_description.yml"
9+
branches: [ main, master ]
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
PushDockerHubReadme:
16+
runs-on: ubuntu-latest
17+
name: Push README to Docker Hub
18+
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
19+
steps:
20+
- name: git checkout
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
- name: Set docker hub repo name
23+
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
24+
- name: Push README to Dockerhub
25+
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
26+
env:
27+
DOCKER_USER: ${{ secrets.DOCKER_HUB_LOGIN }}
28+
DOCKER_PASS: ${{ secrets.DOCKER_HUB_PASSWORD }}
29+
with:
30+
destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
31+
provider: dockerhub
32+
short_description: ${{ env.DOCKER_REPO_NAME }}
33+
# Empty string results in README-containers.md being pushed if it
34+
# exists. Otherwise, README.md is pushed.
35+
readme_file: ''
36+
37+
PushQuayIoReadme:
38+
runs-on: ubuntu-latest
39+
name: Push README to quay.io
40+
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
41+
steps:
42+
- name: git checkout
43+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44+
- name: Set quay.io org name
45+
run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV
46+
- name: Set quay.io repo name
47+
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
48+
- name: Push README to quay.io
49+
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
50+
env:
51+
DOCKER_APIKEY: ${{ secrets.QUAY_IO_API_TOKEN }}
52+
with:
53+
destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
54+
provider: quay
55+
# Empty string results in README-containers.md being pushed if it
56+
# exists. Otherwise, README.md is pushed.
57+
readme_file: ''

.github/workflows/go.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
# This action is synced from https://github.com/prometheus/prometheus
3+
name: golangci-lint
4+
on:
5+
push:
6+
paths:
7+
- "go.sum"
8+
- "go.mod"
9+
- "**.go"
10+
- "scripts/errcheck_excludes.txt"
11+
- ".github/workflows/golangci-lint.yml"
12+
- ".golangci.yml"
13+
pull_request:
14+
15+
permissions: # added using https://github.com/step-security/secure-repo
16+
contents: read
17+
18+
jobs:
19+
golangci:
20+
permissions:
21+
contents: read # for actions/checkout to fetch code
22+
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
23+
name: lint
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
- name: Install Go
29+
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
30+
with:
31+
go-version: 1.23.x
32+
- name: Install snmp_exporter/generator dependencies
33+
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
34+
if: github.repository == 'prometheus/snmp_exporter'
35+
- name: Lint
36+
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
37+
with:
38+
args: --verbose
39+
version: v1.62.0

.github/workflows/push.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@ on: push
33
name: Build and test
44
jobs:
55
buildDockerImage:
6-
name: Build docker image
6+
name: Publish master branch artifacts
77
runs-on: ubuntu-latest
8+
needs: [build, verify]
9+
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
810
steps:
9-
- uses: actions/checkout@v4
10-
- name: Build docker image
11-
run: docker build -t yace --build-arg VERSION=${{github.event.release.tag_name}} .
11+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
12+
- uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5
13+
- uses: ./.github/promci/actions/publish_master
14+
with:
15+
docker_hub_login: ${{ secrets.docker_hub_login }}
16+
docker_hub_password: ${{ secrets.docker_hub_password }}
17+
quay_io_login: ${{ secrets.quay_io_login }}
18+
quay_io_password: ${{ secrets.quay_io_password }}

.github/workflows/release.yml

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,24 @@ name: Publish Docker image and binaries
33
on:
44
push:
55
tags:
6-
- 'v*'
6+
- 'v*'
77

88
jobs:
99
buildDockerImage:
10-
if: github.repository == 'nerdswords/yet-another-cloudwatch-exporter'
11-
name: Build docker image
10+
name: Publish release artefacts
1211
runs-on: ubuntu-latest
12+
needs: [build, verify]
13+
if: |
14+
(*github.repository == 'prometheus-community/yet-another-cloudwatch-exporter')
15+
&&
16+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v.'))
1317
steps:
14-
- uses: actions/checkout@v4
15-
16-
- uses: actions/setup-go@v5
17-
with:
18-
go-version: ^1.23
19-
20-
- name: Set up QEMU
21-
uses: docker/setup-qemu-action@v3
22-
23-
- name: Set up Docker Buildx
24-
uses: docker/setup-buildx-action@v3
25-
26-
- name: Log into docker
27-
env:
28-
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
29-
DOCKER_REGISTRY_URL: ghcr.io
30-
DOCKER_USERNAME: ${{ github.actor }}
31-
run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
32-
33-
- name: Build and Publish docker image
34-
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 .
35-
36-
- name: Build && release binaries
37-
uses: goreleaser/goreleaser-action@v6
38-
env:
39-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40-
with:
41-
args: release --clean
18+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
- uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5
20+
- uses: ./.github/promci/actions/publish_release
21+
with:
22+
docker_hub_login: ${{ secrets.docker_hub_login }}
23+
docker_hub_password: ${{ secrets.docker_hub_password }}
24+
quay_io_login: ${{ secrets.quay_io_login }}
25+
quay_io_password: ${{ secrets.quay_io_password }}
26+
github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
.build
12
yet-another-cloudwatch-exporter
23
!charts/yet-another-cloudwatch-exporter
34
vendor
45
dist
56
/yace
6-
.idea
7+
*.tar.gz

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ linters-settings:
3737
exclude-functions:
3838
- (github.com/go-kit/log.Logger).Log
3939
goimports:
40-
local-prefixes: "github.com/nerdswords/yet-another-cloudwatch-exporter"
40+
local-prefixes: "github.com/prometheus-community/yet-another-cloudwatch-exporter"

.goreleaser.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)