-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.sh
executable file
·36 lines (32 loc) · 1.07 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
set -e
# Generate role
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="5.2.0" \
molecule_version="3.4.0" \
python_docker_version="5.0.0" \
molecule_docker_version="0.2.4" \
ansible_lint_version="5.3.2" \
yamllint_version="1.28.0" \
has_service="False" \
has_files="False" \
has_handlers="False" \
has_templates="False" \
documentation_URL="https://cli.github.com/manual/" && rm Pipfile* requirements.txt && rm -rf requirements.txt
(
# 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
pipenv install -r test-requirements.txt
pipenv run molecule test
)
# Cleanup
rm -rf github_cli_role