Skip to content

Commit

Permalink
Changes [build image]
Browse files Browse the repository at this point in the history
  • Loading branch information
Electroid committed Nov 13, 2024
1 parent e8b730d commit 211b3cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
22 changes: 6 additions & 16 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,7 @@ grant_to_user() {
}

which() {
path="$(command -v "$1")"
if [ -f "$path" ]; then
echo "$path"
elif [ "$can_sudo" = "1" ]; then
execute_sudo which "$1"
fi
command -v "$1"
}

require() {
Expand Down Expand Up @@ -501,13 +496,11 @@ install_common_software() {
bash \
ca-certificates \
curl \
jq \
htop \
gnupg \
git \
unzip \
wget \
zip
wget

install_rosetta
install_nodejs
Expand Down Expand Up @@ -811,18 +804,15 @@ create_buildkite_user() {
;;
esac

getent="$(require getent)"
if [ -z "$("$getent" passwd "$user")" ]; then
useradd="$(require useradd)"
execute_sudo "$useradd" "$user" \
if [ -z "$(getent passwd "$user")" ]; then
execute_sudo useradd "$user" \
--system \
--no-create-home \
--home-dir "$home"
fi

if [ -n "$("$getent" group docker)" ]; then
usermod="$(require usermod)"
execute_sudo "$usermod" -aG docker "$user"
if [ -n "$(getent group docker)" ]; then
execute_sudo usermod -aG docker "$user"
fi

paths="$home /var/cache/buildkite-agent /var/log/buildkite-agent /var/run/buildkite-agent/buildkite-agent.sock"
Expand Down
2 changes: 1 addition & 1 deletion scripts/machine.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ function getUsername(distro) {
return "ubuntu";
}

if (/amazon|amzn/i.test(distro)) {
if (/amazon|amzn|al\d+/i.test(distro)) {
return "ec2-user";
}

Expand Down

0 comments on commit 211b3cd

Please sign in to comment.