#15 Add pipenv wrapper

This commit is contained in:
Pablo Gómez-Caldito 2020-10-06 14:08:19 +02:00
parent 386caa84d8
commit 8d3019b428
4 changed files with 7 additions and 7 deletions

View File

@ -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)

View File

@ -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 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.

View File

@ -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()

View File

@ -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