Skip to content

Commit 01f7720

Browse files
committed
Add 'common/' from commit 'e0d79541df06398e79178b92b25d78a043c3ed46'
git-subtree-dir: common git-subtree-mainline: 3f09479 git-subtree-split: e0d7954
2 parents 3f09479 + e0d7954 commit 01f7720

226 files changed

Lines changed: 64980 additions & 0 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.

common/.ansible-lint

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Vim filetype=yaml
2+
---
3+
offline: false
4+
skip_list:
5+
- name[template] # Allow Jinja templating inside task and play names
6+
- template-instead-of-copy # Templated files should use template instead of copy
7+
- yaml[line-length] # too long lines
8+
- yaml[indentation] # Forcing lists to be always indented by 2 chars is silly IMO
9+
- var-naming[no-role-prefix] # This would be too much churn for very little gain
10+
- no-changed-when
11+
- var-naming[no-role-prefix] # There are too many changes now and it would be too risky
12+
13+
# ansible-lint gh workflow cannot find ansible.cfg hence fails to import vault_utils role
14+
exclude_paths:
15+
- ./ansible/playbooks/vault/vault.yaml
16+
- ./ansible/playbooks/iib-ci/iib-ci.yaml
17+
- ./ansible/roles/vault_utils/tests/test.yml

