Skip to content

Commit

Permalink
Install collection to local directory during development (ansible-col…
Browse files Browse the repository at this point in the history
…lections#763)

* default collection install to local directory

* failsafe command in contributing doc

* update contributing and config for local install
  • Loading branch information
l3ender authored Apr 18, 2022
1 parent 367b63d commit 056c535
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
*.pyc
tests/output/
tests/staging/
tests/integration/cloud-config-azure.ini
azure-azcollection-*.tar.gz
venv*
.venv*
.vscode
ansible_collections/
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ When contributing to this repository, please first discuss the change you wish t
1. Ensure the resource groups defined in your configuration file are already created. Recommended region: **East US** (not all regions support all Azure features).
1. Prepare testing directory (necessary until [ansible/ansible#68499](https://github.com/ansible/ansible/issues/68499) is resolved):
```bash
git init tests/staging
git init ansible_collections
```
1. Unless you are running `ansible-test` inside a container (`--docker` flag), it is recommended you install Ansible and this repository's dependencies in a virtual environment:
```bash
Expand All @@ -25,11 +25,11 @@ When contributing to this repository, please first discuss the change you wish t
1. Build/install the collection:
```bash
rm azure-azcollection-*.tar.gz && ansible-galaxy collection build . --force && ansible-galaxy collection install azure-azcollection-*.tar.gz -p tests/staging --force
rm -f azure-azcollection-*.tar.gz && ansible-galaxy collection build . --force && ansible-galaxy collection install azure-azcollection-*.tar.gz --force
```
1. Switch to the test environment directory where the collection installed:
```bash
cd tests/staging/ansible_collections/azure/azcollection/
cd ansible_collections/azure/azcollection/
```
1. Run tests for the desired module(s):
```bash
Expand Down
2 changes: 2 additions & 0 deletions ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[defaults]
collections_paths = ./
3 changes: 2 additions & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ build_ignore:
- 'azure-azcollection-*.tar.gz'
- 'venv*'
- '.vscode'
- 'tests/staging'
- 'ansible_collections'
- 'ansible.cfg'

0 comments on commit 056c535

Please sign in to comment.