Skip to content

Commit

Permalink
Supports installing python requirements files to salt runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
lorengordon committed Feb 22, 2024
1 parent db7ce07 commit bfd5d9a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/test-salt-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ on:
description: Space-separated list of paths to requirements files installed by yum, `salt-os-version` is templated as `{0}`
default: ./tests/requirements.txt ./tests/requirements-el{0}.txt
type: string
salt-python-requirements-files:
description: Space-separated list of paths to python requirements files installed by salt-pip, `salt-os-version` is templated as `{0}`
default: ''
type: string

defaults:
run:
Expand Down Expand Up @@ -56,6 +60,13 @@ jobs:
- run: salt-call --versions-report

# Install salt python requirements
- run: >-
mapfile -t PYTHON_REQUIREMENTS < <(echo ${{ format(inputs.salt-python-requirements-files, inputs.salt-os-version) }}) &&
for FILE in "${PYTHON_REQUIREMENTS[@]}"; do
salt-pip install -r "$FILE";
done
- run: >-
salt-call --local --retcode-passthrough
--file-root=${{ github.workspace }} --pillar-root=${{ inputs.salt-pillar-root }}
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/test-salt-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ on:
description: Base url to search for the salt version; `salt-version` is appended to this url
default: https://repo.saltproject.io/salt/py3/windows
type: string
salt-python-requirements-files:
description: Space-separated list of paths to python requirements files installed by salt-pip, `salt-os-version` is templated as `{0}`
default: ''
type: string

defaults:
run:
Expand Down Expand Up @@ -57,6 +61,13 @@ jobs:
shell: pwsh
- run: C:\\salt\\salt-call.exe --versions-report

# Install salt python requirements
- run: >
mapfile -t PYTHON_REQUIREMENTS < <(echo ${{ format(inputs.salt-python-requirements-files, inputs.salt-os-version) }}) &&
for FILE in "${PYTHON_REQUIREMENTS[@]}"; do
C:\\salt\\salt-pip.exe install -r "$FILE";
done
# Sync custom salt modules, if any
- run: >
C:\\salt\\salt-call.exe --local --retcode-passthrough
Expand Down

0 comments on commit bfd5d9a

Please sign in to comment.