Skip to content

Commit

Permalink
0.9.0: Added README to Galaxy archive; added Galaxy token
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Maier <[email protected]>
  • Loading branch information
andy-maier committed Dec 13, 2020
1 parent d683635 commit 93a15af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ help:
@echo ' PACKAGE_LEVEL="latest" - Default: Install latest version of dependent Python packages'
@echo ' PYTHON_CMD=... - Name of python command. Default: python'
@echo ' PIP_CMD=... - Name of pip command. Default: pip'
@echo ' GALAXY_TOKEN=... - Your Ansible Galaxy token, required for upload (see https://galaxy.ansible.com/me/preferences)'
@echo 'Invocation of ansible commands from within repo main directory:'
@echo ' export ANSIBLE_LIBRARY="$$(pwd)/$(module_py_dir);$$ANSIBLE_LIBRARY"'
@echo ' # currently: ANSIBLE_LIBRARY=$(ANSIBLE_LIBRARY)'
Expand Down Expand Up @@ -224,12 +225,12 @@ end2end: _check_version develop_$(pymn).done
@echo '$@ done.'

.PHONY: upload
upload: _check_version $(dist_file)
upload: _check_version _check_galaxy_token $(dist_file)
ifeq (,$(findstring .dev,$(collection_version)))
@echo '==> This will publish collection $(collection_full_name) version $(collection_version) on Ansible Galaxy!'
@echo -n '==> Continue? [yN] '
@bash -c 'read answer; if [[ "$$answer" != "y" ]]; then echo "Aborted."; false; fi'
ansible-galaxy collection publish $(dist_file)
ansible-galaxy collection publish --token $(GALAXY_TOKEN) $(dist_file)
@echo 'Done: Published collection $(collection_full_name) version $(collection_version) on Ansible Galaxy'
@echo '$@ done.'
else
Expand Down Expand Up @@ -258,6 +259,14 @@ else
@true >/dev/null
endif

.PHONY: _check_galaxy_token
_check_galaxy_token:
ifeq (,$(GALAXY_TOKEN))
$(error Error: GALAXY_TOKEN env var needs to be set to your Ansible Galaxy API Key, see https://galaxy.ansible.com/me/preferences)
else
@true >/dev/null
endif

install_$(pymn).done: Makefile develop_$(pymn).done $(dist_file) requirements.txt
$(PIP_CMD) install $(pip_level_opts) $(pip_level_opts_new) -r requirements.txt
ansible-galaxy collection install --force $(dist_file)
Expand Down
1 change: 0 additions & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ build_ignore:
- DCO1.1.txt # only in older branches
- LICENSE
- Makefile
- README.md
# requirements.txt is intentionally included for dependent install
- dev-requirements.txt
- minimum-constraints.txt
Expand Down

0 comments on commit 93a15af

Please sign in to comment.