Skip to content

Commit

Permalink
fix: fips binary name in install script (#87)
Browse files Browse the repository at this point in the history
Signed-off-by: Nianyu Shen <[email protected]>
  • Loading branch information
nianyush authored Dec 16, 2024
1 parent 4257707 commit dc05950
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
4 changes: 2 additions & 2 deletions palette-agent-install.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit dc05950

Please sign in to comment.