Skip to content

Commit 792afbd

Browse files
committed
fix: apply verified Pulumi installation logic
1 parent 21b477f commit 792afbd

1 file changed

Lines changed: 15 additions & 14 deletions

File tree

src/features/pulumi/install.sh

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,30 @@ elif [ -f /etc/alpine-release ]; then
1515
fi
1616

1717
# Pulumi installation script
18-
# We'll use a temporary directory to avoid issues with $HOME in some container environments
19-
export PULUMI_HOME="/tmp/pulumi"
20-
mkdir -p "${PULUMI_HOME}"
21-
2218
if [ "${VERSION}" = "latest" ]; then
23-
curl -fsSL https://get.pulumi.com | sh -s -- --install-root "${PULUMI_HOME}"
19+
curl -fsSL https://get.pulumi.com | sh
2420
else
25-
curl -fsSL https://get.pulumi.com | sh -s -- --version "${VERSION}" --install-root "${PULUMI_HOME}"
21+
curl -fsSL https://get.pulumi.com | sh -s -- --version "${VERSION}"
22+
fi
23+
24+
# Determine the binary path (script usually puts it in $HOME/.pulumi/bin or /root/.pulumi/bin)
25+
PULUMI_BIN_DIR="$HOME/.pulumi/bin"
26+
if [ ! -d "$PULUMI_BIN_DIR" ]; then
27+
PULUMI_BIN_DIR="/root/.pulumi/bin"
2628
fi
2729

28-
# Move binaries to /usr/local/bin so they are in the PATH for all users
29-
# The installer might put them in bin/ or .pulumi/bin/ depending on the version/environment
30-
if [ -d "${PULUMI_HOME}/bin" ]; then
31-
mv "${PULUMI_HOME}/bin/"* /usr/local/bin/
32-
elif [ -d "${PULUMI_HOME}/.pulumi/bin" ]; then
33-
mv "${PULUMI_HOME}/.pulumi/bin/"* /usr/local/bin/
30+
# Ensure the binaries are accessible on the system PATH for all users
31+
if [ -d "$PULUMI_BIN_DIR" ]; then
32+
echo "Linking Pulumi binaries to /usr/local/bin..."
33+
for bin in "$PULUMI_BIN_DIR"/*; do
34+
ln -sf "$bin" "/usr/local/bin/$(basename "$bin")"
35+
done
3436
fi
35-
rm -rf "${PULUMI_HOME}"
3637

3738
# Clean up apt lists if on Debian
3839
if [ -f /etc/debian_version ]; then
3940
rm -rf /var/lib/apt/lists/*
4041
fi
4142

4243
echo "Pulumi installed successfully!"
43-
/usr/local/bin/pulumi version
44+
pulumi version

0 commit comments

Comments
 (0)