Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ jobs:

- name: Install dependencies
run: |
# Install pre-commit and CI dependencies
pip install pre-commit
pip install -r requirements-ci.txt

- name: Cache pre-commit environments
Expand Down
34 changes: 30 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,39 @@ breaking_changes:

```bash
# Install Ansible collection dependencies
ansible-galaxy collection install -r requirements.yml

# Install Python development dependencies
export ANSIBLE_GALAXY_SERVER_LIST=upstream_galaxy,automation_hub_certified,automation_hub_validated
export ANSIBLE_GALAXY_SERVER_UPSTREAM_GALAXY_URL=https://galaxy.ansible.com/
export ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_CERTIFIED_URL=https://console.redhat.com/api/automation-hub/content/published/
export ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_CERTIFIED_AUTH_URL=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
export ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_CERTIFIED_TOKEN="ADD_YOUR_TOKEN_HERE"
export ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_VALIDATED_URL=https://console.redhat.com/api/automation-hub/content/validated/
export ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_VALIDATED_AUTH_URL=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
export ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_VALIDATED_TOKEN="ADD_YOUR_TOKEN_HERE"
ansible-galaxy collection install -r requirements-dev.yml

# Install Python development dependencies and tooling
pip install -r requirements-dev.txt
pip install -r requirements-ci.txt
```

#### macOS-Specific Requirements

If you're developing on macOS, ensure you have the following tools installed:

```bash
# Install required tools via Homebrew
brew install python3 bash gnu-sed coreutils

# Ensure bash is available at /usr/bin/bash (required for pre-commit hooks)
# If not, create a symlink (requires admin privileges):
sudo ln -sf /bin/bash /usr/bin/bash

# Or use setup script provided in the repository
./scripts/setup_env.sh
```

**Note**: The repository's shell scripts are compatible with both GNU (Linux) and BSD (macOS) utilities. However, pre-commit hooks may require bash to be available at `/usr/bin/bash`.

### Running Tests Locally

```bash
Expand All @@ -251,7 +278,6 @@ pre-commit run --all-files
This repository uses pre-commit hooks for code quality. Install them to run checks automatically before each commit:

```bash
pip install pre-commit
pre-commit install
```

Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Ansible for OpenShift Virtualization Migration
# OpenShift Virtualization Migration Collection

![GitHub Release](https://img.shields.io/github/v/release/redhat-cop/openshift_virtualization_migration?include_prereleases&style=flat-square)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/redhat-cop/openshift_virtualization_migration/ci.yml?style=flat-square&label=release)](https://github.com/redhat-cop/openshift_virtualization_migration/actions)
Expand All @@ -7,7 +7,7 @@

<!--TOC-->

- [Ansible for OpenShift Virtualization Migration](#ansible-for-openshift-virtualization-migration)
- [OpenShift Virtualization Migration Collection](#openshift-virtualization-migration-collection)
- [Description](#description)
- [Documentation](#documentation)
- [Release Notes](#release-notes)
Expand Down Expand Up @@ -102,7 +102,7 @@ Note that if you install any collections from Ansible Galaxy, they will not be u

To upgrade the collection to the latest available version, run the following command:

```
```shell
ansible-galaxy collection install infra.openshift_virtualization_migration --upgrade
```

Expand All @@ -114,9 +114,12 @@ collections:
- name: infra.openshift_virtualization_migration
# If you need a specific version of the collection, you can specify like this:
# version: ...
...
```

See [using Ansible collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for more details.
See
[Using Ansible Collections](https://docs.ansible.com/projects/ansible/latest/collections_guide/index.html)
for more details.

## Use Cases

Expand Down
1 change: 1 addition & 0 deletions requirements-ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ antsibull-changelog==0.35.0
docsible==0.8.0
python-semantic-release==10.5.3
md-toc>=9.0.0
pre-commit
3 changes: 2 additions & 1 deletion scripts/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ source "$VENV_DIR/bin/activate"
echo -e "${GREEN}Upgrading pip...${RESET}"
pip install --upgrade pip

echo -e "${GREEN}Installing Ansible core, Ansible Lint, and Pre-commit...${RESET}"
echo -e "${GREEN}Installing Ansible core, Ansible Lint, Pre-commit, and more...${RESET}"
pip install -r requirements-dev.txt
pip install -r requirements-ci.txt

echo -e "${GREEN}Installing pre-commit hooks${RESET}"

Expand Down
12 changes: 8 additions & 4 deletions scripts/update-documentation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,19 @@ mv README.md.bkp README.md

# Generate role list from metadata
echo "Generating role list from role metadata..."
ROLE_LIST=$(python3 ${ROLE_LIST_GENERATOR})
ROLE_LIST_FILE=$(mktemp)
python3 ${ROLE_LIST_GENERATOR} > "${ROLE_LIST_FILE}"

# Injecting role list into Roles section
echo "Building Roles section..."
README_TMP=$(mktemp)
awk -v roles="$ROLE_LIST" '
awk '
/<!--ROLES_LIST_START-->/ {
print $0
print roles
while ((getline line < "'"${ROLE_LIST_FILE}"'") > 0) {
print line
}
close("'"${ROLE_LIST_FILE}"'")
in_roles=1
next
}
Expand All @@ -38,7 +42,7 @@ awk -v roles="$ROLE_LIST" '
!in_roles { print }
' README.md > "${README_TMP}"
mv "${README_TMP}" README.md
rm -f "${README_TMP}"
rm -f "${README_TMP}" "${ROLE_LIST_FILE}"

# Generate/update TOC in README.md (in-place, GitHub flavor)
echo "Generating table of contents for README.md"
Expand Down
Loading