Skip to content

Commit

Permalink
Attempt to rsync stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeGat committed Sep 17, 2024
1 parent 033ab60 commit 5f10e51
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/call.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Call rsync workflow
on:
workflow_dispatch:
jobs:
call-rsync:
uses: codegat-test-org/test/.github/workflows/test.yml@main
with:
additional-artifact-content-paths: |
tests/omp/*
some-file.txt
a2draft
something/that/isnt/there
secrets: inherit
51 changes: 19 additions & 32 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,28 @@
name: Test Workflow
on:
workflow_dispatch:
workflow_call:
inputs:
acl:
additional-artifact-content-paths:
type: string
required: true
default: u:someone:rwx,g:some_group:rwx,d:u:someone:rwx,d:g:some_group:rwx
required: false
jobs:
groups:
rsync:
name: Rsync
runs-on: ubuntu-latest
env:
TEST_OUTPUT_LOCAL_LOCATION: /opt/test-output
steps:
- uses: actions/checkout@v4
- name: Setup SSH
id: ssh
uses: access-nri/actions/.github/actions/setup-ssh@main
with:
hosts: |
${{ secrets.HOST }}
${{ secrets.HOST_DATA }}
private-key: ${{ secrets.KEY }}

- id: user
- name: rsync
run: |
acl="${{ inputs.acl }}"
user_regex="(?:d:)?u:([A-Za-z_]+):[rwx-]{3}"
user_regex_groups=()
if [[ $acl =~ $user_regex ]]; then
user_regex_groups+=${BASH_REMATCH[0]}
user_regex_groups+=${BASH_REMATCH[1]}
else
echo "No match"
fi
echo ${user_regex_groups[*]}
- id: group
run: |
acl="${{ inputs.acl }}"
group_regex="(?:d:)?g:([A-Za-z_]+):[rwx-]{3}"
group_regex_groups=()
if [[ $acl =~ $group_regex ]]; then
group_regex_groups+=${BASH_REMATCH[0]}
group_regex_groups+=${BASH_REMATCH[1]}
else
echo "No match"
fi
echo ${group_regex_groups[*]}
for path in ${{ inputs.additional-artifact-content-paths }}; do
echo "Going to rsync ${{ vars.ROOT_DIR }}/$path to ${{ env.TEST_OUTPUT_LOCAL_LOCATION }}"
done

0 comments on commit 5f10e51

Please sign in to comment.