-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11226 from VannTen/cleanup/pre-commit-hooks
pre-commit: make hooks self contained + ci config
- Loading branch information
Showing
58 changed files
with
151 additions
and
238 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
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,24 @@ | ||
--- | ||
yamllint: | ||
extends: .job | ||
stage: unit-tests | ||
tags: [light] | ||
variables: | ||
LANG: C.UTF-8 | ||
script: | ||
- yamllint --strict . | ||
except: ['triggers', 'master'] | ||
generate-pre-commit: | ||
image: 'mikefarah/yq@sha256:bcb889a1f9bdb0613c8a054542d02360c2b1b35521041be3e1bd8fbd0534d411' | ||
stage: build | ||
before_script: [] | ||
script: | ||
- > | ||
yq -r < .pre-commit-config.yaml '.repos[].hooks[].id' | | ||
sed 's/^/ - /' | | ||
cat .gitlab-ci/pre-commit-dynamic-stub.yml - > pre-commit-generated.yml | ||
artifacts: | ||
paths: | ||
- pre-commit-generated.yml | ||
|
||
run-pre-commit: | ||
stage: unit-tests | ||
trigger: | ||
include: | ||
- artifact: pre-commit-generated.yml | ||
job: generate-pre-commit | ||
strategy: depend | ||
|
||
vagrant-validate: | ||
extends: .job | ||
|
@@ -19,108 +30,11 @@ vagrant-validate: | |
- ./tests/scripts/vagrant-validate.sh | ||
except: ['triggers', 'master'] | ||
|
||
ansible-lint: | ||
extends: .job | ||
stage: unit-tests | ||
tags: [light] | ||
script: | ||
- ansible-lint -v | ||
except: ['triggers', 'master'] | ||
|
||
jinja-syntax-check: | ||
extends: .job | ||
stage: unit-tests | ||
tags: [light] | ||
script: | ||
- "find -name '*.j2' -exec tests/scripts/check-templates.py {} +" | ||
except: ['triggers', 'master'] | ||
|
||
syntax-check: | ||
extends: .job | ||
stage: unit-tests | ||
tags: [light] | ||
variables: | ||
ANSIBLE_INVENTORY: inventory/local-tests.cfg | ||
ANSIBLE_REMOTE_USER: root | ||
ANSIBLE_BECOME: "true" | ||
ANSIBLE_BECOME_USER: root | ||
ANSIBLE_VERBOSITY: "3" | ||
script: | ||
- ansible-playbook --syntax-check cluster.yml | ||
- ansible-playbook --syntax-check playbooks/cluster.yml | ||
- ansible-playbook --syntax-check upgrade-cluster.yml | ||
- ansible-playbook --syntax-check playbooks/upgrade_cluster.yml | ||
- ansible-playbook --syntax-check reset.yml | ||
- ansible-playbook --syntax-check playbooks/reset.yml | ||
- ansible-playbook --syntax-check extra_playbooks/upgrade-only-k8s.yml | ||
except: ['triggers', 'master'] | ||
|
||
collection-build-install-sanity-check: | ||
extends: .job | ||
stage: unit-tests | ||
tags: [light] | ||
variables: | ||
ANSIBLE_COLLECTIONS_PATH: "./ansible_collections" | ||
script: | ||
- ansible-galaxy collection build | ||
- ansible-galaxy collection install kubernetes_sigs-kubespray-$(grep "^version:" galaxy.yml | awk '{print $2}').tar.gz | ||
- ansible-galaxy collection list $(egrep -i '(name:\s+|namespace:\s+)' galaxy.yml | awk '{print $2}' | tr '\n' '.' | sed 's|\.$||g') | grep "^kubernetes_sigs.kubespray" | ||
- test -f ansible_collections/kubernetes_sigs/kubespray/playbooks/cluster.yml | ||
- test -f ansible_collections/kubernetes_sigs/kubespray/playbooks/reset.yml | ||
except: ['triggers', 'master'] | ||
|
||
tox-inventory-builder: | ||
stage: unit-tests | ||
tags: [light] | ||
extends: .job | ||
before_script: | ||
- ./tests/scripts/rebase.sh | ||
script: | ||
- pip3 install tox | ||
- cd contrib/inventory_builder && tox | ||
except: ['triggers', 'master'] | ||
|
||
markdownlint: | ||
stage: unit-tests | ||
tags: [light] | ||
image: node | ||
before_script: | ||
- npm install -g [email protected] | ||
script: | ||
- markdownlint $(find . -name '*.md' | grep -vF './.git') --ignore docs/_sidebar.md --ignore contrib/dind/README.md | ||
|
||
generate-sidebar: | ||
extends: .job | ||
stage: unit-tests | ||
tags: [light] | ||
script: | ||
- scripts/gen_docs_sidebar.sh | ||
- git diff --exit-code | ||
|
||
check-readme-versions: | ||
stage: unit-tests | ||
tags: [light] | ||
image: python:3 | ||
script: | ||
- tests/scripts/check_readme_versions.sh | ||
|
||
# TODO: convert to pre-commit hook | ||
check-galaxy-version: | ||
stage: unit-tests | ||
tags: [light] | ||
image: python:3 | ||
script: | ||
- tests/scripts/check_galaxy_version.sh | ||
|
||
check-typo: | ||
stage: unit-tests | ||
tags: [light] | ||
image: python:3 | ||
script: | ||
- tests/scripts/check_typo.sh | ||
|
||
ci-matrix: | ||
stage: unit-tests | ||
tags: [light] | ||
image: python:3 | ||
script: | ||
- tests/scripts/md-table/test.sh |
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,17 @@ | ||
--- | ||
# stub pipeline for dynamic generation | ||
pre-commit: | ||
tags: | ||
- light | ||
image: 'ghcr.io/pre-commit-ci/runner-image@sha256:aaf2c7b38b22286f2d381c11673bec571c28f61dd086d11b43a1c9444a813cef' | ||
variables: | ||
PRE_COMMIT_HOME: /pre-commit-cache | ||
script: | ||
- pre-commit run -a $HOOK_ID | ||
cache: | ||
key: pre-commit-$HOOK_ID | ||
paths: | ||
- /pre-commit-cache | ||
parallel: | ||
matrix: | ||
- HOOK_ID: |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
all | ||
exclude_rule 'MD013' | ||
exclude_rule 'MD029' | ||
rule 'MD007', :indent => 2 |
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 @@ | ||
style "#{File.dirname(__FILE__)}/.md_style.rb" |
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
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
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 |
---|---|---|
|
@@ -146,4 +146,4 @@ server_groups = { | |
# ] | ||
# anti_affinity_policy = "yes" | ||
# } | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -106,4 +106,4 @@ variable "server_groups" { | |
anti_affinity_policy = string | ||
servers = list(string) | ||
})) | ||
} | ||
} |
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 |
---|---|---|
|
@@ -146,4 +146,4 @@ server_groups = { | |
# ] | ||
# anti_affinity_policy = "yes" | ||
# } | ||
} | ||
} |
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,4 +1,3 @@ | ||
|
||
# OpenStack | ||
|
||
## Known compatible public clouds | ||
|
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
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
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
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
Oops, something went wrong.