summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Ahlberg <evanahlberg@gmail.com>2023-02-02 14:54:33 -0500
committerGitHub <noreply@github.com>2023-02-02 14:54:33 -0500
commit625558f029d1503d03e7cc42ab9c69d210fa7fa3 (patch)
tree62eaac6fd14c66a7d5bb8ce6b767731d91be0b9d
parent7cdf5c95b7d8caac8786584ea9bcd4de869eb68b (diff)
downloadchef-625558f029d1503d03e7cc42ab9c69d210fa7fa3.tar.gz
fix adhoc pipelines and centos 6 omnibus test (#13530)
* fix adhoc pipelines and centos 6 omnibus test * run on all validate/ pipelines * fix aws credentials on windows for canary Signed-off-by: Evan Ahlberg <evanahlberg@gmail.com>
-rw-r--r--.buildkite/hooks/pre-command6
-rwxr-xr-xomnibus/omnibus-test.sh15
2 files changed, 5 insertions, 16 deletions
diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command
index c942fda34a..874b91ebdd 100644
--- a/.buildkite/hooks/pre-command
+++ b/.buildkite/hooks/pre-command
@@ -3,7 +3,7 @@
set -eu
# Only execute in the verify pipeline
-[[ "$BUILDKITE_PIPELINE_NAME" =~ verify$ ]] || exit 0
+[[ "$BUILDKITE_PIPELINE_NAME" =~ verify$ ]] || [[ "$BUILDKITE_PIPELINE_NAME" =~ validate/.* ]] || exit 0
docker ps || true
@@ -16,10 +16,10 @@ OMNIBUS_TOOLCHAIN_VERSION=$(cat .buildkite-platform.json | jq -r '.omnibus_toolc
export OMNIBUS_TOOLCHAIN_VERSION
echo $OMNIBUS_TOOLCHAIN_VERSION
-if [ $BUILDKITE_STEP_KEY == "build-windows-2019" ] && [ $BUILDKITE_ORGANIZATION_SLUG == "chef" ]
+if [ $BUILDKITE_STEP_KEY == "build-windows-2019" ] && [[ "$BUILDKITE_ORGANIZATION_SLUG" =~ chef(-canary)?$ ]]
then
TOKEN=$(curl -sX PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
- RESPONSE=$(curl -sH "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/iam/security-credentials/default-windows-2019-privileged-chef-Role)
+ RESPONSE=$(curl -sH "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/iam/security-credentials/default-windows-2019-privileged-$BUILDKITE_ORGANIZATION_SLUG-Role)
AWS_ACCESS_KEY_ID=$(echo $RESPONSE | jq -r '.AccessKeyId')
export AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY=$(echo $RESPONSE | jq -r '.SecretAccessKey')
diff --git a/omnibus/omnibus-test.sh b/omnibus/omnibus-test.sh
index 83c64ff2a6..9bdaa7cdc5 100755
--- a/omnibus/omnibus-test.sh
+++ b/omnibus/omnibus-test.sh
@@ -120,16 +120,5 @@ export CHEF_LICENSE=accept-no-persist
cd "$chef_gem"
-# only add -E if not on centos 6
-sudo_path="$(command -v sudo)"
-# cspell:disable-next-line
-rhel_sudo="/opt/rh/devtoolset-7/root/usr/bin/sudo"
-sudo_args=""
-if [[ "$sudo_path" != "$rhel_sudo" ]]; then
- echo "HERE"
- sudo -E bundle install --jobs=3 --retry=3
- sudo -E bundle exec rspec --profile -f progress
-else
- sudo bundle install --jobs=3 --retry=3
- sudo bundle exec rspec --profile -f progress
-fi
+sudo -E bundle install --jobs=3 --retry=3
+sudo -E bundle exec rspec --profile -f progress \ No newline at end of file