git-secret/.ci-tests/integration/tasks/run-tests.yml

68 lines
1.7 KiB
YAML
Raw Normal View History

2017-09-24 14:03:05 +00:00
---
- name: Run ci-test
command: bash -lc "cd /tmp/git-secret && make test"
changed_when: False
ignore_errors: yes
register: test_results
environment:
PATH: /usr/local/bin:{{ ansible_env.PATH }}
- name: Print ci-test results
debug:
var: test_results.stdout_lines
- name: Create file when ci-test passes
file:
path: /.git-secret_test-passed
state: touch
when:
- test_results.rc == 0
- name: Run lint
command: bash -lc "cd /tmp/git-secret && make lint"
ignore_errors: yes
register: lint_results
changed_when: False
- name: Print lint results
debug:
var: lint_results.stdout_lines
- name: Create file when lint passes
file:
path: /.git-secret_lint-passed
state: touch
when:
- lint_results.rc == 0
- name: Create git-secret {{ os_pkg_type }} package
command: bash -lc "cd /tmp/git-secret && make build-{{ os_pkg_type }}"
changed_when: False
ignore_errors: yes
register: test_results
environment:
PATH: /usr/local/bin:{{ ansible_env.PATH }}
- name: Find git-secret {{ os_pkg_type }} file
find:
paths: /tmp/git-secret/build
patterns: "*.{{ os_pkg_type }}"
recurse: yes
register: pkg_location
- name: Set git-secret {{ os_pkg_type }} location
set_fact:
pkg_path: "{{ pkg_location.files | map(attribute='path') | first }}"
- name: Install git-secret {{ os_pkg_type }} package
command: bash -lc "{{ item.command }} {{ pkg_path }}"
when:
- item.os_family == ansible_os_family
with_items:
- command: "rpm --nodeps --install --force"
os_family: "RedHat"
- command: "dpkg --force-all --install"
os_family: "Debian"
- command: "apk add --allow-untrusted"
os_family: "Alpine"