Skip to content

Commit

Permalink
fix(ci): solve bash issues
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Dellaluce <[email protected]>
  • Loading branch information
jasondellaluce authored and poiana committed Aug 29, 2023
1 parent 38c5592 commit 1dc5272
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/reusable_validate_plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ jobs:
arch=${{ inputs.arch }}
loaded_plugins="$(cat ${{ steps.get-config.outputs.config_file }} | grep '\- name: ' | cut -d ':' -f 2 | xargs)"
sudo mkdir -p /etc/falco/falco
sudo mkdir -p /usr/share/falco/plugins
for plugin_name in $loaded_plugins; do
echo Installing locally-built plugin "$plugin_name"...
Expand All @@ -76,9 +79,7 @@ jobs:
echo Extracting archive "$archive"...
mkdir -p tmpdir && pushd tmpdir
tar -xvf $archive
sudo mkdir -p /etc/falco/falco
sudo cp -r *.yaml /etc/falco/falco || true
sudo mkdir -p /usr/share/falco/plugins
sudo cp -r *.so /usr/share/falco/plugins || true
popd && rm -fr tmpdir
done
Expand Down Expand Up @@ -164,6 +165,8 @@ jobs:
exit 0
fi
sudo mkdir -p /usr/share/falco/plugins
rules_files=$(ls ${{ steps.get-config.outputs.rules_dir }}/*)
for rules_file in $rules_files; do
deps=$(cat $rules_file | yq -r '.[].required_plugin_versions | select(. != null and . != "")[] | [.name + ":" + .version] | @csv')
Expand All @@ -189,13 +192,12 @@ jobs:
echo Installed plugin "${plugin_name}" at version "${plugin_ver}"
has_updates=1
else
echo Can't pull plugin "${plugin_name}" at version "${plugin_ver}"
echo Can\'t pull plugin "${plugin_name}" at version "${plugin_ver}"
echo Attempt installing locally-built plugin "${plugin_name}"...
for archive in $(ls /tmp/plugins-${{ inputs.arch }}/${plugin_name}-*); do
echo Extracting archive "$archive"...
mkdir -p tmpdir && pushd tmpdir
tar -xvf $archive
sudo mkdir -p /usr/share/falco/plugins
sudo cp -r *.so /usr/share/falco/plugins || true
popd && rm -fr tmpdir
done
Expand Down

0 comments on commit 1dc5272

Please sign in to comment.