-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
217 additions
and
92 deletions.
There are no files selected for viewing
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,59 @@ | ||
# Its role is to performe the same checks that would be performed when publishing to galaxy | ||
# Running them earlier helps to detect issues locally | ||
|
||
name: galaxy-importer | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
galaxy-importer: | ||
runs-on: | ||
- ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Get collection namespace and name from galaxy.yml | ||
id: collection-name | ||
run: | | ||
NAMESPACE=$(grep '^namespace:' galaxy.yml | awk '{print $2}' | tr -d "'\"") | ||
NAME=$(grep '^name:' galaxy.yml | awk '{print $2}' | tr -d "'\"") | ||
VERSION=$(grep '^version:' galaxy.yml | awk '{print $2}' | tr -d "'\"") | ||
if [[ -z "$NAMESPACE" || -z "$NAME" || -z "$VERSION" ]]; then | ||
echo "Error: Unable to find or parse namespace, name, or version in galaxy.yml" | ||
exit 1 | ||
fi | ||
echo "Collection namespace is $NAMESPACE" | ||
echo "Collection name is $NAME" | ||
echo "Collection version is $VERSION" | ||
echo "COLLECTION_NAMESPACE=$NAMESPACE" >> $GITHUB_ENV | ||
echo "COLLECTION_NAME=$NAME" >> $GITHUB_ENV | ||
echo "COLLECTION_VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Install Ansible and importer | ||
run: | | ||
pip install ansible==9.4.0 | ||
pip install ansible-importer | ||
pip install galaxy-importer | ||
- name: Build and install the collection | ||
run: | | ||
ansible-galaxy collection build $GITHUB_WORKSPACE --force | ||
ansible-galaxy collection install $GITHUB_WORKSPACE/$COLLECTION_NAMESPACE-$COLLECTION_NAME-$COLLECTION_VERSION.tar.gz | ||
- name: Run ac-galaxy-importer | ||
run: | | ||
python -m galaxy_importer.main $GITHUB_WORKSPACE/$COLLECTION_NAMESPACE-$COLLECTION_NAME-$COLLECTION_VERSION.tar.gz |
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,38 @@ | ||
# .github/workflows/ansible-lint.yml | ||
name: Ansible Lint | ||
|
||
on: | ||
pull_request: | ||
|
||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
analyze-code: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.10'] | ||
defaults: | ||
run: | ||
shell: sh | ||
|
||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Run ansible-lint | ||
uses: ansible/ansible-lint@main # or version tag instead of 'main' | ||
|
||
- name: Install detect-secrets | ||
run: pip install detect-secrets==1.4.0 | ||
|
||
- name: Run detect-secrets | ||
run: detect-secrets scan |
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,70 @@ | ||
name: Release to ansible-galaxy from tag | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
publish-release: | ||
runs-on: | ||
- ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Get collection version from galaxy.yml | ||
id: collection-version | ||
run: | | ||
NAMESPACE=$(grep '^namespace:' galaxy.yml | awk '{print $2}' | tr -d "'\"") | ||
NAME=$(grep '^name:' galaxy.yml | awk '{print $2}' | tr -d "'\"") | ||
VERSION=$(grep '^version:' galaxy.yml | awk '{print $2}' | tr -d "'\"") | ||
if [[ -z "$NAMESPACE" || -z "$NAME" || -z "$VERSION" ]]; then | ||
echo "Error: Unable to find or parse namespace, name, or version in galaxy.yml" | ||
exit 1 | ||
fi | ||
echo "Collection namespace is $NAMESPACE" | ||
echo "Collection name is $NAME" | ||
echo "Collection version is $VERSION" | ||
echo "AC_NAMESPACE=$NAMESPACE" >> "$GITHUB_ENV" | ||
echo "AC_NAME=$NAME" >> "$GITHUB_ENV" | ||
echo "AC_VERSION=$VERSION" >> "$GITHUB_ENV" | ||
- name: Get Git tag | ||
id: git-tag | ||
run: | | ||
TAG=${GITHUB_REF#refs/tags/} | ||
echo "Git tag is $TAG" | ||
echo "GIT_TAG=$TAG" >> "$GITHUB_ENV" | ||
- name: Compare collection version and Git tag | ||
shell: bash | ||
run: | | ||
if [[ "v$AC_VERSION" == "$GIT_TAG" ]]; then | ||
echo "The collection version matches the Git tag." | ||
else | ||
echo "Error: The collection version ($AC_VERSION) does not match the Git tag ($GIT_TAG)." | ||
exit 1 | ||
fi | ||
- name: Install Ansible | ||
run: | | ||
pip install ansible==9.4.0 | ||
- name: Build collection | ||
run: | | ||
ansible-galaxy collection build $GITHUB_WORKSPACE --force | ||
- name: Check collection install locally to verify tar.gz correctness | ||
run: | | ||
ansible-galaxy collection install $GITHUB_WORKSPACE/$AC_NAMESPACE-$AC_NAME-$AC_VERSION.tar.gz | ||
- name: Publish Collection to Ansible-Galaxy | ||
run: | | ||
ansible-galaxy collection publish $GITHUB_WORKSPACE/$AC_NAMESPACE-$AC_NAME-$AC_VERSION.tar.gz --api-key "${{ secrets.ANSIBLE_GALAXY_API_KEY }}" |
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,70 +1,24 @@ | ||
# The namespace of the collection. This can be a company/brand/organization or product namespace under which all | ||
# content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with | ||
# underscores or numbers and cannot contain consecutive underscores | ||
namespace: cisco | ||
|
||
# The name of the collection. Has the same character restrictions as 'namespace' | ||
name: sdwan_deployment | ||
|
||
# The version of the collection. Must be compatible with semantic versioning | ||
version: 0.1.0 | ||
|
||
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection | ||
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: | ||
- Arkadiusz Cichon <[email protected]> | ||
description: Ansible collection to deploy Cisco SD-WAN on AWS and Azure | ||
|
||
### OPTIONAL but strongly recommended | ||
# A short summary description of the collection | ||
description: Ansible collection to deploy Cisco SD-WAN on AWS (Azure in roadmap) | ||
repository: https://github.com/cisco-open/ansible-collection-sdwan-deployment | ||
documentation: https://github.com/cisco-open/ansible-collection-sdwan-deployment/blob/main/README.md | ||
homepage: https://github.com/cisco-open/ansible-collection-sdwan-deployment | ||
issues: https://github.com/cisco-open/ansible-collection-sdwan-deployment/issues | ||
|
||
# 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: | ||
- "Apache-2.0" | ||
- "GPL-3.0-only" | ||
|
||
# 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: '' #TODO | ||
|
||
# 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: | ||
- demo | ||
- collection | ||
- cloud | ||
- infrastructure | ||
- cisco | ||
- sdwan | ||
- catalystwan | ||
- networking | ||
|
||
# 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 | ||
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version | ||
# range specifiers can be set and are separated by ',' | ||
dependencies: {} | ||
|
||
# The URL of the originating SCM repository | ||
repository: https://github.com/cisco-open/ansible-collection-sdwan-deployment | ||
|
||
# The URL to any online docs | ||
documentation: https://github.com/cisco-open/ansible-collection-sdwan-deployment/blob/main/README.md | ||
|
||
# The URL to the homepage of the collection/project | ||
homepage: http://cisco.com | ||
|
||
# The URL to the collection issue tracker | ||
issues: https://github.com/cisco-open/ansible-collection-sdwan-deployment/issues | ||
|
||
# A list of file glob-like patterns used to filter any files or directories that should not be included in the build | ||
# artifact. A pattern is matched from the relative path of the file or directory of the collection directory. This | ||
# uses 'fnmatch' to match the files or directories. Some directories and files like 'galaxy.yml', '*.pyc', '*.retry', | ||
# and '.git' are always filtered. Mutually exclusive with 'manifest' | ||
build_ignore: [] | ||
|
||
# A dict controlling use of manifest directives used in building the collection artifact. The key 'directives' is a | ||
# list of MANIFEST.in style | ||
# L(directives,https://packaging.python.org/en/latest/guides/using-manifest-in/#manifest-in-commands). The key | ||
# 'omit_default_directives' is a boolean that controls whether the default directives are used. Mutually exclusive | ||
# with 'build_ignore' | ||
# manifest: null |
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,3 @@ | ||
--- | ||
requires_ansible: ">=2.15.6" | ||
|
||
requires_ansible: '>=2.16.6' |
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.