Skip to content
Snippets Groups Projects
Commit fe08f865 authored by ale's avatar ale
Browse files

CI: use a script for detecting changes from ansible log

parent efc0697c
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,7 @@ check: ...@@ -30,7 +30,7 @@ check:
- echo -n "${ANSIBLE_VAULT_PASSWORD}" > .ansible_vault_pw - echo -n "${ANSIBLE_VAULT_PASSWORD}" > .ansible_vault_pw
- export ANSIBLE_VAULT_PASSWORD_FILE=.ansible_vault_pw - export ANSIBLE_VAULT_PASSWORD_FILE=.ansible_vault_pw
- with-ssh-key ansible-playbook -i hosts.ini --diff --check site.yml - with-ssh-key ansible-playbook -i hosts.ini --diff --check site.yml
- grep changed= ansible.log | grep -q -v changed=0 && false - ./ci/has-changed ansible.log
artifacts: artifacts:
paths: paths:
- ansible.log - ansible.log
......
#!/bin/sh
log="$1"
if grep changed= $log | grep -v -q changed=0; then
echo "changes were detected" >&2
exit 1
fi
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment