From 26010c82c0440b40612a556abc033d39efaf7d0e Mon Sep 17 00:00:00 2001 From: Bryce Larson Date: Tue, 23 Jun 2020 15:41:21 -0600 Subject: [PATCH 01/22] add sha for 2020.06.23 release --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index 9ee048d..616c9ae 100644 --- a/README.rst +++ b/README.rst @@ -30,6 +30,7 @@ sum** of the downloaded ``bootstrap-salt.sh`` file. The SHA256 sum of the ``bootstrap-salt.sh`` file, per release, is: +- 2020.06.23: ``1d07db867c195c864d0ae70664524f2099cc9a46872953293c67c3f239d4f4f5`` - 2020.05.28: ``6b3ea15c78f01060ab12fc01c0bb18480eaf36858c7ba188b200c0fb11aac173`` - 2020.02.24: ``efc46700aca78b8e51d7af9b06293f52ad495f3a8179c6bfb21a8c97ee41f1b7`` - 2020.02.04: ``ce877651b4938e3480f76b1629f582437f6ca8b73d7199fdb9e905e86fe85b34`` From 5bf3bad0c8cd4e5a70b67566f22000fcda3fafb3 Mon Sep 17 00:00:00 2001 From: krion Date: Fri, 17 Jul 2020 20:02:58 +0200 Subject: [PATCH 02/22] Fix v3000+ with git install on FreeBSD --- bootstrap-salt.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 8c6af88..af9039a 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -5746,6 +5746,7 @@ install_arch_check_services() { # Using a separate conf step to head for idempotent install... __configure_freebsd_pkg_details() { _SALT_ETC_DIR="/usr/local/etc/salt" + _POST_NEON_PIP_INSTALL_ARGS="--prefix=/usr/local" } install_freebsd_deps() { @@ -5769,7 +5770,7 @@ install_freebsd_git_deps() { /usr/local/sbin/pkg install -y py37-requests || return 1 else - /usr/local/sbin/pkg install -y python python-pip python-setuptools || return 1 + /usr/local/sbin/pkg install -y python py37-pip py37-setuptools libzmq4 libunwind || return 1 fi echodebug "Adapting paths to FreeBSD" @@ -5828,6 +5829,13 @@ install_freebsd_git() { if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then __install_salt_from_repo_post_neon "${__PYTHON_PATH}" || return 1 + for script in salt_api salt_master salt_minion salt_proxy salt_syndic; do + __fetch_url "/usr/local/etc/rc.d/${script}" "https://raw.githubusercontent.com/freebsd/freebsd-ports/master/sysutils/py-salt/files/${script}.in" || return 1 + sed -i '' 's/%%PREFIX%%/\/usr\/local/g' /usr/local/etc/rc.d/${script} + sed -i '' "s/%%PYTHON_CMD%%/${__ESCAPED_PYTHON_PATH}/g" /usr/local/etc/rc.d/${script} + chmod +x /usr/local/etc/rc.d/${script} || return 1 + done + return 0 fi From b466af42f02666f951857cc4ffacc331dc63e76f Mon Sep 17 00:00:00 2001 From: mbochenk Date: Thu, 6 Aug 2020 13:16:16 +0300 Subject: [PATCH 03/22] Added missing functions for Red Hat 8.x --- bootstrap-salt.sh | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index af9039a..2f593a6 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4541,6 +4541,16 @@ install_red_hat_linux_git_deps() { return 0 } +install_red_hat_enterprise_stable_deps() { + install_red_hat_linux_stable_deps || return 1 + return 0 +} + +install_red_hat_enterprise_git_deps() { + install_red_hat_linux_git_deps || return 1 + return 0 +} + install_red_hat_enterprise_linux_stable_deps() { install_red_hat_linux_stable_deps || return 1 return 0 @@ -4581,6 +4591,16 @@ install_red_hat_linux_git() { return 0 } +install_red_hat_enterprise_stable() { + install_red_hat_linux_stable || return 1 + return 0 +} + +install_red_hat_enterprise_git() { + install_red_hat_linux_git || return 1 + return 0 +} + install_red_hat_enterprise_linux_stable() { install_red_hat_linux_stable || return 1 return 0 @@ -4626,6 +4646,21 @@ install_red_hat_linux_git_post() { return 0 } +install_red_hat_enterprise_stable_post() { + install_red_hat_linux_stable_post || return 1 + return 0 +} + +install_red_hat_enterprise_restart_daemons() { + install_red_hat_linux_restart_daemons || return 1 + return 0 +} + +install_red_hat_enterprise_git_post() { + install_red_hat_linux_git_post || return 1 + return 0 +} + install_red_hat_enterprise_linux_stable_post() { install_red_hat_linux_stable_post || return 1 return 0 @@ -4686,6 +4721,21 @@ install_red_hat_linux_testing_post() { return 0 } +install_red_hat_enterprise_testing_deps() { + install_centos_testing_deps || return 1 + return 0 +} + +install_red_hat_enterprise_testing() { + install_centos_testing || return 1 + return 0 +} + +install_red_hat_enterprise_testing_post() { + install_centos_testing_post || return 1 + return 0 +} + install_red_hat_enterprise_server_testing_deps() { install_centos_testing_deps || return 1 return 0 From 8bfe437a2d16f5a9fc2e0bd68c109f2749a6dfbc Mon Sep 17 00:00:00 2001 From: Max Arnold Date: Sun, 9 Aug 2020 12:29:19 +0700 Subject: [PATCH 04/22] Allow pinning minor 3xxx versions (3000.0, 3001.0, etc) --- bootstrap-salt.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 2f593a6..47b6c57 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -606,11 +606,15 @@ elif [ "$ITYPE" = "stable" ]; then if [ "$(echo "$1" | grep -E '^(latest|1\.6|1\.7|2014\.1|2014\.7|2015\.5|2015\.8|2016\.3|2016\.11|2017\.7|2018\.3|2019\.2|3000|3001)$')" != "" ]; then STABLE_REV="$1" shift - elif [ "$(echo "$1" | grep -E '^(2[0-9]*\.[0-9]*\.[0-9]*|[3-9][0-9]{3}*(\.[0-9]*)?)$')" != "" ]; then - if [ "$(uname)" = "Darwin" ]; then - STABLE_REV="$1" + elif [ "$(echo "$1" | grep -E '^(2[0-9]*\.[0-9]*\.[0-9]*|[3-9][0-9]{3}(\.[0-9]*)?)$')" != "" ]; then + # Handle the 3xxx.0 version as 3xxx archive (pin to minor) and strip the fake ".0" suffix + if [ "$(echo "$1" | grep -E '[3-9][0-9]{3}\.0$')" != "" ]; then + STABLE_REV=$(echo "$1" | sed -e 's/\.0$//') else - STABLE_REV="archive/$1" + STABLE_REV="$1" + fi + if [ "$(uname)" != "Darwin" ]; then + STABLE_REV="archive/$STABLE_REV" fi shift else From 57187a01f7173423038b9dda9a7c0a4d4496e701 Mon Sep 17 00:00:00 2001 From: Max Arnold Date: Sun, 9 Aug 2020 12:44:18 +0700 Subject: [PATCH 05/22] Mention the .0 suffix in the doc --- bootstrap-salt.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 47b6c57..5eead39 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -296,6 +296,7 @@ __usage() { for packages available at repo.saltstack.com - stable [version] Install a specific version. Only supported for packages available at repo.saltstack.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 - git [ref] Install from any git ref (such as a branch, tag, or From ec112a6f45c5fd96971a904c43452f6a999af802 Mon Sep 17 00:00:00 2001 From: Max Arnold Date: Sun, 9 Aug 2020 13:04:05 +0700 Subject: [PATCH 06/22] Add 3000.0 pin test --- .kitchen.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.kitchen.yml b/.kitchen.yml index 6ba7a8a..80c849b 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -194,6 +194,17 @@ suites: - opensuse-15 - arch - ubuntu-2004 + - name: py3-stable-3000-pin + provisioner: + salt_version: 3000 + salt_bootstrap_options: -x python3 -MP stable 3000.0 + excludes: + - amazon-1 + - centos-6 + - debian-8 + - opensuse-15 + - arch + - ubuntu-2004 - name: py3-stable-3001 provisioner: salt_version: 3001 From 1e5a9abd6904235482b435f983eca61344dd6864 Mon Sep 17 00:00:00 2001 From: Max Arnold Date: Fri, 14 Aug 2020 15:27:40 +0700 Subject: [PATCH 07/22] Get rid of the 3xxx.0 if condition --- bootstrap-salt.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 5eead39..56e963e 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -609,11 +609,7 @@ elif [ "$ITYPE" = "stable" ]; then shift elif [ "$(echo "$1" | grep -E '^(2[0-9]*\.[0-9]*\.[0-9]*|[3-9][0-9]{3}(\.[0-9]*)?)$')" != "" ]; then # Handle the 3xxx.0 version as 3xxx archive (pin to minor) and strip the fake ".0" suffix - if [ "$(echo "$1" | grep -E '[3-9][0-9]{3}\.0$')" != "" ]; then - STABLE_REV=$(echo "$1" | sed -e 's/\.0$//') - else - STABLE_REV="$1" - fi + STABLE_REV=$(echo "$1" | sed -E 's/^([3-9][0-9]{3})\.0$/\1/') if [ "$(uname)" != "Darwin" ]; then STABLE_REV="archive/$STABLE_REV" fi From 49669edf4f441904b4d77acb29f76e4fa6292bdd Mon Sep 17 00:00:00 2001 From: Bryce Larson Date: Tue, 18 Aug 2020 17:38:17 +0000 Subject: [PATCH 08/22] add .0 tests --- .github/workflows/main.yml | 368 ++++++++++++++++++++++++ .github/workflows/templates/generate.py | 8 +- .kitchen.yml | 10 +- tests/conftest.py | 2 + 4 files changed, 383 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f839c60..6084033 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -412,6 +412,52 @@ jobs: bundle exec kitchen destroy py3-git-3001-amazon-2 + py3-stable-3001-0-amazon-2: + name: Amazon 2 v3001.0 Py3 Stable + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-stable-3001-0-amazon-2 || bundle exec kitchen create py3-stable-3001-0-amazon-2 + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-stable-3001-0-amazon-2 + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-stable-3001-0-amazon-2 + + py3-git-master-amazon-2: name: Amazon 2 Master Py3 Git runs-on: ubuntu-latest @@ -1148,6 +1194,52 @@ jobs: bundle exec kitchen destroy py3-git-3001-centos-7 + py3-stable-3001-0-centos-7: + name: CentOS 7 v3001.0 Py3 Stable + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-stable-3001-0-centos-7 || bundle exec kitchen create py3-stable-3001-0-centos-7 + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-stable-3001-0-centos-7 + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-stable-3001-0-centos-7 + + py3-git-master-centos-7: name: CentOS 7 Master Py3 Git runs-on: ubuntu-latest @@ -1516,6 +1608,52 @@ jobs: bundle exec kitchen destroy py3-git-3001-centos-8 + py3-stable-3001-0-centos-8: + name: CentOS 8 v3001.0 Py3 Stable + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-stable-3001-0-centos-8 || bundle exec kitchen create py3-stable-3001-0-centos-8 + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-stable-3001-0-centos-8 + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-stable-3001-0-centos-8 + + py3-git-master-centos-8: name: CentOS 8 Master Py3 Git runs-on: ubuntu-latest @@ -1884,6 +2022,52 @@ jobs: bundle exec kitchen destroy py3-git-3001-debian-10 + py3-stable-3001-0-debian-10: + name: Debian 10 v3001.0 Py3 Stable + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-stable-3001-0-debian-10 || bundle exec kitchen create py3-stable-3001-0-debian-10 + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-stable-3001-0-debian-10 + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-stable-3001-0-debian-10 + + py3-git-master-debian-10: name: Debian 10 Master Py3 Git runs-on: ubuntu-latest @@ -2482,6 +2666,52 @@ jobs: bundle exec kitchen destroy py3-git-3001-debian-9 + py3-stable-3001-0-debian-9: + name: Debian 9 v3001.0 Py3 Stable + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-stable-3001-0-debian-9 || bundle exec kitchen create py3-stable-3001-0-debian-9 + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-stable-3001-0-debian-9 + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-stable-3001-0-debian-9 + + py3-git-master-debian-9: name: Debian 9 Master Py3 Git runs-on: ubuntu-latest @@ -3632,6 +3862,52 @@ jobs: bundle exec kitchen destroy py3-git-3001-ubuntu-1604 + py3-stable-3001-0-ubuntu-1604: + name: Ubuntu 16.04 v3001.0 Py3 Stable + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-stable-3001-0-ubuntu-1604 || bundle exec kitchen create py3-stable-3001-0-ubuntu-1604 + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-stable-3001-0-ubuntu-1604 + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-stable-3001-0-ubuntu-1604 + + py3-git-master-ubuntu-1604: name: Ubuntu 16.04 Master Py3 Git runs-on: ubuntu-latest @@ -4092,6 +4368,52 @@ jobs: bundle exec kitchen destroy py3-git-3001-ubuntu-1804 + py3-stable-3001-0-ubuntu-1804: + name: Ubuntu 18.04 v3001.0 Py3 Stable + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-stable-3001-0-ubuntu-1804 || bundle exec kitchen create py3-stable-3001-0-ubuntu-1804 + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-stable-3001-0-ubuntu-1804 + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-stable-3001-0-ubuntu-1804 + + py3-git-master-ubuntu-1804: name: Ubuntu 18.04 Master Py3 Git runs-on: ubuntu-latest @@ -4276,6 +4598,52 @@ jobs: bundle exec kitchen destroy py3-git-3001-ubuntu-2004 + py3-stable-3001-0-ubuntu-2004: + name: Ubuntu 20.04 v3001.0 Py3 Stable + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-stable-3001-0-ubuntu-2004 || bundle exec kitchen create py3-stable-3001-0-ubuntu-2004 + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-stable-3001-0-ubuntu-2004 + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-stable-3001-0-ubuntu-2004 + + py3-git-master-ubuntu-2004: name: Ubuntu 20.04 Master Py3 Git runs-on: ubuntu-latest diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index e46cc9f..9302e69 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -70,6 +70,7 @@ SALT_BRANCHES = [ '2019-2', '3000', '3001', + '3001-0', 'master', 'latest' ] @@ -84,6 +85,7 @@ BRANCH_DISPLAY_NAMES = { '2019-2': 'v2019.2', '3000': 'v3000', '3001': 'v3001', + '3001-0': 'v3001.0', 'master': 'Master', 'latest': 'Latest' } @@ -163,7 +165,7 @@ def generate_test_jobs(): continue try: - if int(branch) >= 3000 and python_version == 'py2': + if int(branch.split('-')[0]) >= 3000 and python_version == 'py2': # Salt's 300X versions no longer supports Python 2 continue except ValueError: @@ -185,6 +187,10 @@ def generate_test_jobs(): continue if bootstrap_type == "git": + # .0 versions are a virtual version for pinning to the first point release of a major release, such as 3001, there is no git version. + if branch.endswith('-0'): + continue + if python_version == "py3": if distro in ("arch", "fedora-32"): allowed_branches = ["master"] diff --git a/.kitchen.yml b/.kitchen.yml index 80c849b..3d43e03 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -194,17 +194,19 @@ suites: - opensuse-15 - arch - ubuntu-2004 - - name: py3-stable-3000-pin + - name: py3-stable-3001-0 provisioner: - salt_version: 3000 - salt_bootstrap_options: -x python3 -MP stable 3000.0 + salt_version: 3001 + salt_bootstrap_options: -x python3 -MP stable 3001.0 excludes: - amazon-1 - centos-6 - debian-8 - opensuse-15 + - fedora-30 + - fedora-31 + - fedora-32 - arch - - ubuntu-2004 - name: py3-stable-3001 provisioner: salt_version: 3001 diff --git a/tests/conftest.py b/tests/conftest.py index 36abec1..a5e262f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -31,6 +31,8 @@ def target_python_version(): @pytest.fixture(scope='session') def target_salt_version(): target_salt = os.environ["KITCHEN_SUITE"].split("-", 2)[-1].replace("-", ".") + if target_salt.endswith(".0") and float(target_salt) >= 3000: + target_salt = ".".join(target_salt.split(".")[:-1]) if target_salt in ("latest", "master"): pytest.skip("Don't have a specific salt version to test against") return target_salt From 4179e8f204233c4e342607eca5f1195f99b93929 Mon Sep 17 00:00:00 2001 From: noelmcloughlin Date: Fri, 11 Sep 2020 00:18:45 +0100 Subject: [PATCH 09/22] docs(windows): update for windows-py3 --- README.rst | 21 +++++++++++++++++++++ bootstrap-salt.ps1 | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 616c9ae..67e6a72 100644 --- a/README.rst +++ b/README.rst @@ -227,6 +227,27 @@ Installing the latest master branch of Salt: curl -L https://bootstrap.saltstack.com | sudo sh -s -- git master +Install on Windows +~~~~~~~~~~~~~~~~~~ + +Using ``PowerShell`` to install latest stable version: + +.. code:: console + + Invoke-WebRequest -Uri https://winbootstrap.saltstack.com -OutFile C:\Temp\bootstrap-salt.ps1 + Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser + C:\Temp\bootstrap-salt.ps1 + Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope CurrentUser + + +Using ``cygwin`` to install latest stable version: + +.. code:: console + + curl -o bootstrap-salt.ps1 -L https://winbootstrap.saltstack.com + "/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0/powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ./bootstrap-salt.ps1" + + Supported Operating Systems --------------------------- diff --git a/bootstrap-salt.ps1 b/bootstrap-salt.ps1 index 3c311ec..ffd3912 100644 --- a/bootstrap-salt.ps1 +++ b/bootstrap-salt.ps1 @@ -85,7 +85,7 @@ Param( [Parameter(Mandatory=$false,ValueFromPipeline=$true)] # Doesn't support Python versions prior to "2017.7.0" [ValidateSet("2","3")] - [string]$pythonVersion = "2", + [string]$pythonVersion = "3", [Parameter(Mandatory=$false,ValueFromPipeline=$true)] [ValidateSet("true","false")] From 7ae1dfc0253d0fe80d24d4307e142932fa607b24 Mon Sep 17 00:00:00 2001 From: Ivo Jansky Date: Fri, 25 Sep 2020 16:28:26 +0200 Subject: [PATCH 10/22] Support git and stable salt-bootstrap on Gentoo. --- .kitchen.yml | 25 ++++ bootstrap-salt.sh | 320 +++++++++++++++++++++++++++++++++++----------- 2 files changed, 270 insertions(+), 75 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index 3d43e03..37fd749 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -93,6 +93,18 @@ platforms: run_command: /usr/lib/systemd/systemd provision_command: - dnf -y install procps-ng + - name: gentoo + driver_config: + image: gentoo/stage3:latest + run_command: /sbin/init + provision_command: + - rc-update add sshd default + - name: gentoo-systemd + driver_config: + image: gentoo/stage3:systemd + run_command: /lib/systemd/systemd + provision_command: + - systemctl enable sshd.service - name: opensuse-15 driver_config: image: opensuse/leap:15.1 @@ -117,12 +129,21 @@ suites: - name: py2-git-2019-2 provisioner: salt_version: 2019.2 + excludes: + - gentoo + - gentoo-systemd - name: py2-git-3000 provisioner: salt_version: 3000 + excludes: + - gentoo + - gentoo-systemd - name: py2-git-master provisioner: salt_version: master + excludes: + - gentoo + - gentoo-systemd - name: py2-stable-2019-2 provisioner: salt_version: 2019.2 @@ -133,6 +154,8 @@ suites: - fedora-30 - fedora-31 - fedora-32 + - gentoo + - gentoo-systemd - ubuntu-2004 - name: py2-stable-3000 provisioner: @@ -144,6 +167,8 @@ suites: - fedora-30 - fedora-31 - fedora-32 + - gentoo + - gentoo-systemd - ubuntu-2004 - name: py3-git-3000 diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 56e963e..3560a8d 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1806,7 +1806,7 @@ elif [ "${DISTRO_NAME_L}" = "debian" ]; then __debian_codename_translation fi -if [ "$(echo "${DISTRO_NAME_L}" | grep -E '(debian|ubuntu|centos|red_hat|oracle|scientific|amazon|fedora|macosx)')" = "" ] && [ "$ITYPE" = "stable" ] && [ "$STABLE_REV" != "latest" ]; then +if [ "$(echo "${DISTRO_NAME_L}" | grep -E '(debian|ubuntu|centos|gentoo|red_hat|oracle|scientific|amazon|fedora|macosx)')" = "" ] && [ "$ITYPE" = "stable" ] && [ "$STABLE_REV" != "latest" ]; then echoerror "${DISTRO_NAME} does not have major version pegged packages support" exit 1 fi @@ -2512,11 +2512,11 @@ __check_services_openbsd() { } # ---------- end of function __check_services_openbsd ---------- #--- FUNCTION ------------------------------------------------------------------------------------------------------- -# NAME: __check_services_alpine +# NAME: __check_services_openrc # DESCRIPTION: Return 0 or 1 in case the service is enabled or not # PARAMETERS: servicename #---------------------------------------------------------------------------------------------------------------------- -__check_services_alpine() { +__check_services_openrc() { if [ $# -eq 0 ]; then echoerror "You need to pass a service name to check!" exit 1 @@ -2535,7 +2535,7 @@ __check_services_alpine() { echodebug "Service ${servicename} is NOT enabled" return 1 fi -} # ---------- end of function __check_services_openbsd ---------- +} # ---------- end of function __check_services_openrc ---------- #--- FUNCTION ------------------------------------------------------------------------------------------------------- @@ -5108,7 +5108,7 @@ install_alpine_linux_check_services() { [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - __check_services_alpine salt-$fname || return 1 + __check_services_openrc salt-$fname || return 1 done return 0 @@ -7004,26 +7004,37 @@ install_suse_check_services() { # Gentoo Install Functions. # __autounmask() { - emerge --autounmask-write --autounmask-only "${@}"; return $? -} - -__emerge() { - if [ "$_GENTOO_USE_BINHOST" -eq $BS_TRUE ]; then - emerge --getbinpkg "${@}"; return $? - fi - emerge "${@}"; return $? -} - -__gentoo_config_protection() { - # usually it's a good thing to have config files protected by portage, but + # Unmask package(s) and accept changes + # + # Usually it's a good thing to have config files protected by portage, but # in this case this would require to interrupt the bootstrapping script at # this point, manually merge the changes using etc-update/dispatch-conf/ # cfg-update and then restart the bootstrapping script, so instead we allow # at this point to modify certain config files directly - export CONFIG_PROTECT_MASK="${CONFIG_PROTECT_MASK:-} /etc/portage/package.accept_keywords /etc/portage/package.keywords /etc/portage/package.license /etc/portage/package.unmask /etc/portage/package.use" + export CONFIG_PROTECT_MASK="${CONFIG_PROTECT_MASK:-} + /etc/portage/package.accept_keywords + /etc/portage/package.keywords + /etc/portage/package.license + /etc/portage/package.unmask + /etc/portage/package.use" + emerge --autounmask --autounmask-continue --autounmask-only --autounmask-write "${@}"; return $? +} - # emerge currently won't write to files that aren't there, so we need to ensure their presence - touch /etc/portage/package.accept_keywords /etc/portage/package.keywords /etc/portage/package.license /etc/portage/package.unmask /etc/portage/package.use +__emerge() { + EMERGE_FLAGS='-q' + if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then + EMERGE_FLAGS='-v' + fi + + # Do not re-emerge packages that are already installed + EMERGE_FLAGS="${EMERGE_FLAGS} --noreplace" + + if [ "$_GENTOO_USE_BINHOST" -eq $BS_TRUE ]; then + EMERGE_FLAGS="${EMERGE_FLAGS} --getbinpkg" + fi + + # shellcheck disable=SC2086 + emerge ${EMERGE_FLAGS} "${@}"; return $? } __gentoo_pre_dep() { @@ -7043,52 +7054,142 @@ __gentoo_pre_dep() { if [ ! -d /etc/portage ]; then mkdir /etc/portage fi + + # Enable python 3.6 if installing pre Neon Salt release + if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if ! emerge --info | sed 's/.*\(PYTHON_TARGETS="[^"]*"\).*/\1/' | grep -q 'python3_6' ; then + echo "PYTHON_TARGETS=\"\${PYTHON_TARGETS} python3_6\"" >> /etc/portage/make.conf + fi + fi } __gentoo_post_dep() { - # ensures dev-lib/crypto++ compiles happily - __emerge --oneshot 'sys-devel/libtool' - # the -o option asks it to emerge the deps but not the package. - __gentoo_config_protection - - if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then - __autounmask 'dev-python/libcloud' - __emerge -v 'dev-python/libcloud' - fi - - __autounmask 'dev-python/requests' - __autounmask 'app-admin/salt' - - __emerge -vo 'dev-python/requests' - __emerge -vo 'app-admin/salt' - if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 __autounmask ${_EXTRA_PACKAGES} || return 1 # shellcheck disable=SC2086 - __emerge -v ${_EXTRA_PACKAGES} || return 1 + __emerge ${_EXTRA_PACKAGES} || return 1 fi + + return 0 } install_gentoo_deps() { __gentoo_pre_dep || return 1 + + # Make sure that the 'libcloud' use flag is set when Salt Cloud support is requested + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + SALT_USE_FILE='/etc/portage/package.use' + if [ -d '/etc/portage/package.use' ]; then + SALT_USE_FILE='/etc/portage/package.use/salt' + fi + + SALT_USE_FLAGS="$(grep -E '^[<>=~]*app-admin/salt.*' ${SALT_USE_FILE} 2>/dev/null)" + SALT_USE_FLAG_LIBCLOUD="$(echo "${SALT_USE_FLAGS}" | grep ' libcloud' 2>/dev/null)" + + # Set the libcloud use flag, if it is not set yet + if [ -z "${SALT_USE_FLAGS}" ]; then + echo "app-admin/salt libcloud" >> ${SALT_USE_FILE} + elif [ -z "${SALT_USE_FLAG_LIBCLOUD}" ]; then + sed 's#^\([<>=~]*app-admin/salt[^ ]*\)\(.*\)#\1 libcloud\2#g' -i ${SALT_USE_FILE} + fi + fi + __gentoo_post_dep || return 1 } install_gentoo_git_deps() { __gentoo_pre_dep || return 1 + + GENTOO_GIT_PACKAGES="" + + # Install pip if it does not exist + if ! __check_command_exists pip ; then + GENTOO_GIT_PACKAGES="${GENTOO_GIT_PACKAGES} dev-python/pip" + fi + + # Install GIT if it does not exist + if ! __check_command_exists git ; then + GENTOO_GIT_PACKAGES="${GENTOO_GIT_PACKAGES} dev-vcs/git" + fi + + # Salt <3000 does not automatically install dependencies. It has to be done manually. + if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + # Install Python 3.6 if it does not exist + if ! __check_command_exists python3.6 ; then + GENTOO_GIT_PACKAGES="${GENTOO_GIT_PACKAGES} dev-lang/python:3.6" + fi + + GENTOO_GIT_PACKAGES="${GENTOO_GIT_PACKAGES} + sys-apps/pciutils + dev-python/pyyaml + dev-python/pyzmq + dev-python/libnacl + dev-python/pycryptodome + dev-python/py + dev-python/requests + dev-python/msgpack + dev-python/jinja + dev-python/pyasn1 + dev-python/markupsafe + dev-python/cython + dev-python/six + dev-python/idna + dev-python/pycurl + /dev/null 2>&1 || ( + systemctl preset salt-$fname.service > /dev/null 2>&1 && + systemctl enable salt-$fname.service > /dev/null 2>&1 + ) else - rc-update add salt-$fname default - /etc/init.d/salt-$fname start + # Salt minion cannot start in a docker container because the "net" service is not available + if [ $fname = "minion" ] && [ -f /.dockerenv ]; then + sed '/need net/d' -i /etc/init.d/salt-$fname + fi + + rc-update add "salt-$fname" > /dev/null 2>&1 || return 1 fi done } +install_gentoo_git_post() { + for fname in api master minion syndic; do + # Skip if not meant to be installed + [ $fname = "api" ] && \ + ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || ! __check_command_exists "salt-${fname}") && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + + if __check_command_exists systemctl ; then + __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service" + + # Skip salt-api since the service should be opt-in and not necessarily started on boot + [ $fname = "api" ] && continue + + systemctl is-enabled salt-$fname.service > /dev/null 2>&1 || ( + systemctl preset salt-$fname.service > /dev/null 2>&1 && + systemctl enable salt-$fname.service > /dev/null 2>&1 + ) + else + cat <<_eof > "/etc/init.d/salt-${fname}" +#!/sbin/openrc-run +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +command="/usr/bin/salt-${fname}" +command_args="\${SALT_OPTS}" +command_background="1" +pidfile="/var/run/salt-${fname}.pid" +name="SALT ${fname} daemon" +retry="20" + +depend() { + use net logger +} +_eof + chmod +x /etc/init.d/salt-$fname + + cat <<_eof > "/etc/conf.d/salt-${fname}" +# /etc/conf.d/salt-${fname}: config file for /etc/init.d/salt-master + +# see man pages for salt-${fname} or run 'salt-${fname} --help' +# for valid cmdline options +SALT_OPTS="--log-level=warning" +_eof + + # Skip salt-api since the service should be opt-in and not necessarily started on boot + [ $fname = "api" ] && continue + + rc-update add "salt-$fname" > /dev/null 2>&1 || return 1 + fi + done + + return 0 +} + install_gentoo_restart_daemons() { [ $_START_DAEMONS -eq $BS_FALSE ] && return - for fname in api master minion syndic; do - # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue - - # Skip if not meant to be installed - [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue - [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue - [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - - if [ -d "/run/systemd/system" ]; then - systemctl stop salt-$fname > /dev/null 2>&1 - systemctl start salt-$fname.service && continue - echodebug "Failed to start salt-$fname using systemd" - if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then - systemctl status salt-$fname.service - journalctl -xe - fi - else - /etc/init.d/salt-$fname stop > /dev/null 2>&1 - /etc/init.d/salt-$fname start - fi - done -} - -install_gentoo_check_services() { - if [ ! -d "/run/systemd/system" ]; then - # Not running systemd!? Don't check! - return 0 + # Ensure upstart configs / systemd units are loaded + if __check_command_exists systemctl ; then + systemctl daemon-reload fi for fname in api master minion syndic; do @@ -7153,7 +7291,39 @@ install_gentoo_check_services() { [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - __check_services_systemd salt-$fname || return 1 + if __check_command_exists systemctl ; then + systemctl stop salt-$fname > /dev/null 2>&1 + systemctl start salt-$fname.service && continue + echodebug "Failed to start salt-$fname using systemd" + if [ "$_ECHO_DEBUG" -eq $BS_TRUE ]; then + systemctl status salt-$fname.service + journalctl -xe + fi + else + # Disable stdin to fix shell session hang on killing tee pipe + rc-service salt-$fname stop < /dev/null > /dev/null 2>&1 + rc-service salt-$fname start < /dev/null || return 1 + fi + done + + return 0 +} + +install_gentoo_check_services() { + for fname in api master minion syndic; do + # Skip salt-api since the service should be opt-in and not necessarily started on boot + [ $fname = "api" ] && continue + + # Skip if not meant to be installed + [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + + if __check_command_exists systemctl ; then + __check_services_systemd salt-$fname || return 1 + else + __check_services_openrc salt-$fname || return 1 + fi done return 0 From c59da8565e178a54c6f05ab3d9eda6ae8a8c2da0 Mon Sep 17 00:00:00 2001 From: Ivo Jansky Date: Sun, 27 Sep 2020 11:39:39 +0200 Subject: [PATCH 11/22] Add Gentoo to the CI process. --- .github/workflows/main.yml | 828 ++++++++++++++++++++++++ .github/workflows/templates/generate.py | 8 + 2 files changed, 836 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6084033..d94bef5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3264,6 +3264,834 @@ jobs: bundle exec kitchen destroy latest-fedora-32 + py3-stable-2019-2-gentoo: + name: Gentoo v2019.2 Py3 Stable + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-stable-2019-2-gentoo || bundle exec kitchen create py3-stable-2019-2-gentoo + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-stable-2019-2-gentoo + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-stable-2019-2-gentoo + + + py3-git-2019-2-gentoo: + name: Gentoo v2019.2 Py3 Git + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-git-2019-2-gentoo || bundle exec kitchen create py3-git-2019-2-gentoo + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-git-2019-2-gentoo + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-git-2019-2-gentoo + + + py3-stable-3000-gentoo: + name: Gentoo v3000 Py3 Stable + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-stable-3000-gentoo || bundle exec kitchen create py3-stable-3000-gentoo + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-stable-3000-gentoo + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-stable-3000-gentoo + + + py3-git-3000-gentoo: + name: Gentoo v3000 Py3 Git + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-git-3000-gentoo || bundle exec kitchen create py3-git-3000-gentoo + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-git-3000-gentoo + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-git-3000-gentoo + + + py3-stable-3001-gentoo: + name: Gentoo v3001 Py3 Stable + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-stable-3001-gentoo || bundle exec kitchen create py3-stable-3001-gentoo + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-stable-3001-gentoo + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-stable-3001-gentoo + + + py3-git-3001-gentoo: + name: Gentoo v3001 Py3 Git + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-git-3001-gentoo || bundle exec kitchen create py3-git-3001-gentoo + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-git-3001-gentoo + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-git-3001-gentoo + + + py3-stable-3001-0-gentoo: + name: Gentoo v3001.0 Py3 Stable + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-stable-3001-0-gentoo || bundle exec kitchen create py3-stable-3001-0-gentoo + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-stable-3001-0-gentoo + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-stable-3001-0-gentoo + + + py3-git-master-gentoo: + name: Gentoo Master Py3 Git + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-git-master-gentoo || bundle exec kitchen create py3-git-master-gentoo + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-git-master-gentoo + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-git-master-gentoo + + + latest-gentoo: + name: Gentoo Latest packaged release + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create latest-gentoo || bundle exec kitchen create latest-gentoo + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify latest-gentoo + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy latest-gentoo + + + py3-stable-2019-2-gentoo-systemd: + name: Gentoo (systemd) v2019.2 Py3 Stable + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-stable-2019-2-gentoo-systemd || bundle exec kitchen create py3-stable-2019-2-gentoo-systemd + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-stable-2019-2-gentoo-systemd + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-stable-2019-2-gentoo-systemd + + + py3-git-2019-2-gentoo-systemd: + name: Gentoo (systemd) v2019.2 Py3 Git + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-git-2019-2-gentoo-systemd || bundle exec kitchen create py3-git-2019-2-gentoo-systemd + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-git-2019-2-gentoo-systemd + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-git-2019-2-gentoo-systemd + + + py3-stable-3000-gentoo-systemd: + name: Gentoo (systemd) v3000 Py3 Stable + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-stable-3000-gentoo-systemd || bundle exec kitchen create py3-stable-3000-gentoo-systemd + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-stable-3000-gentoo-systemd + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-stable-3000-gentoo-systemd + + + py3-git-3000-gentoo-systemd: + name: Gentoo (systemd) v3000 Py3 Git + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-git-3000-gentoo-systemd || bundle exec kitchen create py3-git-3000-gentoo-systemd + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-git-3000-gentoo-systemd + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-git-3000-gentoo-systemd + + + py3-stable-3001-gentoo-systemd: + name: Gentoo (systemd) v3001 Py3 Stable + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-stable-3001-gentoo-systemd || bundle exec kitchen create py3-stable-3001-gentoo-systemd + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-stable-3001-gentoo-systemd + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-stable-3001-gentoo-systemd + + + py3-git-3001-gentoo-systemd: + name: Gentoo (systemd) v3001 Py3 Git + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-git-3001-gentoo-systemd || bundle exec kitchen create py3-git-3001-gentoo-systemd + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-git-3001-gentoo-systemd + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-git-3001-gentoo-systemd + + + py3-stable-3001-0-gentoo-systemd: + name: Gentoo (systemd) v3001.0 Py3 Stable + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-stable-3001-0-gentoo-systemd || bundle exec kitchen create py3-stable-3001-0-gentoo-systemd + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-stable-3001-0-gentoo-systemd + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-stable-3001-0-gentoo-systemd + + + py3-git-master-gentoo-systemd: + name: Gentoo (systemd) Master Py3 Git + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create py3-git-master-gentoo-systemd || bundle exec kitchen create py3-git-master-gentoo-systemd + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify py3-git-master-gentoo-systemd + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy py3-git-master-gentoo-systemd + + + latest-gentoo-systemd: + name: Gentoo (systemd) Latest packaged release + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: lint + + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Install Bundler + run: | + gem install bundler + + - name: Setup Bundle + run: | + bundle install --with docker --without opennebula ec2 windows vagrant + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Python Dependencies + run: | + pip install -U pip + pip install -r tests/requirements.txt + + - name: Create Test Container + run: | + bundle exec kitchen create latest-gentoo-systemd || bundle exec kitchen create latest-gentoo-systemd + + - name: Test Bootstrap In Test Container + run: | + bundle exec kitchen verify latest-gentoo-systemd + + - name: Destroy Test Container + if: always() + run: | + bundle exec kitchen destroy latest-gentoo-systemd + + py3-git-2019-2-opensuse-15: name: Opensuse 15 v2019.2 Py3 Git runs-on: ubuntu-latest diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index 9302e69..11854fa 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -18,6 +18,8 @@ LINUX_DISTROS = [ 'fedora-30', 'fedora-31', 'fedora-32', + 'gentoo', + 'gentoo-systemd', 'opensuse-15', 'ubuntu-1604', 'ubuntu-1804', @@ -37,6 +39,8 @@ STABLE_DISTROS = [ 'fedora-30', 'fedora-31', 'fedora-32', + 'gentoo', + 'gentoo-systemd', 'ubuntu-1604', 'ubuntu-1804', 'ubuntu-2004', @@ -48,6 +52,8 @@ PY2_BLACKLIST = [ 'fedora-30', 'fedora-31', 'fedora-32', + 'gentoo', + 'gentoo-systemd', 'opensuse-15', 'ubuntu-2004', ] @@ -110,6 +116,8 @@ DISTRO_DISPLAY_NAMES = { 'fedora-30': 'Fedora 30', 'fedora-31': 'Fedora 31', 'fedora-32': 'Fedora 32', + 'gentoo': 'Gentoo', + 'gentoo-systemd': 'Gentoo (systemd)', 'opensuse-15': 'Opensuse 15', 'ubuntu-1604': 'Ubuntu 16.04', 'ubuntu-1804': 'Ubuntu 18.04', From a14e8933957edcedcd92c0edca48fcbf61098fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivo=20J=C3=A1nsk=C3=BD?= Date: Sun, 27 Sep 2020 15:39:38 +0200 Subject: [PATCH 12/22] Run emerge-webrsync when provisioning a Gentoo container. --- .kitchen.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.kitchen.yml b/.kitchen.yml index 37fd749..af869e7 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -98,12 +98,14 @@ platforms: image: gentoo/stage3:latest run_command: /sbin/init provision_command: + - emerge-webrsync - rc-update add sshd default - name: gentoo-systemd driver_config: image: gentoo/stage3:systemd run_command: /lib/systemd/systemd provision_command: + - emerge-webrsync - systemctl enable sshd.service - name: opensuse-15 driver_config: From 821cc2a792a129f3a1ff14d46e6d127d8915344d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivo=20J=C3=A1nsk=C3=BD?= Date: Mon, 28 Sep 2020 14:30:46 +0200 Subject: [PATCH 13/22] Test pipelines with kitchen-docker from its GitHub master. --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 68639b7..2d4b90b 100644 --- a/Gemfile +++ b/Gemfile @@ -2,4 +2,4 @@ source "https://rubygems.org" gem 'test-kitchen', '>= 2.0.1' gem 'kitchen-salt', '>= 0.5' -gem 'kitchen-docker', '>= 2.9.0' +gem 'kitchen-docker', github: 'test-kitchen/kitchen-docker' From 898f3948aafa25831a9061b3194728d70a1c6397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivo=20J=C3=A1nsk=C3=BD?= Date: Mon, 28 Sep 2020 17:01:07 +0200 Subject: [PATCH 14/22] Install Python 3.6 only when building Salt 2019 (stable). --- .kitchen.yml | 2 -- bootstrap-salt.sh | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index af869e7..37fd749 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -98,14 +98,12 @@ platforms: image: gentoo/stage3:latest run_command: /sbin/init provision_command: - - emerge-webrsync - rc-update add sshd default - name: gentoo-systemd driver_config: image: gentoo/stage3:systemd run_command: /lib/systemd/systemd provision_command: - - emerge-webrsync - systemctl enable sshd.service - name: opensuse-15 driver_config: diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 3560a8d..ac63d90 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -7056,7 +7056,7 @@ __gentoo_pre_dep() { fi # Enable python 3.6 if installing pre Neon Salt release - if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then + if echo "${STABLE_REV}" | grep -q "2019" ; then if ! emerge --info | sed 's/.*\(PYTHON_TARGETS="[^"]*"\).*/\1/' | grep -q 'python3_6' ; then echo "PYTHON_TARGETS=\"\${PYTHON_TARGETS} python3_6\"" >> /etc/portage/make.conf fi From 771b81392869755f3195be65be34ab7d1168048a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivo=20J=C3=A1nsk=C3=BD?= Date: Mon, 28 Sep 2020 18:36:44 +0200 Subject: [PATCH 15/22] Install Python 3.6 only when building Salt 2019 (stable+git). --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index ac63d90..6b36375 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -7056,7 +7056,7 @@ __gentoo_pre_dep() { fi # Enable python 3.6 if installing pre Neon Salt release - if echo "${STABLE_REV}" | grep -q "2019" ; then + if echo "${STABLE_REV}" | grep -q "2019" || [ "${ITYPE}" = "git" ] && [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then if ! emerge --info | sed 's/.*\(PYTHON_TARGETS="[^"]*"\).*/\1/' | grep -q 'python3_6' ; then echo "PYTHON_TARGETS=\"\${PYTHON_TARGETS} python3_6\"" >> /etc/portage/make.conf fi From 7fa4efbf20089d73be58dbd45f405677d92ddda4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivo=20J=C3=A1nsk=C3=BD?= Date: Tue, 29 Sep 2020 08:31:50 +0200 Subject: [PATCH 16/22] Make CI job timeout configurable and raise timeout for Gentoo. --- .github/workflows/main.yml | 36 ++++++++++++------------- .github/workflows/templates/generate.py | 13 +++++++-- .github/workflows/templates/linux.yml | 2 +- 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d94bef5..e69e3c1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3267,7 +3267,7 @@ jobs: py3-stable-2019-2-gentoo: name: Gentoo v2019.2 Py3 Stable runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -3313,7 +3313,7 @@ jobs: py3-git-2019-2-gentoo: name: Gentoo v2019.2 Py3 Git runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -3359,7 +3359,7 @@ jobs: py3-stable-3000-gentoo: name: Gentoo v3000 Py3 Stable runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -3405,7 +3405,7 @@ jobs: py3-git-3000-gentoo: name: Gentoo v3000 Py3 Git runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -3451,7 +3451,7 @@ jobs: py3-stable-3001-gentoo: name: Gentoo v3001 Py3 Stable runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -3497,7 +3497,7 @@ jobs: py3-git-3001-gentoo: name: Gentoo v3001 Py3 Git runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -3543,7 +3543,7 @@ jobs: py3-stable-3001-0-gentoo: name: Gentoo v3001.0 Py3 Stable runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -3589,7 +3589,7 @@ jobs: py3-git-master-gentoo: name: Gentoo Master Py3 Git runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -3635,7 +3635,7 @@ jobs: latest-gentoo: name: Gentoo Latest packaged release runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -3681,7 +3681,7 @@ jobs: py3-stable-2019-2-gentoo-systemd: name: Gentoo (systemd) v2019.2 Py3 Stable runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -3727,7 +3727,7 @@ jobs: py3-git-2019-2-gentoo-systemd: name: Gentoo (systemd) v2019.2 Py3 Git runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -3773,7 +3773,7 @@ jobs: py3-stable-3000-gentoo-systemd: name: Gentoo (systemd) v3000 Py3 Stable runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -3819,7 +3819,7 @@ jobs: py3-git-3000-gentoo-systemd: name: Gentoo (systemd) v3000 Py3 Git runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -3865,7 +3865,7 @@ jobs: py3-stable-3001-gentoo-systemd: name: Gentoo (systemd) v3001 Py3 Stable runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -3911,7 +3911,7 @@ jobs: py3-git-3001-gentoo-systemd: name: Gentoo (systemd) v3001 Py3 Git runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -3957,7 +3957,7 @@ jobs: py3-stable-3001-0-gentoo-systemd: name: Gentoo (systemd) v3001.0 Py3 Stable runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -4003,7 +4003,7 @@ jobs: py3-git-master-gentoo-systemd: name: Gentoo (systemd) Master Py3 Git runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint @@ -4049,7 +4049,7 @@ jobs: latest-gentoo-systemd: name: Gentoo (systemd) Latest packaged release runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 needs: lint diff --git a/.github/workflows/templates/generate.py b/.github/workflows/templates/generate.py index 11854fa..1e6fd22 100755 --- a/.github/workflows/templates/generate.py +++ b/.github/workflows/templates/generate.py @@ -124,11 +124,18 @@ DISTRO_DISPLAY_NAMES = { 'ubuntu-2004': 'Ubuntu 20.04', } +TIMEOUT_DEFAULT = 20 +TIMEOUT_OVERRIDES = { + 'gentoo': 45, + 'gentoo-systemd': 45, +} def generate_test_jobs(): test_jobs = '' for distro in LINUX_DISTROS + OSX + WINDOWS: + timeout_minutes = TIMEOUT_OVERRIDES[distro] if distro in TIMEOUT_OVERRIDES else TIMEOUT_DEFAULT + for branch in SALT_BRANCHES: if branch == 'master' and distro in SALT_POST_3000_BLACKLIST: @@ -161,7 +168,8 @@ def generate_test_jobs(): branch=branch, display_name='{} Latest packaged release'.format( DISTRO_DISPLAY_NAMES[distro], - ) + ), + timeout_minutes=timeout_minutes ) ) continue @@ -244,7 +252,8 @@ def generate_test_jobs(): BRANCH_DISPLAY_NAMES[branch], python_version.capitalize(), bootstrap_type.capitalize() - ) + ), + timeout_minutes=timeout_minutes ) ) diff --git a/.github/workflows/templates/linux.yml b/.github/workflows/templates/linux.yml index 5eae777..51e000d 100644 --- a/.github/workflows/templates/linux.yml +++ b/.github/workflows/templates/linux.yml @@ -1,7 +1,7 @@ {python_version}-{bootstrap_type}-{branch}-{distro}: name: {display_name} runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: {timeout_minutes} needs: lint From 22e041182218b4b3fc6f75751ac947ee89f886a1 Mon Sep 17 00:00:00 2001 From: Tai Groot Date: Sun, 18 Oct 2020 15:57:46 -0700 Subject: [PATCH 17/22] feat: adds support for linuxmint_20_ubuntu_base --- bootstrap-salt.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 6b36375..72c2e67 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1311,6 +1311,7 @@ __ubuntu_derivatives_translation() { linuxmint_17_ubuntu_base="14.04" linuxmint_18_ubuntu_base="16.04" linuxmint_19_ubuntu_base="18.04" + linuxmint_20_ubuntu_base="20.04" linaro_12_ubuntu_base="12.04" elementary_os_02_ubuntu_base="12.04" neon_16_ubuntu_base="16.04" From 66ab0b8f794a73346d63faaf41fa19dd4278792d Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 19 Oct 2020 10:26:40 +0100 Subject: [PATCH 18/22] Bump version for release --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 72c2e67..f4d62d0 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -23,7 +23,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2020.06.23" +__ScriptVersion="2020.10.19" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0" From add2db7f4f77a78b81297a7788bfd6c3ab1f4c8b Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 19 Oct 2020 10:27:17 +0100 Subject: [PATCH 19/22] Update AUTHORS.rst and ChangeLog for release --- AUTHORS.rst | 5 +++++ ChangeLog | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index e5afa15..c9c70bb 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -77,6 +77,7 @@ Guillaume Derval GuillaumeDerval guillaume@guillaumederval.be gweis gweis Henrik Holmboe holmboe Howard Mei HowardMei howardleomei@gmail.com +Ivo Jánský ijansky James Booth absolutejam vvalentine1337@gmail.com Jamie Alessio jalessio jamie@stoic.net Jan Heidbrink jheidbrink @@ -98,6 +99,7 @@ Ken Crowell oeuftete kcrowell@saltstack.com Kenneth Wilke KennethWilke Kevin Quinn kevinquinnyo kevin.quinn@totalserversolutions.com kiemlicz kiemlicz +Kirill Ponomarev krionbsd krion@freebsd.org Ky-Anh Huynh icy Liu Xiaohui oreh herolxh@gmail.com lomeroe lomeroe @@ -116,6 +118,7 @@ Matthew Mead-Briggs mattmb Matthew Richardson mrichar1 Matthew Willson ixela Matthieu Guegan mguegan +Max Arnold max-arnold Megan Wilhite Ch3LL megan.wilhite@gmail.com mfapouw mfapouw Michael A. Smith kojiromike michaels@syapse.com @@ -129,6 +132,7 @@ nevins-b nevins-b Nicholas Henry nshenry03 nshenry03@gmail.com Nicole Thomas rallytime nicole@saltstack.com Niels Abspoel aboe76 aboe76@gmail.com +Nikita mbochenk Nitin Madhok nmadhok nmadhok@clemson.edu panticz panticz Paul Brian lifeisstillgood paul@mikadosoftware.com @@ -164,6 +168,7 @@ stanzgy stanzgy stanzgy@gmail.com Steve Groesz wolfpackmars2 wolfpackmars2@yahoo.com Sven R hackacad admin@hackacad.net sybix sybix +Tai Groot taigrr tai@taigrr.com Tate Eskew tateeskew Thomas S. Hatch thatch45 thatch45@saltstack.com Tobias Jungel toanju Tobias.Jungel@gmail.com diff --git a/ChangeLog b/ChangeLog index 9159fc2..a8ab78c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ Version TBD (In Progress on the Develop Branch): +Version 2020.10.19: + * Fix v3000+ with git install on FreeBSD (krionbsd) #1487 + * Update README giving ONE example of WINDOWS bootstrapping. Default to python3 instead of + python2. (noelmcloughlin) #1496 + * Support git and stable salt-bootstrap on Gentoo. (ijansky) #1500 + * Add support for Linux Mint 20. (taigrr) #1502 + * Adding missing functions for Red Hat 8. (mbochenk) #1489 + * Allow pinning minor 3xxx versions. (max-arnold) #1491 + Version 2020.06.23: * Fix for Cumulus Linux 4.1 (darylturner) #1474 * Fix file download exit code, improve error message on failed download (bryceml) #1478 @@ -38,8 +47,8 @@ Version 2020.02.04: * Drop support for Debian < 8 (s0undt3ch) #1424 Version 2020.01.29: - * FreeBSD fixes (cedwards) #1413 - * Support the upcoming Neon release (s0undt3ch) #1420 + * FreeBSD fixes (cedwards) #1413 + * Support the upcoming Neon release (s0undt3ch) #1420 Version 2020.01.21: * FreeBSD fixes (kgbsd) #1376 From 7b23cf4099abf08e2d16e196b20bb0cb817de8dd Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 19 Oct 2020 10:38:31 +0100 Subject: [PATCH 20/22] Update build status badge. Add sha256sums anchor --- README.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 67e6a72..71e92ab 100644 --- a/README.rst +++ b/README.rst @@ -28,6 +28,8 @@ Bootstrap In every two-step installation example, you would be well-served to **verify against the SHA256 sum** of the downloaded ``bootstrap-salt.sh`` file. +.. _sha256sums: + The SHA256 sum of the ``bootstrap-salt.sh`` file, per release, is: - 2020.06.23: ``1d07db867c195c864d0ae70664524f2099cc9a46872953293c67c3f239d4f4f5`` @@ -498,8 +500,8 @@ Make edits to .drone.jsonnet and then save them into the .drone.yml by doing the .. _Vagrant: http://www.vagrantup.com .. _hardening salt: https://docs.saltstack.com/en/latest/topics/hardening.html -.. |build| image:: https://drone.saltstack.com/api/badges/saltstack/salt-bootstrap/status.svg - :target: https://drone.saltstack.com/saltstack/salt-bootstrap - :alt: Build status on Linux +.. |build| image:: https://github.com/saltstack/salt-bootstrap/workflows/Testing/badge.svg?branch=develop + :target: https://github.com/saltstack/salt-bootstrap/actions?query=branch%3Adevelop + :alt: Build Status .. vim: fenc=utf-8 spell spl=en cc=100 tw=99 fo=want sts=2 sw=2 et From b6d356c1dd3bb90ef85ded3a146a34ac852c93d4 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 19 Oct 2020 10:50:41 +0100 Subject: [PATCH 21/22] Add GH action to update sha256sums /cc @bryceml --- .github/workflows/checksums.yml | 49 +++++++++++++++++++ .../scripts/update-release-shasum.py | 37 ++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 .github/workflows/checksums.yml create mode 100644 .github/workflows/scripts/update-release-shasum.py diff --git a/.github/workflows/checksums.yml b/.github/workflows/checksums.yml new file mode 100644 index 0000000..6b01527 --- /dev/null +++ b/.github/workflows/checksums.yml @@ -0,0 +1,49 @@ +name: Checksums + +on: + push: + tags: + - '*' + +jobs: + checksums: + name: Update Release Checksums + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + ref: stable + + - name: Get bootstrap-salt.sh sha256sum + run: | + echo "SH=$(sha256sum bootstrap-salt.sh | awk '{ print $1 }')" >> $GITHUB_ENV + echo "PS1=$(sha256sum bootstrap-salt.ps1 | awk '{ print $1 }')" >> $GITHUB_ENV + echo "BS_VERSION=$(sh bootstrap-salt.sh -v | awk '{ print $4 }')" >> $GITHUB_ENV + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Update Checksums + run: | + echo ${{ env.SH }} > bootstrap-salt.sh.sha256 + echo ${{ env.PS1 }} > bootstrap-salt.ps1.sha256 + git config --global user.name 'SaltStack GH Automation' + git config --global user.email 'actions@github.com' + git add *.sha256 + git commit -am "Update sha256 checksums" + git push + + - uses: actions/checkout@v2 + with: + ref: develop + + - name: Update Latest Release on README + run: | + python3 .github/workflows/scripts/update-release-shasum.py ${{ env.BS_VERSION }} ${{ env.SH }} + git config --global user.name 'SaltStack GH Automation' + git config --global user.email 'actions@github.com' + git commit -am "Update README.rst with latest release sha256sum" + git push diff --git a/.github/workflows/scripts/update-release-shasum.py b/.github/workflows/scripts/update-release-shasum.py new file mode 100644 index 0000000..fefde64 --- /dev/null +++ b/.github/workflows/scripts/update-release-shasum.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +import sys +import pathlib + +THIS_FILE = pathlib.Path(__file__).resolve() +CODE_ROOT = THIS_FILE.parent.parent.parent.parent +README_PATH = CODE_ROOT / "README.rst" + + +def main(version, sha256sum): + in_contents = README_PATH.read_text() + out_contents = "" + found_anchor = False + updated_version = False + if version not in in_contents: + for line in in_contents.splitlines(True): + if updated_version: + out_contents += line + continue + if found_anchor: + if not line.startswith("-"): + out_contents += line + continue + out_contents += "- {}: ``{}``\n".format(version, sha256sum) + out_contents += line + updated_version = True + continue + + out_contents += line + if line.startswith(".. _sha256sums:"): + found_anchor = True + if in_contents != out_contents: + README_PATH.write_text(out_contents) + + +if __name__ == '__main__': + main(sys.argv[1], sys.argv[2]) From 7f3872a12643a19999e6173039a01f8801afb6cc Mon Sep 17 00:00:00 2001 From: SaltStack GH Automation Date: Mon, 19 Oct 2020 12:02:10 +0000 Subject: [PATCH 22/22] Update sha256 checksums --- bootstrap-salt.ps1.sha256 | 2 +- bootstrap-salt.sh.sha256 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.ps1.sha256 b/bootstrap-salt.ps1.sha256 index aea8adc..010e1cb 100644 --- a/bootstrap-salt.ps1.sha256 +++ b/bootstrap-salt.ps1.sha256 @@ -1 +1 @@ -4be5028f29e36ae02b10a1d1a5af15af20db2fccc6000cb3d8c567d5ff5d1700 +1819f33bc96b90762a4e955f05563c402fe03f139a8011a223172861d5158e59 diff --git a/bootstrap-salt.sh.sha256 b/bootstrap-salt.sh.sha256 index 333113f..4674a0b 100644 --- a/bootstrap-salt.sh.sha256 +++ b/bootstrap-salt.sh.sha256 @@ -1 +1 @@ -1d07db867c195c864d0ae70664524f2099cc9a46872953293c67c3f239d4f4f5 +f6c3e2c52f98d115809044b09062219369957caf30228b594033f0543e202c52