mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 01:30:21 +00:00
Merge pull request #2052 from dmurphy18/fix_bt2049
Updated URLs in README, and fix deps download issue on RedHat family
This commit is contained in:
commit
40e91846d8
6 changed files with 123 additions and 77 deletions
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
|
@ -180,6 +180,21 @@ jobs:
|
|||
|
||||
|
||||
|
||||
debian-12:
|
||||
name: Debian 12
|
||||
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
|
||||
uses: ./.github/workflows/test-linux.yml
|
||||
needs:
|
||||
- lint
|
||||
- generate-actions-workflow
|
||||
with:
|
||||
distro-slug: debian-12
|
||||
display-name: Debian 12
|
||||
container-slug: systemd-debian-12
|
||||
timeout: 20
|
||||
instances: '["stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]'
|
||||
|
||||
|
||||
photon-5:
|
||||
name: Photon OS 5
|
||||
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
|
||||
|
@ -237,7 +252,7 @@ jobs:
|
|||
display-name: Ubuntu 22.04
|
||||
container-slug: systemd-ubuntu-22.04
|
||||
timeout: 20
|
||||
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-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"]'
|
||||
|
||||
|
||||
set-pipeline-exit-status:
|
||||
|
@ -252,6 +267,7 @@ jobs:
|
|||
- macos-13
|
||||
- macos-14
|
||||
- windows-2022
|
||||
- debian-12
|
||||
- photon-5
|
||||
- rockylinux-8
|
||||
- rockylinux-9
|
||||
|
|
18
.github/workflows/templates/generate.py
vendored
18
.github/workflows/templates/generate.py
vendored
|
@ -18,6 +18,7 @@ os.chdir(os.path.abspath(os.path.dirname(__file__)))
|
|||
# "ubuntu-2004",
|
||||
# "ubuntu-2404",
|
||||
LINUX_DISTROS = [
|
||||
"debian-12",
|
||||
"photon-5",
|
||||
"rockylinux-8",
|
||||
"rockylinux-9",
|
||||
|
@ -38,15 +39,14 @@ OSX = [
|
|||
# will add these when they become available with systemd
|
||||
# "amazonlinux-2",
|
||||
# "amazonlinux-2023",
|
||||
# "centos-stream9",
|
||||
# "debian-11",
|
||||
# "debian-12",
|
||||
# "debian-13",
|
||||
# "fedora-40",
|
||||
# "photon-4",
|
||||
# "ubuntu-2004",
|
||||
# "ubuntu-2404",
|
||||
STABLE_DISTROS = [
|
||||
"debian-12",
|
||||
"photon-5",
|
||||
"rockylinux-8",
|
||||
"rockylinux-9",
|
||||
|
@ -58,13 +58,13 @@ STABLE_DISTROS = [
|
|||
# "amazonlinux-2",
|
||||
# "amazonlinux-2023",
|
||||
# "debian-11",
|
||||
# "debian-12",
|
||||
# "debian-13",
|
||||
# "fedora-40",
|
||||
# "photon-4",
|
||||
# "ubuntu-2004",
|
||||
# "ubuntu-2404",
|
||||
ONEDIR_DISTROS = [
|
||||
"debian-12",
|
||||
"photon-5",
|
||||
"rockylinux-8",
|
||||
"rockylinux-9",
|
||||
|
@ -75,12 +75,12 @@ ONEDIR_DISTROS = [
|
|||
# will add these when they become available with systemd
|
||||
# "amazonlinux-2",
|
||||
# "amazonlinux-2023",
|
||||
# "debian-12",
|
||||
# "photon-4",
|
||||
# "photon-5",
|
||||
# "rockylinux-9",
|
||||
# "rockylinux-8",
|
||||
# "ubuntu-2404",
|
||||
ONEDIR_RC_DISTROS = [
|
||||
"debian-12",
|
||||
"photon-5",
|
||||
"rockylinux-9",
|
||||
"ubuntu-2204",
|
||||
|
@ -97,6 +97,7 @@ BLACKLIST_3007 = [
|
|||
"photon-5",
|
||||
]
|
||||
|
||||
# "ubuntu-2204",
|
||||
BLACKLIST_GIT_3006 = [
|
||||
"amazonlinux-2",
|
||||
"amazonlinux-2023",
|
||||
|
@ -107,10 +108,10 @@ BLACKLIST_GIT_3006 = [
|
|||
"photon-5",
|
||||
"rockylinux-9",
|
||||
"ubuntu-2004",
|
||||
"ubuntu-2204",
|
||||
"ubuntu-2404",
|
||||
]
|
||||
|
||||
# "ubuntu-2204",
|
||||
BLACKLIST_GIT_3007 = [
|
||||
"amazonlinux-2",
|
||||
"amazonlinux-2023",
|
||||
|
@ -122,13 +123,16 @@ BLACKLIST_GIT_3007 = [
|
|||
"photon-5",
|
||||
"rockylinux-9",
|
||||
"ubuntu-2004",
|
||||
"ubuntu-2204",
|
||||
"ubuntu-2404",
|
||||
]
|
||||
|
||||
BLACKLIST_GIT_MASTER = [
|
||||
"amazonlinux-2",
|
||||
"amazonlinux-2023",
|
||||
"debian-11",
|
||||
"debian-12",
|
||||
"debian-13",
|
||||
"fedora-40",
|
||||
"photon-4",
|
||||
"photon-5",
|
||||
"rockylinux-9",
|
||||
|
|
64
README.rst
64
README.rst
|
@ -59,8 +59,9 @@ If you're looking for a *one-liner* to install Salt, please scroll to the bottom
|
|||
instructions for `Installing via an Insecure One-Liner`_.
|
||||
|
||||
There are also .sha256 files for verifying against in the repo for the stable branch. You can also
|
||||
get the correct sha256 sum for the stable release from https://bootstrap.saltproject.io/sha256 and
|
||||
https://winbootstrap.saltproject.io/sha256
|
||||
get the correct sha256 sum for the stable release from
|
||||
https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh.sha256 and
|
||||
https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.ps1.sha256
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
@ -86,9 +87,9 @@ To view the latest options and descriptions for ``salt-bootstrap``, use ``-h`` a
|
|||
- stable Install latest stable release. This is the default
|
||||
install type
|
||||
- stable [branch] Install latest version on a branch. Only supported
|
||||
for packages available at repo.saltproject.io
|
||||
for packages available at packages.broadcom.com
|
||||
- stable [version] Install a specific version. Only supported for
|
||||
packages available at repo.saltproject.io
|
||||
packages available at packages.broadcom.com
|
||||
To pin a 3xxx minor version, specify it as 3xxx.0
|
||||
- testing RHEL-family specific: configure EPEL testing repo
|
||||
- git Install from the head of the master branch
|
||||
|
@ -171,8 +172,8 @@ To view the latest options and descriptions for ``salt-bootstrap``, use ``-h`` a
|
|||
on the system.
|
||||
-R Specify a custom repository URL. Assumes the custom repository URL
|
||||
points to a repository that mirrors Salt packages located at
|
||||
repo.saltproject.io. The option passed with -R replaces the
|
||||
"repo.saltproject.io". If -R is passed, -r is also set. Currently only
|
||||
packages.broadcom.com. The option passed with -R replaces the
|
||||
"packages.broadcom.com". If -R is passed, -r is also set. Currently only
|
||||
works on CentOS/RHEL and Debian based distributions.
|
||||
-J Replace the Master config file with data passed in as a JSON string. If
|
||||
a Master config file is found, a reasonable effort will be made to save
|
||||
|
@ -208,35 +209,35 @@ If you want to install a package of a specific release version, from the Salt Pr
|
|||
|
||||
.. code:: console
|
||||
|
||||
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
||||
curl -o bootstrap-salt.sh -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh -P stable 3006.1
|
||||
|
||||
If you want to install a specific release version, based on the Git tags:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
||||
curl -o bootstrap-salt.sh -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh git v3006.1
|
||||
|
||||
Using ``curl`` to install latest development version from GitHub:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
||||
curl -o bootstrap-salt.sh -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh git master
|
||||
|
||||
To install a specific branch from a Git fork:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
||||
curl -o bootstrap-salt.sh -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh -g https://github.com/myuser/salt.git git mybranch
|
||||
|
||||
If all you want is to install a ``salt-master`` using latest Git:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
||||
curl -o bootstrap-salt.sh -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh -M -N git master
|
||||
|
||||
If your host has Internet access only via HTTP proxy, from the Salt Project repo:
|
||||
|
@ -244,7 +245,7 @@ If your host has Internet access only via HTTP proxy, from the Salt Project repo
|
|||
.. code:: console
|
||||
|
||||
PROXY='http://user:password@myproxy.example.com:3128'
|
||||
curl -o bootstrap-salt.sh -L -x "$PROXY" https://bootstrap.saltproject.io
|
||||
curl -o bootstrap-salt.sh -L -x "$PROXY" https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh -P -H "$PROXY" stable
|
||||
|
||||
If your host has Internet access only via HTTP proxy, installing via Git:
|
||||
|
@ -252,7 +253,7 @@ If your host has Internet access only via HTTP proxy, installing via Git:
|
|||
.. code:: console
|
||||
|
||||
PROXY='http://user:password@myproxy.example.com:3128'
|
||||
curl -o bootstrap-salt.sh -L -x "$PROXY" https://bootstrap.saltproject.io
|
||||
curl -o bootstrap-salt.sh -L -x "$PROXY" https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh -H "$PROXY" git
|
||||
|
||||
|
||||
|
@ -263,22 +264,22 @@ Using ``wget`` to install your distribution's stable packages:
|
|||
|
||||
.. code:: console
|
||||
|
||||
wget -O bootstrap-salt.sh https://bootstrap.saltproject.io
|
||||
wget -O bootstrap-salt.sh https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh
|
||||
|
||||
Installing a specific version from git using ``wget``:
|
||||
|
||||
.. code:: console
|
||||
|
||||
wget -O bootstrap-salt.sh https://bootstrap.saltproject.io
|
||||
sudo sh bootstrap-salt.sh git v3004.1
|
||||
wget -O bootstrap-salt.sh https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh git v3006.8
|
||||
|
||||
Installing a specific version package from the Salt Project repo using ``wget``:
|
||||
|
||||
.. code:: console
|
||||
|
||||
wget -O bootstrap-salt.sh https://bootstrap.saltproject.io
|
||||
sudo sh bootstrap-salt.sh -P stable 3006.1
|
||||
wget -O bootstrap-salt.sh https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh -P stable 3006.8
|
||||
|
||||
**NOTE**
|
||||
|
||||
|
@ -293,14 +294,14 @@ If you already have Python installed, ``python 3.10``, then it's as easy as:
|
|||
|
||||
.. code:: console
|
||||
|
||||
python -m urllib "https://bootstrap.saltproject.io" > bootstrap-salt.sh
|
||||
python -m urllib "https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh" > bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh -P stable 3006.1
|
||||
|
||||
With python version 3:
|
||||
|
||||
.. code:: console
|
||||
|
||||
python3 -c 'import urllib.request; print(urllib.request.urlopen("https://bootstrap.saltproject.io").read().decode("ascii"))' > bootstrap-salt.sh
|
||||
python3 -c 'import urllib.request; print(urllib.request.urlopen("https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh").read().decode("ascii"))' > bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh git v3006.1
|
||||
|
||||
Note: Python 2.x is no longer supported given it reached it's End-Of-Life Jan. 1st, 2020
|
||||
|
@ -323,25 +324,25 @@ Installing the latest stable release of Salt (default):
|
|||
|
||||
.. code:: console
|
||||
|
||||
curl -L https://bootstrap.saltproject.io | sudo sh
|
||||
curl -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh | sudo sh
|
||||
|
||||
Using ``wget`` to install your distribution's stable packages:
|
||||
|
||||
.. code:: console
|
||||
|
||||
wget -O - https://bootstrap.saltproject.io | sudo sh
|
||||
wget -O - https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh | sudo sh
|
||||
|
||||
Installing a target version package of Salt from the Salt Project repo:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -L https://bootstrap.saltproject.io | sudo sh -s -- stable 3006.8
|
||||
curl -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh | sudo sh -s -- stable 3006.8
|
||||
|
||||
Installing the latest master branch of Salt from git:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -L https://bootstrap.saltproject.io | sudo sh -s -- git master
|
||||
curl -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh | sudo sh -s -- git master
|
||||
|
||||
Note: use of git is recommended for development environments, for example: testing new features of
|
||||
Salt which have not yet been released.
|
||||
|
@ -356,9 +357,8 @@ Using ``PowerShell`` to install latest stable version:
|
|||
.. code:: powershell
|
||||
|
||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls12'
|
||||
Invoke-WebRequest -Uri https://winbootstrap.saltproject.io -OutFile "$env:TEMP\bootstrap-salt.ps1"
|
||||
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
||||
& "$env:TEMP\bootstrap-salt.ps1"
|
||||
Invoke-WebRequest -Uri https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.ps1 -OutFile "$env:TEMP\bootstrap-salt.ps1"
|
||||
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser & "$env:TEMP\bootstrap-salt.ps1"
|
||||
|
||||
Display information about the install script parameters:
|
||||
|
||||
|
@ -370,7 +370,7 @@ Using ``cygwin`` to install latest stable version:
|
|||
|
||||
.. code:: console
|
||||
|
||||
curl -o bootstrap-salt.ps1 -L https://winbootstrap.saltproject.io
|
||||
curl -o bootstrap-salt.ps1 -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.ps1
|
||||
"/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0/powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ./bootstrap-salt.ps1"
|
||||
|
||||
|
||||
|
@ -380,13 +380,13 @@ Supported Operating Systems
|
|||
The salt-bootstrap script officially supports the distributions outlined in
|
||||
`Salt's Supported Operating Systems
|
||||
<https://docs.saltproject.io/salt/install-guide/en/latest/topics/salt-supported-operating-systems.html>`_
|
||||
document, (BSD-based OSs, Solaris and AIX are no longer
|
||||
supported). The operating systems listed below should reflect this document but may become out of
|
||||
date. If an operating system is listed below, but is not listed on the official supported operating
|
||||
document, (BSD-based OSs, Solaris and AIX are no longer supported).
|
||||
The operating systems listed below should reflect this document but may become out of date.
|
||||
If an operating system is listed below, but is not listed on the official supported operating
|
||||
systems document, the level of support is "best-effort".
|
||||
|
||||
Since Salt is written in Python, the packages available from the `Salt Project's repository
|
||||
<https://repo.saltproject.io/salt/py3>`_ are
|
||||
<packages.broadcom.com>`_ are
|
||||
CPU architecture independent and could be installed on any hardware supported by Linux kernel.
|
||||
However, the Salt Project does package Salt's binary dependencies only for ``x86_64`` (``amd64``)
|
||||
and ``AArch64`` (``arm64``).
|
||||
|
|
|
@ -39,7 +39,8 @@
|
|||
Salt Bootstrap GitHub Project (script home) - https://github.com/saltstack/salt-bootstrap
|
||||
Original Vagrant Provisioner Project - https://github.com/saltstack/salty-vagrant
|
||||
Vagrant Project (utilizes this script) - https://github.com/mitchellh/vagrant
|
||||
Salt Download Location - https://repo.saltproject.io/salt/py3/windows
|
||||
Salt Download Location - https://packages.broadcom.com/artifactory/saltproject-generic/windows/
|
||||
Salt Manual Install Directions (Windows) - https://docs.saltproject.io/salt/install-guide/en/latest/topics/install-by-operating-system/windows.html
|
||||
#>
|
||||
|
||||
#===============================================================================
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#======================================================================================================================
|
||||
set -o nounset # Treat unset variables as an error
|
||||
|
||||
__ScriptVersion="2024.11.21"
|
||||
__ScriptVersion="2024.11.25"
|
||||
__ScriptName="bootstrap-salt.sh"
|
||||
|
||||
__ScriptFullName="$0"
|
||||
|
@ -544,8 +544,8 @@ __exit_cleanup() {
|
|||
echodebug "Cleaning up the Salt Temporary Git Repository"
|
||||
# shellcheck disable=SC2164
|
||||
cd "${__SALT_GIT_CHECKOUT_PARENT_DIR}"
|
||||
rm -rf "${_SALT_GIT_CHECKOUT_DIR}"
|
||||
#rm -rf "${_SALT_GIT_CHECKOUT_DIR}/deps"
|
||||
rm -fR "${_SALT_GIT_CHECKOUT_DIR}"
|
||||
#rm -fR "${_SALT_GIT_CHECKOUT_DIR}/deps"
|
||||
else
|
||||
echowarn "Not cleaning up the Salt Temporary git repository on request"
|
||||
echowarn "Note that if you intend to re-run this script using the git approach, you might encounter some issues"
|
||||
|
@ -601,7 +601,6 @@ fi
|
|||
echoinfo "Running version: ${__ScriptVersion}"
|
||||
echoinfo "Executed by: ${CALLER}"
|
||||
echoinfo "Command line: '${__ScriptFullName} ${__ScriptArgs}'"
|
||||
echowarn "Running the unstable version of ${__ScriptName}"
|
||||
|
||||
# Defaults
|
||||
STABLE_REV="latest"
|
||||
|
@ -2094,6 +2093,7 @@ __tdnf_install_noinput() {
|
|||
# DESCRIPTION: (DRY) Helper function to clone and checkout salt to a
|
||||
# specific revision.
|
||||
#----------------------------------------------------------------------------------------------------------------------
|
||||
# shellcheck disable=SC2120
|
||||
__git_clone_and_checkout() {
|
||||
|
||||
echodebug "Installed git version: $(git --version | awk '{ print $3 }')"
|
||||
|
@ -2102,6 +2102,12 @@ __git_clone_and_checkout() {
|
|||
export GIT_SSL_NO_VERIFY=1
|
||||
fi
|
||||
|
||||
if [ "$(echo "$GIT_REV" | grep -E '^(3006|3007)$')" != "" ]; then
|
||||
GIT_REV_ADJ="$GIT_REV.x" # branches are 3006.x or 3007.x
|
||||
else
|
||||
GIT_REV_ADJ="$GIT_REV"
|
||||
fi
|
||||
|
||||
__SALT_GIT_CHECKOUT_PARENT_DIR=$(dirname "${_SALT_GIT_CHECKOUT_DIR}" 2>/dev/null)
|
||||
__SALT_GIT_CHECKOUT_PARENT_DIR="${__SALT_GIT_CHECKOUT_PARENT_DIR:-/tmp/git}"
|
||||
__SALT_CHECKOUT_REPONAME="$(basename "${_SALT_GIT_CHECKOUT_DIR}" 2>/dev/null)"
|
||||
|
@ -2130,15 +2136,15 @@ __git_clone_and_checkout() {
|
|||
git fetch --tags upstream
|
||||
fi
|
||||
|
||||
echodebug "Hard reseting the cloned repository to ${GIT_REV}"
|
||||
git reset --hard "$GIT_REV" || return 1
|
||||
echodebug "Hard reseting the cloned repository to ${GIT_REV_ADJ}"
|
||||
git reset --hard "$GIT_REV_ADJ" || return 1
|
||||
|
||||
# Just calling `git reset --hard $GIT_REV` on a branch name that has
|
||||
# Just calling `git reset --hard $GIT_REV_ADJ` on a branch name that has
|
||||
# already been checked out will not update that branch to the upstream
|
||||
# HEAD; instead it will simply reset to itself. Check the ref to see
|
||||
# if it is a branch name, check out the branch, and pull in the
|
||||
# changes.
|
||||
if git branch -a | grep -q "${GIT_REV}"; then
|
||||
if git branch -a | grep -q "${GIT_REV_ADJ}"; then
|
||||
echodebug "Rebasing the cloned repository branch"
|
||||
git pull --rebase || return 1
|
||||
fi
|
||||
|
@ -2160,16 +2166,16 @@ __git_clone_and_checkout() {
|
|||
# cloning we need actually works
|
||||
if [ "$(git clone 2>&1 | grep 'single-branch')" != "" ]; then
|
||||
# The "--single-branch" option is supported, attempt shallow cloning
|
||||
echoinfo "Attempting to shallow clone $GIT_REV from Salt's repository ${_SALT_REPO_URL}"
|
||||
echoinfo "Attempting to shallow clone $GIT_REV_ADJ from Salt's repository ${_SALT_REPO_URL}"
|
||||
## Shallow cloning is resulting in the wrong version of Salt, even with a depth of 5
|
||||
## getting 3007.0+0na.246d066 when it should be 3007.1+410.g246d066457, disabling for now
|
||||
## if git clone --depth 1 --branch "$GIT_REV" "$_SALT_REPO_URL" "$__SALT_CHECKOUT_REPONAME"; then
|
||||
echodebug "git command, git clone --branch $GIT_REV $_SALT_REPO_URL $__SALT_CHECKOUT_REPONAME"
|
||||
if git clone --branch "$GIT_REV" "$_SALT_REPO_URL" "$__SALT_CHECKOUT_REPONAME"; then
|
||||
## if git clone --depth 1 --branch "$GIT_REV_ADJ" "$_SALT_REPO_URL" "$__SALT_CHECKOUT_REPONAME"; then
|
||||
echodebug "git command, git clone --branch $GIT_REV_ADJ $_SALT_REPO_URL $__SALT_CHECKOUT_REPONAME"
|
||||
if git clone --branch "$GIT_REV_ADJ" "$_SALT_REPO_URL" "$__SALT_CHECKOUT_REPONAME"; then
|
||||
# shellcheck disable=SC2164
|
||||
cd "${_SALT_GIT_CHECKOUT_DIR}"
|
||||
__SHALLOW_CLONE=$BS_TRUE
|
||||
echoinfo "shallow path (disabled shallow) git cloned $GIT_REV, version $(python3 salt/version.py)"
|
||||
echoinfo "shallow path (disabled shallow) git cloned $GIT_REV_ADJ, version $(python3 salt/version.py)"
|
||||
else
|
||||
# Shallow clone above failed(missing upstream tags???), let's resume the old behaviour.
|
||||
echowarn "Failed to shallow clone."
|
||||
|
@ -2188,7 +2194,7 @@ __git_clone_and_checkout() {
|
|||
# shellcheck disable=SC2164
|
||||
cd "${_SALT_GIT_CHECKOUT_DIR}"
|
||||
|
||||
echoinfo "git cloned $GIT_REV, version $(python3 salt/version.py)"
|
||||
echoinfo "git cloned $GIT_REV_ADJ, version $(python3 salt/version.py)"
|
||||
|
||||
if ! echo "$_SALT_REPO_URL" | grep -q -F -w "${_SALTSTACK_REPO_URL#*://}"; then
|
||||
# We need to add the saltstack repository as a remote and fetch tags for proper versioning
|
||||
|
@ -2198,14 +2204,14 @@ __git_clone_and_checkout() {
|
|||
echodebug "Fetching upstream (SaltStack's Salt repository) git tags"
|
||||
git fetch --tags upstream || return 1
|
||||
|
||||
# Check if GIT_REV is a remote branch or just a commit hash
|
||||
if git branch -r | grep -q -F -w "origin/$GIT_REV"; then
|
||||
GIT_REV="origin/$GIT_REV"
|
||||
# Check if GIT_REV_ADJ is a remote branch or just a commit hash
|
||||
if git branch -r | grep -q -F -w "origin/$GIT_REV_ADJ"; then
|
||||
GIT_REV_ADJ="origin/$GIT_REV_ADJ"
|
||||
fi
|
||||
fi
|
||||
|
||||
echodebug "Checking out $GIT_REV"
|
||||
git checkout "$GIT_REV" || return 1
|
||||
echodebug "Checking out $GIT_REV_ADJ"
|
||||
git checkout "$GIT_REV_ADJ" || return 1
|
||||
fi
|
||||
|
||||
fi
|
||||
|
@ -2801,12 +2807,23 @@ EOM
|
|||
if [ ${DISTRO_NAME_L} = "ubuntu" ] && [ "$DISTRO_MAJOR_VERSION" -eq 22 ]; then
|
||||
echodebug "Ubuntu 22.04 has problem with base.txt requirements file, not parsing sys_platform == 'win32', upgrading from default pip works"
|
||||
echodebug "${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --upgrade pip"
|
||||
${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --upgrade pip || (echo "Failed to upgrade pip" && return 1)
|
||||
${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --upgrade pip
|
||||
# shellcheck disable=SC2181
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to upgrade pip"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echoinfo "Downloading Salt Dependencies from PyPi"
|
||||
echodebug "Running '${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} .'"
|
||||
${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} . || (echo "Failed to download salt dependencies" && return 1)
|
||||
${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} .
|
||||
# shellcheck disable=SC2181
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to download salt dependencies"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
echoinfo "Installing Downloaded Salt Dependencies"
|
||||
echodebug "Running '${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed ${_PIP_INSTALL_ARGS} /tmp/git/deps/*'"
|
||||
|
@ -3120,7 +3137,7 @@ install_ubuntu_deps() {
|
|||
# Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813
|
||||
__PACKAGES="${__PACKAGES} procps pciutils"
|
||||
|
||||
# ensure sudo installed
|
||||
# ensure sudo, ps installed
|
||||
__PACKAGES="${__PACKAGES} sudo"
|
||||
|
||||
## include hwclock if not part of base OS (23.10 and up)
|
||||
|
@ -3189,6 +3206,7 @@ install_ubuntu_git_deps() {
|
|||
__apt_get_install_noinput ca-certificates
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2119
|
||||
__git_clone_and_checkout || return 1
|
||||
|
||||
if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then
|
||||
|
@ -3206,6 +3224,9 @@ install_ubuntu_git_deps() {
|
|||
__PACKAGES="${__PACKAGES} util-linux-extra"
|
||||
fi
|
||||
|
||||
# Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813
|
||||
__PACKAGES="${__PACKAGES} procps pciutils"
|
||||
|
||||
# ensure sudo installed
|
||||
__PACKAGES="${__PACKAGES} sudo"
|
||||
|
||||
|
@ -3643,6 +3664,7 @@ install_debian_git_deps() {
|
|||
__apt_get_install_noinput ca-certificates
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2119
|
||||
__git_clone_and_checkout || return 1
|
||||
|
||||
if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then
|
||||
|
@ -3653,6 +3675,9 @@ install_debian_git_deps() {
|
|||
__PACKAGES="python${PY_PKG_VER}-dev python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc"
|
||||
echodebug "install_debian_git_deps() Installing ${__PACKAGES}"
|
||||
|
||||
# Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813
|
||||
__PACKAGES="${__PACKAGES} procps pciutils"
|
||||
|
||||
# ensure sudo installed
|
||||
__PACKAGES="${__PACKAGES} sudo"
|
||||
|
||||
|
@ -3988,6 +4013,7 @@ install_fedora_git_deps() {
|
|||
__PACKAGES=""
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2119
|
||||
__git_clone_and_checkout || return 1
|
||||
|
||||
__PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc gcc-c++"
|
||||
|
@ -4398,6 +4424,7 @@ install_centos_git_deps() {
|
|||
__yum_install_noinput git || return 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2119
|
||||
__git_clone_and_checkout || return 1
|
||||
|
||||
__PACKAGES=""
|
||||
|
@ -5443,6 +5470,7 @@ install_alpine_linux_git_deps() {
|
|||
apk -U add git || return 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2119
|
||||
__git_clone_and_checkout || return 1
|
||||
|
||||
apk -U add python3 python3-dev py3-pip py3-setuptools g++ linux-headers zeromq-dev openrc || return 1
|
||||
|
@ -5609,6 +5637,7 @@ install_amazon_linux_ami_2_git_deps() {
|
|||
__yum_install_noinput git || return 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2119
|
||||
__git_clone_and_checkout || return 1
|
||||
|
||||
__PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools python${PY_PKG_VER}-devel gcc"
|
||||
|
@ -5828,6 +5857,7 @@ install_amazon_linux_ami_2023_git_deps() {
|
|||
__yum_install_noinput git || return 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2119
|
||||
__git_clone_and_checkout || return 1
|
||||
|
||||
__PACKAGES="python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools python${PY_PKG_VER}-devel gcc"
|
||||
|
@ -6015,6 +6045,7 @@ install_arch_linux_git_deps() {
|
|||
pacman -Sy --noconfirm --needed git || return 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2119
|
||||
__git_clone_and_checkout || return 1
|
||||
|
||||
if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 2 ]; then
|
||||
|
@ -6398,6 +6429,7 @@ install_photon_git_deps() {
|
|||
__PACKAGES=""
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2119
|
||||
__git_clone_and_checkout || return 1
|
||||
|
||||
__PACKAGES="python${PY_PKG_VER}-devel python${PY_PKG_VER}-pip python${PY_PKG_VER}-setuptools gcc glibc-devel linux-devel.x86_64 cython${PY_PKG_VER}"
|
||||
|
@ -6757,6 +6789,7 @@ install_opensuse_git_deps() {
|
|||
__zypper_install git || return 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2119
|
||||
__git_clone_and_checkout || return 1
|
||||
|
||||
# Check for Tumbleweed
|
||||
|
@ -6991,6 +7024,7 @@ install_opensuse_15_git_deps() {
|
|||
__zypper_install git || return 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2119
|
||||
__git_clone_and_checkout || return 1
|
||||
|
||||
if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -ne 3 ]; then
|
||||
|
@ -7246,6 +7280,7 @@ install_gentoo_git_deps() {
|
|||
echoinfo "Running emerge -v1 setuptools"
|
||||
__emerge -v1 setuptools || return 1
|
||||
|
||||
# shellcheck disable=SC2119
|
||||
__git_clone_and_checkout || return 1
|
||||
__gentoo_post_dep || return 1
|
||||
}
|
||||
|
@ -7614,6 +7649,7 @@ install_macosx_git_deps() {
|
|||
# Install PIP
|
||||
$_PYEXE /tmp/get-pip.py || return 1
|
||||
|
||||
# shellcheck disable=SC2119
|
||||
__git_clone_and_checkout || return 1
|
||||
|
||||
return 0
|
||||
|
@ -8150,6 +8186,7 @@ fi
|
|||
|
||||
|
||||
if [ "${ITYPE}" = "git" ] && [ ${_NO_DEPS} -eq ${BS_TRUE} ]; then
|
||||
# shellcheck disable=SC2119
|
||||
if ! __git_clone_and_checkout; then
|
||||
echo "Failed to clone and checkout git repository."
|
||||
exit 1
|
||||
|
|
|
@ -29,10 +29,6 @@ def run_salt_call(cmd):
|
|||
if platform.system() == "Windows":
|
||||
cmd.append("--out=json")
|
||||
result = subprocess.run(cmd, capture_output=True, text=True)
|
||||
print(
|
||||
f"DGM run_salt_call, cmd '{cmd}', result '{result}', stdout '{result.stdout}'",
|
||||
flush=True,
|
||||
)
|
||||
if 0 == result.returncode:
|
||||
json_data = json.loads(result.stdout)
|
||||
else:
|
||||
|
@ -43,10 +39,6 @@ def run_salt_call(cmd):
|
|||
cmdl.extend(cmd)
|
||||
cmdl.append("--out=json")
|
||||
result = subprocess.run(cmdl, capture_output=True, text=True)
|
||||
print(
|
||||
f"DGM run_salt_call, cmdl '{cmdl}', result '{result}', stdout '{result.stdout}'",
|
||||
flush=True,
|
||||
)
|
||||
if 0 == result.returncode:
|
||||
json_data = json.loads(result.stdout)
|
||||
else:
|
||||
|
@ -74,10 +66,6 @@ def test_target_salt_version(path, target_salt_version):
|
|||
pytest.skip(f"No target version specified")
|
||||
cmd = ["salt-call", "--local", "grains.item", "saltversion", "--timeout=120"]
|
||||
result = run_salt_call(cmd)
|
||||
dgm_saltversion = result["saltversion"]
|
||||
print(
|
||||
f"DGM test_target_salt_version, target_salt_version '{target_salt_version}', result saltversion '{dgm_saltversion }', result '{result}'",
|
||||
flush=True,
|
||||
)
|
||||
# Returns: {'saltversion': '3006.9+217.g53cfa53040'}
|
||||
assert result["saltversion"] == target_salt_version
|
||||
adj_saltversion = result["saltversion"].split("+")[0]
|
||||
assert adj_saltversion == target_salt_version
|
||||
|
|
Loading…
Add table
Reference in a new issue