From 2ae232874ce1a1d6d2cf17d646df1ad4ab997569 Mon Sep 17 00:00:00 2001 From: azlam Date: Mon, 18 Sep 2023 21:59:45 +1000 Subject: [PATCH] fix(cicd): add plugin home --- dockerfiles/sfpowerscripts.Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dockerfiles/sfpowerscripts.Dockerfile b/dockerfiles/sfpowerscripts.Dockerfile index 2eeb95b57..cf871a151 100644 --- a/dockerfiles/sfpowerscripts.Dockerfile +++ b/dockerfiles/sfpowerscripts.Dockerfile @@ -21,6 +21,7 @@ LABEL org.opencontainers.image.title "DX@Scale sfpowercripts docker image - Augu ENV DEBIAN_FRONTEND=noninteractive +RUN ln -sf bash /bin/sh RUN apt-get update \ @@ -64,12 +65,21 @@ RUN npm install --global --omit=dev \ && npm cache clean --force + +# Set XDG environment variables explicitly so that GitHub Actions does not apply +# default paths that do not point to the plugins directory +# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html +ENV XDG_DATA_HOME=/sf_plugins/.local/share \ + XDG_CONFIG_HOME=/sf_plugins/.config \ + XDG_CACHE_HOME=/sf_plugins/.cache \ + JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/ + + # Create symbolic link from sh to bash # Create isolated plugins directory with rwx permission for all users # Azure pipelines switches to a container-user which does not have access # to the root directory where plugins are normally installed -RUN ln -sf bash /bin/sh && \ - mkdir -p $XDG_DATA_HOME && \ +RUN mkdir -p $XDG_DATA_HOME && \ mkdir -p $XDG_CONFIG_HOME && \ mkdir -p $XDG_CACHE_HOME && \ chmod -R 777 sfdx_plugins && \