2020-04-28 13:23:10 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Generate role
|
2021-08-20 15:34:03 +02:00
|
|
|
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" \
|
2022-03-23 18:01:02 +01:00
|
|
|
ansible_version="5.2.0" \
|
2021-08-20 15:34:03 +02:00
|
|
|
molecule_version="3.4.0" \
|
|
|
|
python_docker_version="5.0.0" \
|
|
|
|
molecule_docker_version="0.2.4" \
|
2022-03-23 18:01:02 +01:00
|
|
|
ansible_lint_version="5.3.2" \
|
2022-09-22 18:33:53 +02:00
|
|
|
yamllint_version="1.28.0" \
|
2021-08-20 15:34:03 +02:00
|
|
|
has_files="False" \
|
|
|
|
has_handlers="False" \
|
|
|
|
has_templates="False" \
|
2022-09-22 18:14:06 +02:00
|
|
|
documentation_URL="https://cli.github.com/manual/" && rm Pipfile* requirements.txt && rm -rf requirements.txt
|
2021-08-20 15:34:03 +02:00
|
|
|
|
2020-04-28 13:23:10 +02:00
|
|
|
(
|
|
|
|
# Adjust the role to test
|
|
|
|
cd github_cli_role
|
|
|
|
sed -i 's/someuser/cli/g' defaults/main.yml
|
|
|
|
sed -i 's/somerepo/cli/g' defaults/main.yml
|
|
|
|
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
|
2020-10-06 14:08:19 +02:00
|
|
|
pipenv install -r test-requirements.txt --three
|
2020-04-28 13:23:10 +02:00
|
|
|
pipenv run molecule test
|
2022-03-23 18:01:02 +01:00
|
|
|
|
2020-04-28 13:23:10 +02:00
|
|
|
)
|
|
|
|
# Cleanup
|
|
|
|
rm -rf github_cli_role
|