From 2f2ebda3e0131dcf45f9aa42fe41e22effd0b13a Mon Sep 17 00:00:00 2001 From: aram price Date: Tue, 9 Jun 2026 16:35:14 -0700 Subject: [PATCH] CI: remove (future) deprecated `--preserve-env` flag Explicitly pass: - GEM_HOME - BUILD_TIME - UBUNTU_ADVANTAGE_TOKEN - UBUNTU_FIPS_USE_IAAS_KERNEL Fixes: ``` sudo: preserving the entire environment is not supported, '--preserve-env' is ignored ubuntu@21f652d6-b208-4386-b0c0-097e26578228:/tmp/build/44575cf5$ set -e ubuntu@21f652d6-b208-4386-b0c0-097e26578228:/tmp/build/44575cf5$ ubuntu@21f652d6-b208-4386-b0c0-097e26578228:/tmp/build/44575cf5$ cd "/tmp/build/44575cf5/bosh-linux-stemcell-builder" ubuntu@21f652d6-b208-4386-b0c0-097e26578228:/tmp/build/44575cf5/bosh-linux-stemcell-builder$ bundle install Bundler 4.0.13 is running, but your lockfile was generated with 2.5.23. Installing Bundler 2.5.23 and restarting using that version. Fetching gem metadata from https://rubygems.org/. Fetching bundler 2.5.23 Retrying download gem from https://rubygems.org/ due to error (2/4): Bundler::PermissionError There was an error while trying to write to `/usr/local/lib/ruby/gems/3.3.0/cache/bundler-2.5.23.gem`. It is likely that you need to grant write permissions for that path. ``` ^ https://bosh.ci.cloudfoundry.org/teams/stemcell/pipelines/ubuntu-resolute-builder/jobs/build-os-image/builds/1#L6a052874:4:13 --- ci/tasks/build.sh | 8 ++++++-- ci/tasks/os-images/build.sh | 9 +++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ci/tasks/build.sh b/ci/tasks/build.sh index d69d2b5cdc..a9c4a178ca 100755 --- a/ci/tasks/build.sh +++ b/ci/tasks/build.sh @@ -77,13 +77,17 @@ chown -R ubuntu:ubuntu "${REPO_PARENT}/bosh-linux-stemcell-builder" chown -R ubuntu:ubuntu /mnt sudo chmod u+s "$(which sudo)" -sudo --preserve-env --set-home --user ubuntu -- /bin/bash --login -i <