-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retrieve log files in case of error.
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,32 @@ jobs: | |
- name: Test IPA client deploy | ||
run: ansible-playbook -i vagrant-inventory.yml --ssh-extra-args "-F vagrant-ssh" playbooks/install-client.yml | ||
|
||
- name: Retrieve logs in case of ANY deploy failure | ||
if: failure() | ||
working-directory: . | ||
run: | | ||
ssh -F tests/multihost/vagrant-ssh server.ipa.test "sudo chmod a+r /var/log/*.log" | ||
mkdir -p logs/server-logs | ||
scp -F tests/multihost/vagrant-ssh [email protected]:/var/log/{ipaserver,ipaclient}-install.log logs/server-logs || true | ||
ssh -F tests/multihost/vagrant-ssh rep-01.ipa.test "sudo chmod a+r /var/log/*.log" | ||
mkdir -p logs/replica-logs | ||
scp -F tests/multihost/vagrant-ssh [email protected]:/var/log/{ipareplica,ipaclient}-install.log logs/replica-logs || true | ||
ssh -F tests/multihost/vagrant-ssh cli-01.ipa.test "sudo chmod a+r /var/log/*.log" | ||
mkdir -p logs/client-logs | ||
scp -F tests/multihost/vagrant-ssh [email protected]:/var/log/ipaclient-install.log logs/client-logs || true | ||
tar czvf multihost-logs.tar.gz logs | ||
- name: Save artifacts | ||
if: failure() | ||
# if: github.event.state == 'error' || github.event.state == 'failure' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: | | ||
./server-logs.tar.gz | ||
./replica-logs.tar.gz | ||
./client-logs.tar.gz | ||
if-no-files-found: "ignore" | ||
|
||
# Cleanup | ||
- name: Stop vagrant | ||
run: vagrant destroy -f |