common/.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
version: 2
3+
updates:
4+
# Check for updates to GitHub Actions every week
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
interval: "weekly"
9+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[whitelist]
2+
# As of v4, gitleaks only matches against filename, not path in the
3+
# files directive. Leaving content for backwards compatibility.
4+
files = [
5+
"ansible/plugins/modules/*.py",
6+
"ansible/tests/unit/test_*.py",
7+
"ansible/tests/unit/v1/*.yaml",
8+
]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"default": true,
3+
"MD003": false,
4+
"MD013": false,
5+
"MD033": false
6+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Ansible Lint # feel free to pick your own name
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
# Important: This sets up your GITHUB_WORKSPACE environment variable
11+
- uses: actions/checkout@v3
12+
13+
- name: Lint Ansible Playbook
14+
uses: ansible/ansible-lint-action@v6
15+
# Let's point it to the path
16+
with:
17+
path: "ansible/"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: Ansible unit tests
3+
4+
#
5+
# Documentation:
6+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
7+
#
8+
9+
#############################
10+
# Start the job on all push #
11+
#############################
12+
on: [push, pull_request]
13+
14+
###############
15+
# Set the Job #
16+
###############
17+
jobs:
18+
ansible_unittests:
19+
# Name the Job
20+
name: Ansible unit tests
21+
strategy:
22+
matrix:
23+
python-version: [3.11.3]
24+
# Set the agent to run on
25+
runs-on: ubuntu-latest
26+
27+
##################
28+
# Load all steps #
29+
##################
30+
steps:
31+
##########################
32+
# Checkout the code base #
33+
##########################
34+
- name: Checkout Code
35+
uses: actions/checkout@v3
36+
with:
37+
# Full git history is needed to get a proper list of changed files within `super-linter`
38+
fetch-depth: 0
39+
40+
- name: Set up Python ${{ matrix.python-version }}
41+
uses: actions/setup-python@v4
42+
with:
43+
python-version: ${{ matrix.python-version }}
44+
45+
- name: Install dependencies
46+
run: |
47+
python -m pip install --upgrade pip
48+
pip install pytest ansible
49+
50+
- name: Run make ansible-unittest
51+
run: |
52+
make ansible-unittest
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: Verify json schema
3+
4+
#
5+
# Documentation:
6+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
7+
#
8+
9+
#############################
10+
# Start the job on all push #
11+
#############################
12+
on: [push, pull_request]
13+
14+
###############
15+
# Set the Job #
16+
###############
17+
jobs:
18+
jsonschema_tests:
19+
# Name the Job
20+
name: Json Schema tests
21+
strategy:
22+
matrix:
23+
python-version: [3.11.3]
24+
# Set the agent to run on
25+
runs-on: ubuntu-latest
26+
27+
##################
28+
# Load all steps #
29+
##################
30+
steps:
31+
##########################
32+
# Checkout the code base #
33+
##########################
34+
- name: Checkout Code
35+
uses: actions/checkout@v3
36+
with:
37+
# Full git history is needed to get a proper list of changed files within `super-linter`
38+
fetch-depth: 0
39+
40+
- name: Set up Python ${{ matrix.python-version }}
41+
uses: actions/setup-python@v4
42+
with:
43+
python-version: ${{ matrix.python-version }}
44+
45+
- name: Install dependencies
46+
run: |
47+
python -m pip install --upgrade pip
48+
pip install check-jsonschema
49+
50+
- name: Verify secrets json schema
51+
run: |
52+
check-jsonschema --schemafile ./ansible/roles/vault_utils/values-secrets.v1.schema.json examples/secrets/values-secret.v1.yaml
53+
check-jsonschema --schemafile ./ansible/roles/vault_utils/values-secrets.v2.schema.json examples/secrets/values-secret.v2.yaml
54+
55+
- name: Verify ClusterGroup values.schema.json
56+
run: |
57+
set -e; for i in examples/*yaml; do echo "$i"; check-jsonschema --schemafile ./clustergroup/values.schema.json "$i"; done
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
name: Unit test common
3+
4+
#
5+
# Documentation:
6+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
7+
#
8+
9+
#############################
10+
# Start the job on all push #
11+
#############################
12+
on: [push, pull_request]
13+
14+
###############
15+
# Set the Job #
16+
###############
17+
jobs:
18+
build:
19+
# Name the Job
20+
name: Unit common/ Code Base
21+
# Set the agent to run on
22+
runs-on: ubuntu-latest
23+
24+
##################
25+
# Load all steps #
26+
##################
27+
steps:
28+
##########################
29+
# Checkout the code base #
30+
##########################
31+
- name: Checkout Code
32+
uses: actions/checkout@v3
33+
with:
34+
# Full git history is needed to get a proper list of changed files within `super-linter`
35+
fetch-depth: 0
36+
- name: Setup helm
37+
uses: azure/setup-helm@v3
38+
# with:
39+
# version: '<version>' # default is latest stable
40+
id: install
41+
42+
################################
43+
# Run Linter against code base #
44+
################################
45+
# - name: Lint Code Base
46+
# uses: github/super-linter@v4
47+
# env:
48+
# VALIDATE_ALL_CODEBASE: false
49+
# DEFAULT_BRANCH: main
50+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
- name: Run make test
52+
run: |
53+
make test
54+
55+
- name: Run make helmlint
56+
run: |
57+
make helmlint
58+
59+
- name: Run make helm kubeconform
60+
run: |
61+
curl -L -O https://github.com/yannh/kubeconform/releases/download/v0.4.13/kubeconform-linux-amd64.tar.gz
62+
tar xf kubeconform-linux-amd64.tar.gz
63+
sudo mv -v kubeconform /usr/local/bin
64+
make kubeconform
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Super linter
3+
4+
on: [push, pull_request]
5+
6+
jobs:
7+
build:
8+
# Name the Job
9+
name: Super linter
10+
# Set the agent to run on
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v3
16+
with:
17+
# Full git history is needed to get a proper list of changed files within `super-linter`
18+
fetch-depth: 0
19+
20+
################################
21+
# Run Linter against code base #
22+
################################
23+
- name: Lint Code Base
24+
uses: github/super-linter/slim@v5
25+
env:
26+
VALIDATE_ALL_CODEBASE: true
27+
DEFAULT_BRANCH: main
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
# These are the validation we disable atm
30+
VALIDATE_ANSIBLE: false
31+
VALIDATE_BASH: false
32+
VALIDATE_JSCPD: false
33+
VALIDATE_KUBERNETES_KUBECONFORM: false
34+
VALIDATE_YAML: false
35+
# VALIDATE_DOCKERFILE_HADOLINT: false
36+
# VALIDATE_MARKDOWN: false
37+
# VALIDATE_NATURAL_LANGUAGE: false
38+
# VALIDATE_TEKTON: false

common/.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
__pycache__/
2+
*.py[cod]
3+
*~
4+
*.swp
5+
*.swo
6+
values-secret.yaml
7+
.*.expected.yaml
8+
pattern-vault.init
9+
pattern-vault.init.bak
10+
super-linter.log
11+
golang-external-secrets/Chart.lock
12+
hashicorp-vault/Chart.lock

0 commit comments

Comments
 (0)