Skip to content

Commit b9fc18e

Browse files
authored
Merge pull request #41 from raffis/release-v1.0
Release v1.0.0
2 parents 2b3344d + b5a7400 commit b9fc18e

Some content is hidden

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

50 files changed

+2483
-741
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ A clear and concise description of what you expected to happen.
1919
#### Environment
2020
- mongodb-query-exporter version: [e.g. v1.0.0]
2121
- prometheus version: [e.g. v1.0.0]
22-
- MongoDB version: [e.g. v3.4.18]
22+
- MongoDB version: [e.g. v5.0.0]
2323
- Deployed as: [e.g. docker,kubernetes,binary]
2424

2525
#### Additional context

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Current situation
2+
<!--- Shortly describe the current situation -->
3+
4+
## Proposal
5+
<!--- Describe what this PR is intended to achieve -->

.github/workflows/action.yml

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

.github/workflows/chart.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Lint and Test Charts
2+
3+
on: pull_request
4+
5+
jobs:
6+
lint-test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v2
11+
with:
12+
fetch-depth: 0
13+
14+
- name: Set up Helm
15+
uses: azure/setup-helm@v1
16+
with:
17+
version: v3.4.0
18+
19+
- uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.7
22+
23+
- name: Set up chart-testing
24+
uses: helm/chart-testing-action@v2.1.0
25+
26+
- name: Run chart-testing (list-changed)
27+
id: list-changed
28+
run: |
29+
changed=$(ct list-changed --chart-dirs chart)
30+
if [[ -n "$changed" ]]; then
31+
echo "::set-output name=changed::true"
32+
fi
33+
34+
- name: Run chart-testing (lint)
35+
run: ct lint --chart-dirs chart
36+
37+
- name: Create kind cluster
38+
uses: helm/kind-action@v1.2.0
39+
if: steps.list-changed.outputs.changed == 'true'
40+
41+
- name: Run chart-testing (install)
42+
run: ct install --chart-dirs chart

.github/workflows/chart.yml

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

.github/workflows/e2e.yaml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: e2e
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- release-v1.0
9+
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
mongodb: ["4.4", "5.0"]
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
- name: Setup Go
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: 1.17.x
23+
- name: Restore Go cache
24+
uses: actions/cache@v1
25+
with:
26+
path: /home/runner/work/_temp/_github_home/go/pkg/mod
27+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
28+
restore-keys: |
29+
${{ runner.os }}-go-
30+
- name: Setup Kubernetes
31+
uses: engineerd/setup-kind@v0.5.0
32+
with:
33+
version: v0.11.1
34+
image: kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
35+
- name: Setup Kustomize
36+
uses: fluxcd/pkg/actions/kustomize@main
37+
- name: Setup envtest
38+
uses: fluxcd/pkg/actions/envtest@main
39+
with:
40+
version: "1.21.2"
41+
- name: Setup Helm
42+
uses: fluxcd/pkg/actions/helm@main
43+
- name: Run tests
44+
run: make test
45+
- name: Send go coverage report
46+
uses: shogo82148/actions-goveralls@v1
47+
with:
48+
path-to-profile: coverage.out
49+
- name: Check if working tree is dirty
50+
run: |
51+
if [[ $(git diff --stat) != '' ]]; then
52+
git --no-pager diff
53+
echo 'run make test and commit changes'
54+
exit 1
55+
fi
56+
- name: Build container image
57+
run: |
58+
make docker-build IMG=test/mongodb-query-exporter:latest BUILD_PLATFORMS=linux/amd64 \
59+
BUILD_ARGS="--cache-from=type=local,src=/tmp/.buildx-cache \
60+
--cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max"
61+
- name: Load test image
62+
run: kind load docker-image test/mongodb-query-exporter:latest
63+
- name: Deploy exporter
64+
run: make deploy-test IMG=test/mongodb-query-exporter:latest
65+
- name: Setup MongoDB
66+
env:
67+
MONGODB_VER: ${{ '10.29.2' }}
68+
run: |
69+
kubectl create ns mongodb
70+
helm repo add bitnami https://charts.bitnami.com/bitnami
71+
helm upgrade --wait -i mongodb bitnami/mongodb \
72+
--version $MONGODB_VER \
73+
--namespace mongodb \
74+
--set auth.rootPassword=password \
75+
--set persistence.enabled=false \
76+
--set image.tag=${{matrix.mongodb}}
77+
- name: Run tests
78+
run: |
79+
kubectl -n mongodb-system port-forward deployment/mongodb-query-exporter 9412:9412 &>/dev/null &
80+
sleep 2
81+
curl -v --fail http://localhost:9412/metrics | grep total_mongodb_users
82+
- name: Logs
83+
run: |
84+
kubectl -n mongodb-system logs deploy/mongodb-query-exporter
85+
- name: Debug failure
86+
if: failure()
87+
run: |
88+
kubectl -n kube-system describe pods
89+
kubectl -n mongodb describe pods
90+
kubectl -n mongodb-system describe pods
91+
kubectl -n mongodb-system get all
92+
kubectl -n mongodb-system logs deploy/mongodb-query-exporter

.github/workflows/nightly.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: nightly
2+
on:
3+
schedule:
4+
- cron: '0 0 * * *'
5+
workflow_dispatch:
6+
7+
env:
8+
REPOSITORY: ${{ github.repository }}
9+
10+
permissions:
11+
contents: read # for actions/checkout to fetch code
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Setup QEMU
19+
uses: docker/setup-qemu-action@v1
20+
with:
21+
platforms: all
22+
- name: Setup Docker Buildx
23+
id: buildx
24+
uses: docker/setup-buildx-action@v1
25+
with:
26+
buildkitd-flags: "--debug"
27+
- name: Build multi-arch container image
28+
uses: docker/build-push-action@v2
29+
with:
30+
push: false
31+
builder: ${{ steps.buildx.outputs.name }}
32+
context: .
33+
file: ./Dockerfile
34+
platforms: linux/amd64,linux/arm/v7,linux/arm64
35+
tags: |
36+
${{ env.REPOSITORY }}:nightly

.github/workflows/rebase.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: rebase
2+
3+
on:
4+
pull_request:
5+
types: [opened]
6+
issue_comment:
7+
types: [created]
8+
9+
jobs:
10+
rebase:
11+
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && (github.event.comment.author_association == 'CONTRIBUTOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout the latest code
15+
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
- name: Automatic Rebase
19+
uses: cirrus-actions/rebase@1.3.1
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}

.github/workflows/release-chart.yml renamed to .github/workflows/release-chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
2121
2222
- name: Run chart-releaser
23-
uses: helm/chart-releaser-action@v1.0.0
23+
uses: helm/chart-releaser-action@v1.3.0
2424
with:
2525
charts_dir: ./chart
2626
env:

0 commit comments

Comments
 (0)