Skip to content

Commit 05ea9f6

Browse files
Merge branch 'main' into patch-8
2 parents 37b8749 + cbf6808 commit 05ea9f6

126 files changed

Lines changed: 5929 additions & 1488 deletions

File tree

Some content is hidden

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

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: /
5+
schedule:
6+
interval: monthly
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: github-actions
9+
directory: /
10+
schedule:
11+
interval: monthly
12+
open-pull-requests-limit: 10

.github/semantic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
targetUrl: "https://github.com/bluecmd/fortigate_exporter/blob/master/CONTRIBUTING.md#pull-request-checklist"
1+
targetUrl: "https://github.com/prometheus-community/fortigate_exporter/blob/master/CONTRIBUTING.md#pull-request-checklist"

.github/workflows/ci.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
branches:
8+
- main
9+
pull_request:
10+
workflow_call:
11+
12+
jobs:
13+
build:
14+
name: Build for common architectures
15+
runs-on: ubuntu-latest
16+
if: |
17+
!(github.event_name == 'push' && github.event.ref == 'refs/heads/main')
18+
&&
19+
!(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
20+
strategy:
21+
matrix:
22+
thread: [ 0, 1, 2 ]
23+
steps:
24+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25+
- uses: prometheus/promci@fc721ff8497a70a93a881cd552b71af7fb3a9d53 # v0.5.4
26+
- uses: ./.github/promci/actions/build
27+
with:
28+
promu_opts: "-p linux/amd64 -p windows/amd64 -p darwin/amd64 -p linux/arm64 -p windows/arm64 -p darwin/arm64"
29+
parallelism: 3
30+
thread: ${{ matrix.thread }}
31+
32+
build_all:
33+
name: Build for all architectures
34+
runs-on: ubuntu-latest
35+
if: |
36+
(github.event_name == 'push' && github.event.ref == 'refs/heads/main')
37+
||
38+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
39+
strategy:
40+
matrix:
41+
thread: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
42+
steps:
43+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
44+
- uses: prometheus/promci@fc721ff8497a70a93a881cd552b71af7fb3a9d53 # v0.5.4
45+
- uses: ./.github/promci/actions/build
46+
with:
47+
parallelism: 12
48+
thread: ${{ matrix.thread }}
49+
50+
verify-example-configs:
51+
name: Verify
52+
runs-on: ubuntu-latest
53+
container:
54+
image: quay.io/prometheus/golang-builder:1.25-base
55+
steps:
56+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
57+
- run: make build
58+
- name: Verify example configs
59+
run: find ./examples -name "*.yml" -print0 | xargs -0 -I % ./yace verify-config -config.file %
60+
61+
publish_main:
62+
name: Publish main branch artifacts
63+
runs-on: ubuntu-latest
64+
needs: [build_all, verify-example-configs]
65+
if: |
66+
(github.repository == 'prometheus-community/fortigate_exporter')
67+
&&
68+
(github.event_name == 'push' && github.event.ref == 'refs/heads/main')
69+
steps:
70+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
71+
- uses: prometheus/promci@fc721ff8497a70a93a881cd552b71af7fb3a9d53 # v0.5.4
72+
- uses: ./.github/promci/actions/publish_main
73+
with:
74+
docker_hub_organization: prometheuscommunity
75+
docker_hub_login: ${{ secrets.docker_hub_login }}
76+
docker_hub_password: ${{ secrets.docker_hub_password }}
77+
quay_io_organization: prometheuscommunity
78+
quay_io_login: ${{ secrets.quay_io_login }}
79+
quay_io_password: ${{ secrets.quay_io_password }}
80+
81+
publish_release:
82+
name: Publish release artifacts
83+
runs-on: ubuntu-latest
84+
needs: [build_all, verify-example-configs]
85+
if: |
86+
(github.repository == 'prometheus-community/fortigate_exporter')
87+
&&
88+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
89+
steps:
90+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
91+
- uses: prometheus/promci@fc721ff8497a70a93a881cd552b71af7fb3a9d53 # v0.5.4
92+
- uses: ./.github/promci/actions/publish_release
93+
with:
94+
docker_hub_organization: prometheuscommunity
95+
docker_hub_login: ${{ secrets.docker_hub_login }}
96+
docker_hub_password: ${{ secrets.docker_hub_password }}
97+
quay_io_organization: prometheuscommunity
98+
quay_io_login: ${{ secrets.quay_io_login }}
99+
quay_io_password: ${{ secrets.quay_io_password }}
100+
github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
with:
23+
persist-credentials: false
24+
- name: Set docker hub repo name
25+
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
26+
- name: Push README to Dockerhub
27+
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
28+
env:
29+
DOCKER_USER: ${{ secrets.DOCKER_HUB_LOGIN }}
30+
DOCKER_PASS: ${{ secrets.DOCKER_HUB_PASSWORD }}
31+
with:
32+
destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
33+
provider: dockerhub
34+
short_description: ${{ env.DOCKER_REPO_NAME }}
35+
# Empty string results in README-containers.md being pushed if it
36+
# exists. Otherwise, README.md is pushed.
37+
readme_file: ''
38+
39+
PushQuayIoReadme:
40+
runs-on: ubuntu-latest
41+
name: Push README to quay.io
42+
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
43+
steps:
44+
- name: git checkout
45+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
46+
with:
47+
persist-credentials: false
48+
- name: Set quay.io org name
49+
run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV
50+
- name: Set quay.io repo name
51+
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
52+
- name: Push README to quay.io
53+
uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1
54+
env:
55+
DOCKER_APIKEY: ${{ secrets.QUAY_IO_API_TOKEN }}
56+
with:
57+
destination_container_repo: ${{ env.DOCKER_REPO_NAME }}
58+
provider: quay
59+
# Empty string results in README-containers.md being pushed if it
60+
# exists. Otherwise, README.md is pushed.
61+
readme_file: ''

.github/workflows/docker.yml

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

.github/workflows/go.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
with:
29+
persist-credentials: false
30+
- name: Install Go
31+
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
32+
with:
33+
go-version: 1.25.x
34+
- name: Install snmp_exporter/generator dependencies
35+
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
36+
if: github.repository == 'prometheus/snmp_exporter'
37+
- name: Get golangci-lint version
38+
id: golangci-lint-version
39+
run: echo "version=$(make print-golangci-lint-version)" >> $GITHUB_OUTPUT
40+
- name: Lint
41+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
42+
with:
43+
args: --verbose
44+
version: ${{ steps.golangci-lint-version.outputs.version }}

.github/workflows/release.yml

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

.gitignore

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
.*.sw?
1+
# Build
2+
/.build
3+
/.release
4+
/.tarballs
25

3-
# IDEs
4-
.idea
5-
6-
# artifacts
7-
target
6+
# Artifacts
87
fortigate_exporter
8+
*.exe
99

1010
# coverage
1111
cover.out

.golangci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
version: "2"
2+
linters:
3+
enable:
4+
- misspell
5+
- modernize
6+
- revive
7+
- sloglint
8+
exclusions:
9+
generated: lax
10+
presets:
11+
- comments
12+
- common-false-positives
13+
- legacy
14+
- std-error-handling
15+
rules:
16+
- linters:
17+
- errcheck
18+
path: _test.go
19+
formatters:
20+
enable:
21+
- gci
22+
- gofumpt
23+
- goimports
24+
exclusions:
25+
generated: lax
26+
settings:
27+
gci:
28+
sections:
29+
- standard
30+
- default
31+
- prefix(github.com/prometheus-community/fortigate_exporter)
32+
gofumpt:
33+
extra-rules: true
34+
goimports:
35+
local-prefixes:
36+
- github.com/prometheus-community/fortigate_exporter

0 commit comments

Comments
 (0)