From 3b491d6ec6200c5edd5dd4bb3bdd862e6f445d77 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Mon, 5 Oct 2020 12:34:38 +0200 Subject: [PATCH 1/8] Boilerplate CHANGELOG.md --- {{cookiecutter.app_name}}_role/CHANGELOG.md | 18 ++++++++++++++++++ {{cookiecutter.app_name}}_role/README.md | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.app_name}}_role/CHANGELOG.md b/{{cookiecutter.app_name}}_role/CHANGELOG.md index e69de29..777adb1 100644 --- a/{{cookiecutter.app_name}}_role/CHANGELOG.md +++ b/{{cookiecutter.app_name}}_role/CHANGELOG.md @@ -0,0 +1,18 @@ +# Change Log + +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog). + +## [Unreleased](https://github.com/idealista/{{ cookiecutter.app_name }}_role/tree/develop) +### Changed +### Added +### Removed +### Fixed + +## [X.Y.Z](https://github.com/idealista/{{ cookiecutter.app_name }}_role/tree/X.Y.Z) +### [Full Changelog](https://github.com/idealista/{{ cookiecutter.app_name }}_role/compare/1.0.0...X.Y.Z) +### Changed + *[#](https://github.com/idealista/java_role/issues/) \* @\ + +## [1.0.0](https://github.com/idealista/{{ cookiecutter.app_name }}_role/tree/1.0.0) +- Inicital release diff --git a/{{cookiecutter.app_name}}_role/README.md b/{{cookiecutter.app_name}}_role/README.md index 930381f..0fd79ee 100644 --- a/{{cookiecutter.app_name}}_role/README.md +++ b/{{cookiecutter.app_name}}_role/README.md @@ -26,7 +26,7 @@ These instructions will get you a copy of the role for your Ansible playbook. On ### Prerequisities -Ansible 2.8.x.x version installed. +Ansible {{ cookiecutter.ansible_version }} version installed. Molecule 3.x.x version installed. From a3ab8589ebe52cc5d7cc46934d50a564ec539880 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Mon, 5 Oct 2020 13:26:16 +0200 Subject: [PATCH 2/8] Change github/idealista for github_user variable --- {{cookiecutter.app_name}}_role/CHANGELOG.md | 10 +++++----- {{cookiecutter.app_name}}_role/README.md | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/{{cookiecutter.app_name}}_role/CHANGELOG.md b/{{cookiecutter.app_name}}_role/CHANGELOG.md index 777adb1..101e956 100644 --- a/{{cookiecutter.app_name}}_role/CHANGELOG.md +++ b/{{cookiecutter.app_name}}_role/CHANGELOG.md @@ -3,16 +3,16 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog). -## [Unreleased](https://github.com/idealista/{{ cookiecutter.app_name }}_role/tree/develop) +## [Unreleased](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tree/develop) ### Changed ### Added ### Removed ### Fixed -## [X.Y.Z](https://github.com/idealista/{{ cookiecutter.app_name }}_role/tree/X.Y.Z) -### [Full Changelog](https://github.com/idealista/{{ cookiecutter.app_name }}_role/compare/1.0.0...X.Y.Z) +## [X.Y.Z](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tree/X.Y.Z) +### [Full Changelog](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/compare/1.0.0...X.Y.Z) ### Changed - *[#](https://github.com/idealista/java_role/issues/) \* @\ + *[#](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/issues/) \* @\ -## [1.0.0](https://github.com/idealista/{{ cookiecutter.app_name }}_role/tree/1.0.0) +## [1.0.0](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tree/1.0.0) - Inicital release diff --git a/{{cookiecutter.app_name}}_role/README.md b/{{cookiecutter.app_name}}_role/README.md index 0fd79ee..77bdf94 100644 --- a/{{cookiecutter.app_name}}_role/README.md +++ b/{{cookiecutter.app_name}}_role/README.md @@ -86,7 +86,7 @@ $ pipenv run molecule test ## Versioning -For the versions available, see the [tags on this repository](https://github.com/idealista/{{ cookiecutter.app_name }}_role/tags). +For the versions available, see the [tags on this repository](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tags). Additionaly you can see what change in each version in the [CHANGELOG.md](CHANGELOG.md) file. @@ -94,7 +94,7 @@ Additionaly you can see what change in each version in the [CHANGELOG.md](CHANGE * **Idealista** - *Work with* - [idealista](https://github.com/idealista) -See also the list of [contributors](https://github.com/idealista/{{ cookiecutter.app_name }}_role/contributors) who participated in this project. +See also the list of [contributors](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/contributors) who participated in this project. ## License From 6e1d2bd537543cad0e6c275c87b655980a509005 Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Mon, 5 Oct 2020 13:29:45 +0200 Subject: [PATCH 3/8] Fix typo --- {{cookiecutter.app_name}}_role/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.app_name}}_role/CHANGELOG.md b/{{cookiecutter.app_name}}_role/CHANGELOG.md index 101e956..4a8cc20 100644 --- a/{{cookiecutter.app_name}}_role/CHANGELOG.md +++ b/{{cookiecutter.app_name}}_role/CHANGELOG.md @@ -15,4 +15,4 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch *[#](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/issues/) \* @\ ## [1.0.0](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tree/1.0.0) -- Inicital release +- Initial release From 2276458f71b397988f2a4147a85abe1fd4c7a03f Mon Sep 17 00:00:00 2001 From: Victor Suarez Fernandez Date: Mon, 5 Oct 2020 13:31:04 +0200 Subject: [PATCH 4/8] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83bdb36..17b4a57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog). ## Unreleased +### Added +- * Add boilerplate README.md* @vicsufer + ## [1.0.1](https://github.com/idealista/cookiecutter-ansible-role/tree/1.0.1) (2020-09-17) ## [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/1.0.0...1.0.1) ### Removed From bbd2874072904b1d4a1657898c2dbbb042f3e549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20G=C3=B3mez-Caldito?= Date: Tue, 6 Oct 2020 09:19:05 +0200 Subject: [PATCH 5/8] #16 Remove debian jessie support --- .travis.yml | 1 - CHANGELOG.md | 3 +++ README.md | 4 ---- cookiecutter.json | 1 - {{cookiecutter.app_name}}_role/README.md | 4 +++- {{cookiecutter.app_name}}_role/meta/main.yml | 1 - .../{% raw %}.travis.yml{% endraw %} | 1 - 7 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2aaba44..d87c80f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,6 @@ install: - pip3 install cookiecutter env: jobs: - - MOLECULE_DISTRO=debian:jessie-slim - MOLECULE_DISTRO=debian:stretch-slim - MOLECULE_DISTRO=debian:buster-slim diff --git a/CHANGELOG.md b/CHANGELOG.md index 17b4a57..618b6f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog). ## Unreleased +### Removed +- *[#16](https://github.com/idealista/cookiecutter-ansible-role/issues/16) Remove debian jessie support* @pablogcaldito + ### Added - * Add boilerplate README.md* @vicsufer diff --git a/README.md b/README.md index 1044cb4..fec81c2 100644 --- a/README.md +++ b/README.md @@ -56,10 +56,6 @@ license [Apache 2.0]: galaxy_tag_1 [example_tag1]: github_cli galaxy_tag_2 [example_tag2]: github galaxy_tag_3 [example_tag3]: cli -Select debian_jessie_support: -1 - True -2 - False -Choose from 1, 2 [1]: Select debian_stretch_support: 1 - True 2 - False diff --git a/cookiecutter.json b/cookiecutter.json index 7d6c93e..d82c50d 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -15,7 +15,6 @@ "galaxy_tag_1":"example_tag1", "galaxy_tag_2":"example_tag2", "galaxy_tag_3":"example_tag3", - "debian_jessie_support":["True", "False"], "debian_stretch_support":["True", "False"], "debian_buster_support":["True", "False"], "has_service":["True", "False"], diff --git a/{{cookiecutter.app_name}}_role/README.md b/{{cookiecutter.app_name}}_role/README.md index 77bdf94..64ce241 100644 --- a/{{cookiecutter.app_name}}_role/README.md +++ b/{{cookiecutter.app_name}}_role/README.md @@ -6,7 +6,9 @@ -This ansible role installs [{{ cookiecutter.app_name | replace('_',' ') | title }}](APP_URL_HERE) in a Debian environment. It has been tested for Debian buster and stretch. +This ansible role installs [{{ cookiecutter.app_name | replace('_',' ') | title }}](APP_URL_HERE) in a Debian environment. It has been tested for the following Debian versions: +{% if cookiecutter.debian_stretch_support == 'True' %}* Stretch{% endif %} +{% if cookiecutter.debian_buster_support == 'True' %}* Buster{% endif %} This role has been generated using the [cookiecutter](https://github.com/cookiecutter/cookiecutter) tool, you can generate a similar role that fits your needs using the this [cookiecutter template](https://github.com/idealista/cookiecutter-ansible-role). diff --git a/{{cookiecutter.app_name}}_role/meta/main.yml b/{{cookiecutter.app_name}}_role/meta/main.yml index 89df173..b5a9c5e 100644 --- a/{{cookiecutter.app_name}}_role/meta/main.yml +++ b/{{cookiecutter.app_name}}_role/meta/main.yml @@ -13,6 +13,5 @@ galaxy_info: platforms: - name: Debian versions: - {% if cookiecutter.debian_jessie_support == 'True' %}- jessie{% endif %} {% if cookiecutter.debian_stretch_support == 'True' %}- stretch{% endif %} {% if cookiecutter.debian_buster_support == 'True' %}- buster{% endif %} diff --git a/{{cookiecutter.app_name}}_role/{% raw %}.travis.yml{% endraw %} b/{{cookiecutter.app_name}}_role/{% raw %}.travis.yml{% endraw %} index 0f516cc..1d4aa00 100644 --- a/{{cookiecutter.app_name}}_role/{% raw %}.travis.yml{% endraw %} +++ b/{{cookiecutter.app_name}}_role/{% raw %}.travis.yml{% endraw %} @@ -10,7 +10,6 @@ install: - pipenv sync env: jobs: - {% if cookiecutter.debian_jessie_support == 'True' %}- MOLECULE_DISTRO=debian:jessie-slim{% endif %} {% if cookiecutter.debian_stretch_support == 'True' %}- MOLECULE_DISTRO=debian:stretch-slim{% endif %} {% if cookiecutter.debian_buster_support == 'True' %}- MOLECULE_DISTRO=debian:buster-slim{% endif %} script: From 8d3019b42893c971af0cadfe3352a30c9133e77a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20G=C3=B3mez-Caldito?= Date: Tue, 6 Oct 2020 14:08:19 +0200 Subject: [PATCH 6/8] #15 Add pipenv wrapper --- CHANGELOG.md | 1 + README.md | 6 ++---- hooks/post_gen_project.py | 2 +- test.sh | 5 +++-- 4 files changed, 7 insertions(+), 7 deletions(-) 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..cc356e7 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 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 From 56f671ec1e039c7fed9057d75345ac75ccd42af9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20G=C3=B3mez-Caldito?= Date: Tue, 13 Oct 2020 11:35:16 +0200 Subject: [PATCH 7/8] #15 Add pipenv link in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc356e7..d2d88ad 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ This cookiecutter: ### Prerequisities -You just need to have pipenv installed. +You just need to have [pipenv](https://github.com/pypa/pipenv) installed. ## Usage From 4b9688aedee2ccd20a4997104acf83ac5f1d64c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20G=C3=B3mez-Caldito?= Date: Tue, 13 Oct 2020 11:57:06 +0200 Subject: [PATCH 8/8] Release 2.0.0 changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5723bc..fe7e448 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog). ## Unreleased +## [2.0.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.0.0) (2020-10-13) +## [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/1.0.1...2.0.0) ### Removed - *[#16](https://github.com/idealista/cookiecutter-ansible-role/issues/16) Remove debian jessie support* @pablogcaldito