diff options
author | Jared Kauppila <Jared.Kauppila@sentry.com> | 2021-10-26 12:07:48 -0500 |
---|---|---|
committer | Jared Kauppila <Jared.Kauppila@sentry.com> | 2021-10-26 12:08:13 -0500 |
commit | 3817534dffb6a903b8ce195abea2f4739b026dc9 (patch) | |
tree | b89bebc91ecadab866198548b5e6132373b8f565 | |
parent | 05986bd3460175a821999701b43d40c7c705e491 (diff) | |
download | chef-3817534dffb6a903b8ce195abea2f4739b026dc9.tar.gz |
Reference `GITHUB_REPOSITORY` if available when pulling Infra Client source code during tests to enable forked builds
Signed-off-by: Jared Kauppila <Jared.Kauppila@sentry.com>
-rw-r--r-- | .github/workflows/kitchen.yml | 4 | ||||
-rw-r--r-- | kitchen-tests/README.md | 2 | ||||
-rw-r--r-- | kitchen-tests/kitchen.yml | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/.github/workflows/kitchen.yml b/.github/workflows/kitchen.yml index 2e51c21ab6..fe7afc493f 100644 --- a/.github/workflows/kitchen.yml +++ b/.github/workflows/kitchen.yml @@ -31,7 +31,7 @@ jobs: $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH $env:OHAI_VERSION = ( Select-String -Path .\Gemfile.lock -Pattern '(?<=ohai \()\d.*(?=\))' | ForEach-Object { $_.Matches[0].Value } ) gem install appbundler appbundle-updater --no-doc - appbundle-updater chef chef $env:GITHUB_SHA --tarball --github chef/chef + appbundle-updater chef chef $env:GITHUB_SHA --tarball --github $env:GITHUB_REPOSITORY Write-Output "Installed Chef / Ohai release:" chef-client -v ohai -v @@ -75,7 +75,7 @@ jobs: run: | OHAI_VERSION=$(sed -n '/ohai .[0-9]/{s/.*(//;s/)//;p;}' Gemfile.lock) sudo /opt/chef/embedded/bin/gem install appbundler appbundle-updater --no-doc - sudo /opt/chef/embedded/bin/appbundle-updater chef chef $GITHUB_SHA --tarball --github chef/chef + sudo /opt/chef/embedded/bin/appbundle-updater chef chef $GITHUB_SHA --tarball --github $GITHUB_REPOSITORY echo "Installed Chef / Ohai release:" /opt/chef/bin/chef-client -v /opt/chef/bin/ohai -v diff --git a/kitchen-tests/README.md b/kitchen-tests/README.md index a997dc4370..73c766d82b 100644 --- a/kitchen-tests/README.md +++ b/kitchen-tests/README.md @@ -57,7 +57,7 @@ Test Kitchen is configured in the `kitchen.yml` file, which resides in this dire The provisioner can be configured to pull client source code from a GitHub repository using any valid Git reference. You are encouraged to modify any of these settings, but please return them to their original values before submitting a pull request for review (unless, of course, your changes are enhancements to the default provisioner settings). -By default, the provisioner is configured to pull your most recent commit to `chef/chef`. You can change this by modifying the `github` and `branch` provisioner options: +By default, the provisioner is configured to pull your most recent commit to the `GITHUB_REPOSITORY` environment variable (if executed via Github Actions), otherwise defaults to `chef/chef`. You can change this by modifying the `github` and `branch` provisioner options: - `github`: Set this to `"<your_username>/<your_chef_repo>"`. The default is `"chef/chef"`. - `branch`: This can be any valid git reference (e.g., branch name, tag, or commit SHA). If omitted, it defaults to `main`. diff --git a/kitchen-tests/kitchen.yml b/kitchen-tests/kitchen.yml index 0e2811f73a..cde6e9baba 100644 --- a/kitchen-tests/kitchen.yml +++ b/kitchen-tests/kitchen.yml @@ -22,10 +22,10 @@ lifecycle: - remote: /opt/chef/bin/chef-client -v - remote: /opt/chef/bin/ohai -v - remote: /opt/chef/embedded/bin/gem install appbundler appbundle-updater --no-doc - - remote: scl enable devtoolset-8 '/opt/chef/embedded/bin/appbundle-updater chef chef <%= ENV['BUILDKITE_COMMIT'] || %x(git rev-parse HEAD).chomp %> --tarball --github chef/chef' + - remote: scl enable devtoolset-8 '/opt/chef/embedded/bin/appbundle-updater chef chef <%= ENV['BUILDKITE_COMMIT'] || %x(git rev-parse HEAD).chomp %> --tarball --github <%= ENV['GITHUB_REPOSITORY'] || chef/chef %>' includes: - centos-6 - - remote: /opt/chef/embedded/bin/appbundle-updater chef chef <%= ENV['BUILDKITE_COMMIT'] || %x(git rev-parse HEAD).chomp %> --tarball --github chef/chef + - remote: /opt/chef/embedded/bin/appbundle-updater chef chef <%= ENV['BUILDKITE_COMMIT'] || %x(git rev-parse HEAD).chomp %> --tarball --github <%= ENV['GITHUB_REPOSITORY'] || chef/chef %> excludes: - centos-6 - remote: echo "Installed Chef / Ohai release:" |