mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-09 22:31:53 +00:00
Fix MacOS grep -E pattern to allow for no '.x' versions
This commit is contained in:
parent
5a704ec503
commit
0bbe715ad8
4 changed files with 6 additions and 15 deletions
3
.github/workflows/test-linux.yml
vendored
3
.github/workflows/test-linux.yml
vendored
|
@ -67,6 +67,7 @@ jobs:
|
|||
# It is used to install via bootstrap and in the test
|
||||
# The version is in the instance name
|
||||
# sed 1st - becomes space, 2nd - becomes dot
|
||||
## DGM needs cleanup
|
||||
echo "matrix instance ,${{ matrix.instance }},"
|
||||
vt_parms=$(echo "${{ matrix.instance }}" | sed 's/-/ /')
|
||||
vt_parms2=$(echo "$vt_parms" | sed 's/-/./')
|
||||
|
@ -77,13 +78,13 @@ jobs:
|
|||
- name: Bootstrap Salt
|
||||
run: |
|
||||
# sed 1st - becomes space, 2nd - becomes dot
|
||||
## DGM needs cleanup
|
||||
echo "matrix instance ,${{ matrix.instance }},"
|
||||
bt_parms=$(echo "${{ matrix.instance }}" | sed 's/-/ /')
|
||||
bt_parms2=$(echo "$bt_parms" | sed 's/-/./')
|
||||
bt_arg1=$(echo "$bt_parms2" | awk -F ' ' '{print $1}')
|
||||
bt_arg2=$(echo "$bt_parms2" | awk -F ' ' '{print $2}')
|
||||
echo "bt parms ,$bt_parms, bt_parms2 ,$bt_parms2, bt_arg1 ,$bt_arg1, bt_arg2 ,$bt_arg2,"
|
||||
## sudo sh -x ./bootstrap-salt.sh "$bt_parms2"
|
||||
sudo sh -x ./bootstrap-salt.sh "$bt_arg1" "$bt_arg2"
|
||||
|
||||
- name: Test Bootstrap
|
||||
|
|
3
.github/workflows/test-macos.yml
vendored
3
.github/workflows/test-macos.yml
vendored
|
@ -57,6 +57,7 @@ jobs:
|
|||
# It is used to install via bootstrap and in the test
|
||||
# The version is in the instance name
|
||||
# sed 1st - becomes space, 2nd - becomes dot
|
||||
## DGM needs cleanup
|
||||
echo "matrix instance ,${{ matrix.instance }},"
|
||||
vt_parms=$(echo "${{ matrix.instance }}" | sed 's/-/ /')
|
||||
vt_parms2=$(echo "$vt_parms" | sed 's/-/./')
|
||||
|
@ -67,13 +68,13 @@ jobs:
|
|||
- name: Bootstrap Salt
|
||||
run: |
|
||||
# sed 1st - becomes space, 2nd - becomes dot
|
||||
## DGM needs cleanup
|
||||
echo "matrix instance ,${{ matrix.instance }},"
|
||||
bt_parms=$(echo "${{ matrix.instance }}" | sed 's/-/ /')
|
||||
bt_parms2=$(echo "$bt_parms" | sed 's/-/./')
|
||||
bt_arg1=$(echo "$bt_parms2" | awk -F ' ' '{print $1}')
|
||||
bt_arg2=$(echo "$bt_parms2" | awk -F ' ' '{print $2}')
|
||||
echo "bt parms ,$bt_parms, bt_parms2 ,$bt_parms2, bt_arg1 ,$bt_arg1, bt_arg2 ,$bt_arg2,"
|
||||
## sudo sh -x ./bootstrap-salt.sh "$bt_parms2"
|
||||
sudo sh -x ./bootstrap-salt.sh "$bt_arg1" "$bt_arg2"
|
||||
|
||||
- name: Test Bootstrap
|
||||
|
|
|
@ -665,7 +665,7 @@ elif [ "$ITYPE" = "stable" ]; then
|
|||
_ONEDIR_REV="$1"
|
||||
ITYPE="onedir"
|
||||
shift
|
||||
elif [ "$(echo "$1" | grep -E '^([3-9][0-5]{2}[5-9](\.[0-9]*)?)')" != "" ]; then
|
||||
elif [ "$(echo "$1" | grep -E '^([3-9][0-5]{2}[6-9](\.[0-9]*)?)')" != "" ]; then
|
||||
STABLE_REV="$1"
|
||||
ONEDIR_REV="$1"
|
||||
_ONEDIR_REV="$1"
|
||||
|
@ -7453,7 +7453,7 @@ __macosx_get_packagesite_onedir() {
|
|||
SALT_MACOS_PKGDIR_URL="https://${_REPO_URL}/${_ONEDIR_TYPE}/macos"
|
||||
if [ "$(echo "$_ONEDIR_REV" | grep -E '^(latest)$')" != "" ]; then
|
||||
__macosx_get_packagesite_onedir_latest
|
||||
elif [ "$(echo "$_ONEDIR_REV" | grep -E '^([3-9][0-9]{3}(\.[0-9]*))')" != "" ]; then
|
||||
elif [ "$(echo "$_ONEDIR_REV" | grep -E '^([3-9][0-9]{3}(\.[0-9]*)?)')" != "" ]; then
|
||||
_PKG_VERSION=$_ONEDIR_REV
|
||||
else
|
||||
__macosx_get_packagesite_onedir_latest
|
||||
|
|
|
@ -18,12 +18,6 @@ def target_python_version():
|
|||
def target_salt_version():
|
||||
|
||||
target_salt = os.environ.get("SaltVersion", "")
|
||||
|
||||
print(
|
||||
f"DGM conftest target_salt_version, target_salt '{target_salt}', os.environ '{os.environ}'",
|
||||
flush=True,
|
||||
)
|
||||
|
||||
html_response = requests.get(API_URL)
|
||||
content = json.loads(html_response.text)
|
||||
folders = content["children"]
|
||||
|
@ -37,11 +31,6 @@ def target_salt_version():
|
|||
versions[maj_version] = version
|
||||
versions["latest"] = version
|
||||
|
||||
print(
|
||||
f"DGM conftest target_salt_version, target_salt '{target_salt}', versions '{versions}'",
|
||||
flush=True,
|
||||
)
|
||||
|
||||
if target_salt.startswith("v"):
|
||||
target_salt = target_salt[1:]
|
||||
if target_salt not in versions:
|
||||
|
|
Loading…
Add table
Reference in a new issue