mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-17 10:10:25 +00:00
Updating container usage to reflect that used in new Salt pipelines for CI/CD
This commit is contained in:
parent
fa5ae443bc
commit
ac14d1d0fe
3 changed files with 86 additions and 26 deletions
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
|
@ -190,7 +190,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
distro-slug: debian-12
|
distro-slug: debian-12
|
||||||
display-name: Debian 12
|
display-name: Debian 12
|
||||||
container-slug: systemd-debian-12
|
container-slug: debian-12
|
||||||
timeout: 20
|
timeout: 20
|
||||||
instances: '["stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]'
|
instances: '["stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]'
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
distro-slug: photon-5
|
distro-slug: photon-5
|
||||||
display-name: Photon OS 5
|
display-name: Photon OS 5
|
||||||
container-slug: systemd-photon-5
|
container-slug: photon-5
|
||||||
timeout: 20
|
timeout: 20
|
||||||
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]'
|
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]'
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
distro-slug: rockylinux-8
|
distro-slug: rockylinux-8
|
||||||
display-name: Rocky Linux 8
|
display-name: Rocky Linux 8
|
||||||
container-slug: systemd-rockylinux-8
|
container-slug: rockylinux-8
|
||||||
timeout: 20
|
timeout: 20
|
||||||
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]'
|
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]'
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
distro-slug: rockylinux-9
|
distro-slug: rockylinux-9
|
||||||
display-name: Rocky Linux 9
|
display-name: Rocky Linux 9
|
||||||
container-slug: systemd-rockylinux-9
|
container-slug: rockylinux-9
|
||||||
timeout: 20
|
timeout: 20
|
||||||
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]'
|
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]'
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
distro-slug: ubuntu-2204
|
distro-slug: ubuntu-2204
|
||||||
display-name: Ubuntu 22.04
|
display-name: Ubuntu 22.04
|
||||||
container-slug: systemd-ubuntu-22.04
|
container-slug: ubuntu-22.04
|
||||||
timeout: 20
|
timeout: 20
|
||||||
instances: '["stable-3006", "git-3006", "onedir-3006", "stable-3006-8", "stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]'
|
instances: '["stable-3006", "git-3006", "onedir-3006", "stable-3006-8", "stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]'
|
||||||
|
|
||||||
|
|
39
.github/workflows/templates/generate.py
vendored
39
.github/workflows/templates/generate.py
vendored
|
@ -216,20 +216,33 @@ DISTRO_DISPLAY_NAMES = {
|
||||||
"windows-2022": "Windows 2022",
|
"windows-2022": "Windows 2022",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
## "amazonlinux-2": "systemd-amazonlinux-2",
|
||||||
|
## "amazonlinux-2023": "systemd-amazonlinux-2023",
|
||||||
|
## "debian-11": "systemd-debian-11",
|
||||||
|
## "debian-12": "systemd-debian-12",
|
||||||
|
## "debian-13": "systemd-debian-13",
|
||||||
|
## "fedora-40": "systemd-fedora-40",
|
||||||
|
## "photon-4": "systemd-photon-4",
|
||||||
|
## "photon-5": "systemd-photon-5",
|
||||||
|
## "rockylinux-8": "systemd-rockylinux-8",
|
||||||
|
## "rockylinux-9": "systemd-rockylinux-9",
|
||||||
|
## "ubuntu-2004": "systemd-ubuntu-20.04",
|
||||||
|
## "ubuntu-2204": "systemd-ubuntu-22.04",
|
||||||
|
## "ubuntu-2404": "systemd-ubuntu-24.04",
|
||||||
CONTAINER_SLUG_NAMES = {
|
CONTAINER_SLUG_NAMES = {
|
||||||
"amazonlinux-2": "systemd-amazonlinux-2",
|
"amazonlinux-2": "amazonlinux-2",
|
||||||
"amazonlinux-2023": "systemd-amazonlinux-2023",
|
"amazonlinux-2023": "amazonlinux-2023",
|
||||||
"debian-11": "systemd-debian-11",
|
"debian-11": "debian-11",
|
||||||
"debian-12": "systemd-debian-12",
|
"debian-12": "debian-12",
|
||||||
"debian-13": "systemd-debian-13",
|
"debian-13": "debian-13",
|
||||||
"fedora-40": "systemd-fedora-40",
|
"fedora-40": "fedora-40",
|
||||||
"photon-4": "systemd-photon-4",
|
"photon-4": "photon-4",
|
||||||
"photon-5": "systemd-photon-5",
|
"photon-5": "photon-5",
|
||||||
"rockylinux-8": "systemd-rockylinux-8",
|
"rockylinux-8": "rockylinux-8",
|
||||||
"rockylinux-9": "systemd-rockylinux-9",
|
"rockylinux-9": "rockylinux-9",
|
||||||
"ubuntu-2004": "systemd-ubuntu-20.04",
|
"ubuntu-2004": "ubuntu-20.04",
|
||||||
"ubuntu-2204": "systemd-ubuntu-22.04",
|
"ubuntu-2204": "ubuntu-22.04",
|
||||||
"ubuntu-2404": "systemd-ubuntu-24.04",
|
"ubuntu-2404": "ubuntu-24.04",
|
||||||
"macos-12": "macos-12",
|
"macos-12": "macos-12",
|
||||||
"macos-13": "macos-13",
|
"macos-13": "macos-13",
|
||||||
"macos-14": "macOS 14",
|
"macos-14": "macOS 14",
|
||||||
|
|
63
.github/workflows/test-linux.yml
vendored
63
.github/workflows/test-linux.yml
vendored
|
@ -32,9 +32,9 @@ jobs:
|
||||||
Test:
|
Test:
|
||||||
name: ${{ matrix.instance }}
|
name: ${{ matrix.instance }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
## DGM container:
|
||||||
image: ghcr.io/saltstack/salt-ci-containers/testing:${{ inputs.container-slug }}
|
## DGM image: ghcr.io/saltstack/salt-ci-containers/testing:${{ inputs.container-slug }}
|
||||||
options: --privileged
|
## DGM options: --privileged
|
||||||
|
|
||||||
timeout-minutes: ${{ inputs.timeout }}
|
timeout-minutes: ${{ inputs.timeout }}
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -46,15 +46,58 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Python Dependencies with pip breakage
|
## DGM - name: Install Python Dependencies with pip breakage
|
||||||
|
## DGM if: ${{ ( inputs.distro-slug == 'debian-11' ) || ( inputs.distro-slug == 'debian-12' ) || ( inputs.distro-slug == 'debian-13' ) || ( inputs.distro-slug == 'ubuntu-2404' ) }}
|
||||||
|
## DGM run: |
|
||||||
|
## DGM python3 -m pip install --break-system-packages -r tests/requirements.txt
|
||||||
|
|
||||||
|
## DGM - name: Install Python Dependencies without pip breakage
|
||||||
|
## DGM if: ${{ ( inputs.distro-slug != 'debian-11' ) && ( inputs.distro-slug != 'debian-12' ) && ( inputs.distro-slug != 'debian-13' ) && ( inputs.distro-slug != 'ubuntu-2404' ) }}
|
||||||
|
## DGM run: |
|
||||||
|
## DGM python3 -m pip install -r tests/requirements.txt
|
||||||
|
|
||||||
|
## DGM - name: Get Version
|
||||||
|
## DGM run: |
|
||||||
|
## DGM # We need to get the version here and make it an environment variable
|
||||||
|
## DGM # It is used to install via bootstrap and in the test
|
||||||
|
## DGM # The version is in the instance name
|
||||||
|
## DGM # sed 1st - becomes space, 2nd - becomes dot
|
||||||
|
## DGM vt_parm_ver=$(echo "${{ matrix.instance }}" | sed 's/-/ /' | sed 's/-/./' | awk -F ' ' '{print $2}')
|
||||||
|
## DGM echo "SaltVersion=$vt_parm_ver" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
## DGM - name: Bootstrap Salt
|
||||||
|
## DGM run: |
|
||||||
|
## DGM # sed 1st - becomes space, 2nd - becomes dot
|
||||||
|
## DGM bt_arg1=$(echo "${{ matrix.instance }}" | sed 's/-/ /' | sed 's/-/./' | awk -F ' ' '{print $1}')
|
||||||
|
## DGM bt_arg2=$(echo "${{ matrix.instance }}" | sed 's/-/ /' | sed 's/-/./' | awk -F ' ' '{print $2}')
|
||||||
|
## DGM echo "bt parms ,$bt_parms, bt_arg1 ,$bt_arg1, bt_arg2 ,$bt_arg2,"
|
||||||
|
## DGM sh -x ./bootstrap-salt.sh "$bt_arg1" "$bt_arg2"
|
||||||
|
|
||||||
|
## DGM - name: Test Bootstrap
|
||||||
|
## DGM run: |
|
||||||
|
## DGM pytest --cache-clear -v -s -ra --log-cli-level=debug tests/integration/
|
||||||
|
|
||||||
|
- name: "Pull container ${{ inputs.container-slug }}"
|
||||||
|
run: |
|
||||||
|
docker pull ghcr.io/saltstack/salt-ci-containers/testing:${{ inputs.container-slug }}
|
||||||
|
|
||||||
|
- name: "Create container ${{ inputs.container-slug }}"
|
||||||
|
run: |
|
||||||
|
/usr/bin/docker create --name ${{ github.run_id }}_salt-test --workdir /__w/salt/salt --privileged -e "HOME=/github/home" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work":"/__w" -v "/home/runner/work/_temp":"/__w/_temp" -v "/home/runner/work/_actions":"/__w/_actions" -v "/opt/hostedtoolcache":"/__t" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" --entrypoint "/usr/lib/systemd/systemd" ghcr.io/saltstack/salt-ci-containers/testing:${{ inputs.container-slug }} --systemd --unit rescue.target
|
||||||
|
|
||||||
|
- name: "Start container ${{ inputs.container-slug }}"
|
||||||
|
run: |
|
||||||
|
/usr/bin/docker start ${{ github.run_id }}_salt-test
|
||||||
|
|
||||||
|
- name: "Install Python Dependencies with pip breakage in container ${{ inputs.container-slug }}"
|
||||||
if: ${{ ( inputs.distro-slug == 'debian-11' ) || ( inputs.distro-slug == 'debian-12' ) || ( inputs.distro-slug == 'debian-13' ) || ( inputs.distro-slug == 'ubuntu-2404' ) }}
|
if: ${{ ( inputs.distro-slug == 'debian-11' ) || ( inputs.distro-slug == 'debian-12' ) || ( inputs.distro-slug == 'debian-13' ) || ( inputs.distro-slug == 'ubuntu-2404' ) }}
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install --break-system-packages -r tests/requirements.txt
|
python3 -m pip install --break-system-packages -r tests/requirements.txt
|
||||||
|
|
||||||
- name: Install Python Dependencies without pip breakage
|
- name: "Install Python Dependencies without pip breakage in container ${{ inputs.container-slug }}"
|
||||||
if: ${{ ( inputs.distro-slug != 'debian-11' ) && ( inputs.distro-slug != 'debian-12' ) && ( inputs.distro-slug != 'debian-13' ) && ( inputs.distro-slug != 'ubuntu-2404' ) }}
|
if: ${{ ( inputs.distro-slug != 'debian-11' ) && ( inputs.distro-slug != 'debian-12' ) && ( inputs.distro-slug != 'debian-13' ) && ( inputs.distro-slug != 'ubuntu-2404' ) }}
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install -r tests/requirements.txt
|
docker exec ${{ github.run_id}}_salt-test python3 -m pip install -r tests/requirements.txt
|
||||||
|
|
||||||
- name: Get Version
|
- name: Get Version
|
||||||
run: |
|
run: |
|
||||||
|
@ -65,17 +108,21 @@ jobs:
|
||||||
vt_parm_ver=$(echo "${{ matrix.instance }}" | sed 's/-/ /' | sed 's/-/./' | awk -F ' ' '{print $2}')
|
vt_parm_ver=$(echo "${{ matrix.instance }}" | sed 's/-/ /' | sed 's/-/./' | awk -F ' ' '{print $2}')
|
||||||
echo "SaltVersion=$vt_parm_ver" >> $GITHUB_ENV
|
echo "SaltVersion=$vt_parm_ver" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Current Directory
|
||||||
|
run: |
|
||||||
|
pwd
|
||||||
|
|
||||||
- name: Bootstrap Salt
|
- name: Bootstrap Salt
|
||||||
run: |
|
run: |
|
||||||
# sed 1st - becomes space, 2nd - becomes dot
|
# sed 1st - becomes space, 2nd - becomes dot
|
||||||
bt_arg1=$(echo "${{ matrix.instance }}" | sed 's/-/ /' | sed 's/-/./' | awk -F ' ' '{print $1}')
|
bt_arg1=$(echo "${{ matrix.instance }}" | sed 's/-/ /' | sed 's/-/./' | awk -F ' ' '{print $1}')
|
||||||
bt_arg2=$(echo "${{ matrix.instance }}" | sed 's/-/ /' | sed 's/-/./' | awk -F ' ' '{print $2}')
|
bt_arg2=$(echo "${{ matrix.instance }}" | sed 's/-/ /' | sed 's/-/./' | awk -F ' ' '{print $2}')
|
||||||
echo "bt parms ,$bt_parms, bt_arg1 ,$bt_arg1, bt_arg2 ,$bt_arg2,"
|
echo "bt parms ,$bt_parms, bt_arg1 ,$bt_arg1, bt_arg2 ,$bt_arg2,"
|
||||||
sh -x ./bootstrap-salt.sh "$bt_arg1" "$bt_arg2"
|
docker exec ${{ github.run_id}}_salt-test sh -x ./bootstrap-salt.sh "$bt_arg1" "$bt_arg2"
|
||||||
|
|
||||||
- name: Test Bootstrap
|
- name: Test Bootstrap
|
||||||
run: |
|
run: |
|
||||||
pytest --cache-clear -v -s -ra --log-cli-level=debug tests/integration/
|
docker exec ${{ github.run_id}}_salt-test pytest --cache-clear -v -s -ra --log-cli-level=debug tests/integration/
|
||||||
|
|
||||||
- name: Set Exit Status
|
- name: Set Exit Status
|
||||||
if: always()
|
if: always()
|
||||||
|
|
Loading…
Add table
Reference in a new issue