ci: linter, workflows, galaxy, molecule
parent
ded44b084d
commit
9b2ea35184
|
@ -23,9 +23,13 @@ warn_list:
|
||||||
- no-handler
|
- no-handler
|
||||||
- fqcn-builtins
|
- fqcn-builtins
|
||||||
- no-log-password
|
- no-log-password
|
||||||
|
- jinja[spacing]
|
||||||
|
- jinja[invalid]
|
||||||
|
- meta-no-tags
|
||||||
|
|
||||||
skip_list:
|
skip_list:
|
||||||
- vars_should_not_be_used
|
- vars_should_not_be_used
|
||||||
|
- file_is_small_enough
|
||||||
|
|
||||||
use_default_rules: true
|
use_default_rules: true
|
||||||
parseable: true
|
parseable: true
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
---
|
---
|
||||||
name: CI
|
name: CI
|
||||||
"on":
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
|
env:
|
||||||
|
COLORTERM: 'yes'
|
||||||
|
TERM: 'xterm-256color'
|
||||||
|
PYTEST_ADDOPTS: '--color=yes'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -29,16 +34,17 @@ jobs:
|
||||||
pip install yamllint 'molecule[docker]~=3.5.2' ansible-core flake8 ansible-lint voluptuous
|
pip install yamllint 'molecule[docker]~=3.5.2' ansible-core flake8 ansible-lint voluptuous
|
||||||
pip install -r ansible_collections/middleware_automation/keycloak/requirements.txt
|
pip install -r ansible_collections/middleware_automation/keycloak/requirements.txt
|
||||||
|
|
||||||
|
- name: Create default collection path
|
||||||
|
run: |
|
||||||
|
mkdir -p /home/runner/.ansible/
|
||||||
|
ln -s /home/runner/work/keycloak/keycloak /home/runner/.ansible/collections
|
||||||
|
|
||||||
- name: Install ansible-lint custom rules
|
- name: Install ansible-lint custom rules
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
repository: ansible-middleware/ansible-lint-custom-rules
|
repository: ansible-middleware/ansible-lint-custom-rules
|
||||||
path: ansible_collections/ansible-lint-custom-rules/
|
path: ansible_collections/ansible-lint-custom-rules/
|
||||||
|
|
||||||
- name: Create default collection path
|
|
||||||
run: |
|
|
||||||
mkdir -p /home/runner/.ansible/collections/ansible_collections
|
|
||||||
|
|
||||||
- name: Run sanity tests
|
- name: Run sanity tests
|
||||||
run: ansible-test sanity --docker -v --color --python ${{ matrix.python_version }} --exclude changelogs/fragments/.gitignore
|
run: ansible-test sanity --docker -v --color --python ${{ matrix.python_version }} --exclude changelogs/fragments/.gitignore
|
||||||
working-directory: ./ansible_collections/middleware_automation/keycloak
|
working-directory: ./ansible_collections/middleware_automation/keycloak
|
||||||
|
|
|
@ -45,7 +45,8 @@ jobs:
|
||||||
|
|
||||||
- name: Create default collection path
|
- name: Create default collection path
|
||||||
run: |
|
run: |
|
||||||
mkdir -p /home/runner/.ansible/collections/ansible_collections
|
mkdir -p /home/runner/.ansible/
|
||||||
|
ln -s /home/runner/work/keycloak/keycloak /home/runner/.ansible/collections
|
||||||
|
|
||||||
- name: Create changelog and documentation
|
- name: Create changelog and documentation
|
||||||
uses: ansible-middleware/collection-docs-action@main
|
uses: ansible-middleware/collection-docs-action@main
|
||||||
|
|
11
galaxy.yml
11
galaxy.yml
|
@ -28,8 +28,15 @@ documentation: https://ansible-middleware.github.io/keycloak
|
||||||
homepage: https://github.com/ansible-middleware/keycloak
|
homepage: https://github.com/ansible-middleware/keycloak
|
||||||
issues: https://github.com/ansible-middleware/keycloak/issues
|
issues: https://github.com/ansible-middleware/keycloak/issues
|
||||||
build_ignore:
|
build_ignore:
|
||||||
- molecule
|
- .gitignore
|
||||||
- .github
|
- .github
|
||||||
|
- .ansible-lint
|
||||||
|
- .yamllint
|
||||||
- '*.tar.gz'
|
- '*.tar.gz'
|
||||||
- '*.zip'
|
- '*.zip'
|
||||||
- changelogs/fragments/.gitignore
|
- molecule
|
||||||
|
- changelogs
|
||||||
|
- docs/_gh_include
|
||||||
|
- docs/conf.py
|
||||||
|
- docs/roles.rst.template
|
||||||
|
- docs/requirements.yml
|
||||||
|
|
|
@ -8,3 +8,13 @@
|
||||||
- sudo
|
- sudo
|
||||||
- java-1.8.0-openjdk
|
- java-1.8.0-openjdk
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
- name: Prepare
|
||||||
|
hosts: all
|
||||||
|
tasks:
|
||||||
|
- name: "Run preparation common to all scenario"
|
||||||
|
ansible.builtin.include_tasks: ../prepare.yml
|
||||||
|
vars:
|
||||||
|
assets:
|
||||||
|
- "{{ assets_server }}/sso/7.5.0/rh-sso-7.5.0-server-dist.zip"
|
||||||
|
- "{{ assets_server }}/sso/7.5.1/rh-sso-7.5.1-patch.zip"
|
||||||
|
|
|
@ -2,11 +2,8 @@
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
hosts: all
|
hosts: all
|
||||||
tasks:
|
tasks:
|
||||||
- name: Disable beta repos
|
- name: "Run preparation common to all scenario"
|
||||||
ansible.builtin.command: yum config-manager --disable '*beta*'
|
ansible.builtin.include_tasks: ../prepare.yml
|
||||||
ignore_errors: yes
|
vars:
|
||||||
|
assets:
|
||||||
- name: Install sudo
|
- "{{ assets_server }}/sso/7.5.0/rh-sso-7.5.0-server-dist.zip"
|
||||||
ansible.builtin.yum:
|
|
||||||
name: sudo
|
|
||||||
state: present
|
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
---
|
||||||
|
- name: Display Ansible version
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "Ansible version is {{ ansible_version.full }}"
|
||||||
|
|
||||||
|
- name: Install sudo
|
||||||
|
ansible.builtin.yum:
|
||||||
|
name:
|
||||||
|
- sudo
|
||||||
|
- iproute
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: "Retrieve assets server from env"
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
assets_server: "{{ lookup('env','MIDDLEWARE_DOWNLOAD_RELEASE_SERVER_URL') }}"
|
||||||
|
|
||||||
|
- name: "Download and deploy jws zips from {{ assets_server }}"
|
||||||
|
ansible.builtin.get_url:
|
||||||
|
url: "{{ asset }}"
|
||||||
|
dest: "{{ lookup('env', 'PWD') }}"
|
||||||
|
validate_certs: no
|
||||||
|
delegate_to: localhost
|
||||||
|
loop: "{{ assets }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: asset
|
||||||
|
when:
|
||||||
|
- assets_server is defined
|
||||||
|
- assets_server | length > 0
|
Loading…
Reference in New Issue