Skip to content

Commit

Permalink
common: update files for updating repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
osalyk committed Jul 11, 2024
1 parent 0f3c4ec commit 867d4b4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/pmem_ras.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,4 @@ jobs:
# 'tee' command is used to save the overall output to the file. This file is needed for the next step.
- name: Prepare and run RAS Linux tests via ansible-playbook
working-directory: ${{ env.WORKDIR }}
run: ansible-playbook -i $ras_runner, run-ras-linux.yml -e "host=all ansible_user=$ras_user" | sed 's/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/ras_runner/' | tee playbook_output.txt

# This simple step will look through the output in search of specific fail strings.
# The workflow will fail if any of the expected phrases are found in the file.
- name: Fail the workflow if the playbook finished with a failure
working-directory: ${{ env.WORKDIR }}
run: |
if grep -E '(fatal|failed): \[ras_runner\]' playbook_output.txt; then
exit 1
else
exit 0
fi
run: ansible-playbook -i $ras_runner, run-ras-linux.yml -e "host=all ansible_user=$ras_user"
25 changes: 22 additions & 3 deletions utils/gha-runners/run-ras-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@
#

- hosts: '{{ host }}'
any_errors_fatal: true

vars:
bash_path: /bin/bash
working_dir_path: "/var/tmp/rasUnsafeShutdown"
logs_dir_path: "/var/tmp/raslogs"
working_dir_path: "/home/pmdkuser/rasUnsafeShutdown"
logs_dir_path: "/home/pmdkuser/raslogs"
test_dir_path: "{{ working_dir_path }}/testDir"
pmdk_install_dir_path: "{{ working_dir_path }}/pmdkInstallTarget"
pmdk_tests_build_dir_path: "{{ working_dir_path }}/pmdkTestsBuild"
Expand Down Expand Up @@ -174,11 +175,29 @@
with_items: "{{ workspace_dirs }}"

# The 'Main' branch is used for both repositories.
- name: "Clone repositories"
- name: "Ensure working directory exists"
file:
path: "{{ working_dir_path }}"
state: directory

- name: "Remove existing PMDK repository if present"
file:
path: "{{ pmdk_install_dir_path }}"
state: absent
force: yes

- name: "Remove existing PMDK-test repository if present"
file:
path: "{{ repo.pmdk_tests.target_dir }}"
state: absent
force: yes

- name: "Clone PMDK & PMDK-test repositories"
git:
repo: "{{ item.value.url }}"
dest: "{{ item.value.target_dir }}"
version: "{{ item.value.branch }}"
force: yes
with_dict: "{{ repo }}"

- name: "Build PMDK"
Expand Down

0 comments on commit 867d4b4

Please sign in to comment.