This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
forked from kyetter/ansible-devspace-demo
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add ansible-lint and pre-commit config files * add pre-commit to requirements.txt * add ansible-lint github workflow * commit pre-commit and ansible-lint fixes excluding syntax_highlighting_demo.yml * Add syntax_highlighting_demo.yml to ansible-lint exclude_paths. So that GitHub lint pipeline can succeeed. * Add instructional comments to syntax_highlighting_demo.yml * Add molecule paths to ansible-lint exclude_paths. * Add exclude for syntax_highligting_check.yml to pre-commit config.
- Loading branch information
1 parent
7ba2d52
commit 5e6d8a2
Showing
18 changed files
with
84 additions
and
26 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,16 @@ | ||
--- | ||
mock_modules: | ||
- community.okd.k8s | ||
|
||
mock_roles: | ||
- backup_file | ||
|
||
exclude_paths: | ||
- devfile.yml | ||
- syntax_highlighting_demo.yml | ||
- collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/molecule | ||
- collections/ansible_collections/sample_namespace/sample_collection/extensions | ||
|
||
warn_list: | ||
- galaxy[no-changelog] # TODO: Implement changelog. | ||
- schema[meta-runtime] # TODO: Implement meta/runtime.yml |
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,15 @@ | ||
# .github/workflows/ansible-lint.yml | ||
name: ansible-lint | ||
on: | ||
pull_request: | ||
branches: | ||
- 'devspaces-[0-9].[0-9]+-rhel-8' | ||
- devspaces-3-rhel-8 | ||
jobs: | ||
build: | ||
name: Ansible Lint # Naming the build is important to use it as a status check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run ansible-lint | ||
uses: ansible/ansible-lint@main # or version tag instead of 'main' |
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 |
---|---|---|
|
@@ -24,14 +24,14 @@ jobs: | |
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: "Docker quay.io Login" | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
|
||
- name: Check Commit Message | ||
id: check_message | ||
run: | | ||
|
@@ -42,7 +42,7 @@ jobs: | |
else | ||
echo "update_devfile=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Build and push Docker image; Update image in devfile | ||
if: steps.check_message.outputs.update_devfile == 'true' || github.actor == 'devstudio-release' | ||
run: | | ||
|
@@ -56,7 +56,7 @@ jobs: | |
fi | ||
echo "Tag: $tag" | ||
image_id=$(docker build -q -t "quay.io/devspaces/ansible-creator-ee:${tag}" .) | ||
short_sha=$(echo $image_id | cut -c8-12) | ||
echo "Short SHA: $short_sha" | ||
docker tag quay.io/devspaces/ansible-creator-ee:${tag} quay.io/devspaces/ansible-creator-ee:${tag}-${short_sha} | ||
|
@@ -66,13 +66,13 @@ jobs: | |
docker pull quay.io/devspaces/ansible-creator-ee:${tag} | ||
digest=$(docker inspect --format='{{index .RepoDigests 0}}' quay.io/devspaces/ansible-creator-ee:${tag}) | ||
sed -r -i devfile.yaml -e "s|(image: .+devspaces/ansible-creator-ee.+)|image: ${digest}|g" | ||
- name: Set up Git | ||
if: steps.check_message.outputs.update_devfile == 'true' || github.actor == 'devstudio-release' | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Valerii Svydenko" | ||
- name: Commit and Push Changes | ||
if: steps.check_message.outputs.update_devfile == 'true' || github.actor == 'devstudio-release' | ||
run: | | ||
|
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,25 @@ | ||
--- | ||
repos: | ||
- repo: 'https://github.com/pre-commit/pre-commit-hooks' | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-merge-conflict | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
exclude: syntax_highlighting_demo.yml | ||
- id: no-commit-to-branch | ||
|
||
- repo: 'https://github.com/ansible-community/ansible-lint.git' | ||
rev: v6.22.1 | ||
hooks: | ||
- id: ansible-lint | ||
pass_filenames: false | ||
always_run: true | ||
entry: "ansible-lint" | ||
args: | ||
- "--profile=production" | ||
- "-c=.ansible-lint" | ||
additional_dependencies: | ||
- "ansible-core>=2.13" | ||
- "yamllint>=1.29,<2.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
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 |
---|---|---|
|
@@ -69,4 +69,4 @@ To reset your test pod back to a fresh instance you can run `molecule destroy` a | |
Contributions to this repository are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue with [Red Hat](https://issues.redhat.com/projects/CRW/issues). | ||
|
||
## Code of Conduct | ||
We ask all of our community members and contributors to adhere to the [Ansible code of conduct](http://docs.ansible.com/ansible/latest/community/code_of_conduct.html). If you have questions or need assistance, please reach out to our community team at [[email protected]](mailto:[email protected]) | ||
We ask all of our community members and contributors to adhere to the [Ansible code of conduct](http://docs.ansible.com/ansible/latest/community/code_of_conduct.html). If you have questions or need assistance, please reach out to our community team at [[email protected]](mailto:[email protected]) |
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 |
---|---|---|
|
@@ -16,7 +16,7 @@ readme: README.md | |
# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url) | ||
# @nicks:irc/im.site#channel' | ||
authors: | ||
- your name <[email protected]> | ||
- your name <[email protected]> | ||
|
||
|
||
### OPTIONAL but strongly recommended | ||
|
@@ -26,15 +26,15 @@ description: your collection description | |
# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only | ||
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file' | ||
license: | ||
- GPL-2.0-or-later | ||
- GPL-2.0-or-later | ||
|
||
# The path to the license file for the collection. This path is relative to the root of the collection. This key is | ||
# mutually exclusive with 'license' | ||
license_file: '' | ||
|
||
# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character | ||
# requirements as 'namespace' and 'name' | ||
tags: [] | ||
tags: [linux, infrastructure] | ||
|
||
# Collections that this collection requires to be installed for it to be usable. The key of the dict is the | ||
# collection label 'namespace.name'. The value is a version range | ||
|
@@ -66,4 +66,3 @@ build_ignore: [] | |
# 'omit_default_directives' is a boolean that controls whether the default directives are used. Mutually exclusive | ||
# with 'build_ignore' | ||
# manifest: null | ||
|
2 changes: 1 addition & 1 deletion
2
...ible_collections/sample_namespace/sample_collection/roles/backup_file/README.md
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
1 change: 0 additions & 1 deletion
1
.../ansible_collections/sample_namespace/sample_collection/roles/backup_file/tests/inventory
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,2 +1 @@ | ||
ubi8-int | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
kubernetes==26.1.0 | ||
ansible-navigator==3.5.0 | ||
pre-commit==3.6.0 | ||
ansible-creator |
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