diff --git a/CHANGELOG.md b/CHANGELOG.md index 618b6f0..a5723bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch - *[#16](https://github.com/idealista/cookiecutter-ansible-role/issues/16) Remove debian jessie support* @pablogcaldito ### Added +- *[#15](https://github.com/idealista/cookiecutter-ansible-role/issues/15) Add pipenv wrapper* @pablogcaldito - * Add boilerplate README.md* @vicsufer ## [1.0.1](https://github.com/idealista/cookiecutter-ansible-role/tree/1.0.1) (2020-09-17) diff --git a/README.md b/README.md index fec81c2..d2d88ad 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,11 @@ This cookiecutter: ### Prerequisities -Cookiecutter version 1.7.x installed. - -You can satify this requirement with ```pip install cookiecutter``` +You just need to have [pipenv](https://github.com/pypa/pipenv) installed. ## Usage -To generate your ansible role type ```cookiecutter https://github.com/idealista/cookiecutter-ansible-role```. +To generate your ansible role type ```printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv install -r requirements.txt && pipenv run cookiecutter https://github.com/idealista/cookiecutter-ansible-role && rm Pipfile* requirements.txt```. Then, introduce some parameters needed for generating it. diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 7748edf..f0e20c4 100755 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -36,7 +36,7 @@ def configureRole(): os.remove("files/.empty") def generatePipfile(): - os.system("pipenv install -r test-requirements.txt --three") + print("Now cd into the role directory and introduce the following command for it to be ready: \"pipenv install -r test-requirements.txt --three\"") def main(): checkInput() diff --git a/test.sh b/test.sh index 7b4a01f..ca19a0c 100755 --- a/test.sh +++ b/test.sh @@ -3,7 +3,7 @@ set -e # Generate role -cookiecutter . --no-input app_name="github_cli" exec_name="gh" author="John Doe" min_ansible_version="2.2" ansible_version="2.8.6" molecule_version="3.0.1" python_docker_version="4.1.0" ansible_lint_version="4.2.0" has_service="False" has_files="False" has_handlers="False" has_templates="False" +printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv install -r requirements.txt && pipenv run cookiecutter . --no-input app_name="github_cli" exec_name="gh" author="John Doe" min_ansible_version="2.2" ansible_version="2.8.6" molecule_version="3.0.1" python_docker_version="4.1.0" ansible_lint_version="4.2.0" has_service="False" has_files="False" has_handlers="False" has_templates="False" && rm Pipfile* requirements.txt ( # Adjust the role to test cd github_cli_role @@ -12,8 +12,9 @@ cookiecutter . --no-input app_name="github_cli" exec_name="gh" author="John Doe" sed -i 's/1.0.0/0.6.4/g' defaults/main.yml sed -i 's/exampleapplication/gh/g' defaults/main.yml # Launch molecule tests - pipenv sync + pipenv install -r test-requirements.txt --three pipenv run molecule test + ) # Cleanup rm -rf github_cli_role