From dc05950486f8bf108141d69256799a3b9ab57e7c Mon Sep 17 00:00:00 2001 From: Nianyu Shen Date: Mon, 16 Dec 2024 14:01:24 +0800 Subject: [PATCH] fix: fips binary name in install script (#87) Signed-off-by: Nianyu Shen --- Earthfile | 10 ++++++---- palette-agent-install.sh.tmpl | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Earthfile b/Earthfile index 77b8075..28ccdb6 100644 --- a/Earthfile +++ b/Earthfile @@ -107,19 +107,21 @@ install-script: ARG IMAGE_REPO=${SPECTRO_PUB_REPO}/edge # https://github.com/spectrocloud/agent-mode/releases/download/v4.5.0-rc2/palette-agent-linux-amd64 ARG AGENT_URL_PREFIX=https://github.com/spectrocloud/agent-mode/releases/download/${VERSION} + LET BIN_PREFIX=palette-agent + LET SCRIPT_NAME=palette-agent-install.sh IF $FIPS - ARG SCRIPT_NAME=palette-agent-install-fips.sh - ELSE - ARG SCRIPT_NAME=palette-agent-install.sh + SET BIN_PREFIX=palette-agent-fips + SET SCRIPT_NAME=palette-agent-install-fips.sh END ENV PE_VERSION=${PE_VERSION} ENV IMAGE_REPO=${IMAGE_REPO} ENV AGENT_URL_PREFIX=${AGENT_URL_PREFIX} + ENV BIN_PREFIX=${BIN_PREFIX} WORKDIR /workdir COPY palette-agent-install.sh.tmpl /workdir/palette-agent-install.sh.tmpl - RUN envsubst '${PE_VERSION} ${IMAGE_REPO} ${AGENT_URL_PREFIX}' < /workdir/palette-agent-install.sh.tmpl > /workdir/${SCRIPT_NAME} + RUN envsubst '${PE_VERSION} ${IMAGE_REPO} ${AGENT_URL_PREFIX} ${BIN_PREFIX}' < /workdir/palette-agent-install.sh.tmpl > /workdir/${SCRIPT_NAME} RUN chmod +x /workdir/${SCRIPT_NAME} SAVE ARTIFACT /workdir/${SCRIPT_NAME} AS LOCAL ./build/${SCRIPT_NAME} diff --git a/palette-agent-install.sh.tmpl b/palette-agent-install.sh.tmpl index b84d9c5..d5ceb2f 100644 --- a/palette-agent-install.sh.tmpl +++ b/palette-agent-install.sh.tmpl @@ -29,9 +29,9 @@ for dep in "${dependencies[@]}"; do done IMAGE=${IMAGE:-${IMAGE_REPO}/stylus-agent-mode-linux-${ARCH}:${VERSION}} -URL=${URL:-${AGENT_URL_PREFIX}/palette-agent-linux-${ARCH}} +URL=${URL:-${AGENT_URL_PREFIX}/${BIN_PREFIX}-linux-${ARCH}} -# Download edge-agent +# Download palette-agent curl -v -L $URL -o palette-agent chmod +x palette-agent