-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for whether mixin output is checked-in
With the proposed workflow mixin output is generated offline and checked into version control for direct usage. A test is added to check whether the generated rules and dashboards match the checked-in version. Additionally a check for the shellscript generating the mixins is added. Signed-off-by: Jan Horstmann <[email protected]>
- Loading branch information
1 parent
d9ac2d0
commit 006eb57
Showing
2 changed files
with
49 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
- name: Run check-shell-syntax | ||
connection: local | ||
hosts: localhost | ||
#hosts: all | ||
vars: | ||
zuul: | ||
project: | ||
src_dir: ../.. | ||
tasks: | ||
- name: Build monitoring-mixin container | ||
containers.podman.podman_image: | ||
name: mixin-builder | ||
path: "./{{ zuul.project.src_dir }}/.src" | ||
build: | ||
file: "./{{ zuul.project.src_dir }}/.src/Containerfile" | ||
- name: Install monitoring-mixin dependencies | ||
containers.podman.podman_container: | ||
command: jb install | ||
<<: &mixin_container_options | ||
name: mixin-builder | ||
image: localhost/mixin-builder | ||
detach: false | ||
volume: | ||
- "./{{ zuul.project.src_dir }}:/srv" | ||
rm: true | ||
- name: Render monitoring-mixin rules / dashboards | ||
containers.podman.podman_container: | ||
<<: *mixin_container_options | ||
- name: Check difference between git and generated rules / dashboards | ||
ansible.builtin.command: | ||
argv: | ||
- /usr/bin/git | ||
- diff | ||
- --exit-code | ||
register: git_diff | ||
changed_when: false | ||
failed_when: git_diff.rc != 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
--- | ||
- job: | ||
name: mixin-ouput-ensure-git-checkin | ||
description: Check for differences between monitoring-mixin output and checked in rules/dashboards | ||
run: .src/playbooks/mixin-ouput-ensure-git-checkin.yml | ||
- project: | ||
default-branch: main | ||
merge-mode: squash-merge | ||
check: | ||
jobs: | ||
jobs: &jobs | ||
- yamllint | ||
- check-shell-syntax: | ||
files: ^\.src/files/mixins.sh$ | ||
- mixin-ouput-ensure-git-checkin: | ||
files: ^\.src/.*$ | ||
gate: | ||
jobs: | ||
- yamllint | ||
jobs: *jobs | ||
periodic-daily: | ||
jobs: | ||
- yamllint | ||
jobs: *jobs |