Skip to content

Commit

Permalink
Fix release download
Browse files Browse the repository at this point in the history
  • Loading branch information
lukehinds committed Jan 7, 2025
1 parent eec0e57 commit 3ad4566
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ COPY . /app
# Build the webapp
FROM node:23-slim AS webbuilder

# Set the release URL (this should be static and not change often)
ARG LATEST_RELEASE=https://api.github.com/repos/stacklok/codegate-ui/releases/latest

# Install curl for downloading the webapp from GH and unzip to extract it
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
Expand All @@ -36,10 +33,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \

WORKDIR /usr/src/

# Download the latest release of the webapp in one single RUN instruction
RUN TAG=$(curl -s ${LATEST_RELEASE} | jq -r '.tag_name') && \
echo "Latest FE release: ${TAG}" && \
curl -s ${LATEST_RELEASE} | jq -r '.zipball_url' | xargs curl -L -o main.zip
# Ensure the LATEST_RELEASE argument is passed or set a default value
ARG LATEST_RELEASE="https://api.github.com/repos/stacklok/codegate-ui/releases/latest"
RUN echo "Latest FE release: $LATEST_RELEASE" \
&& TAG=$(curl -s $LATEST_RELEASE | jq -r '.tag_name') \
&& echo "Latest FE release: ${TAG}" \
&& ZIP_URL=$(curl -s $LATEST_RELEASE | jq -r '.zipball_url') \
&& curl -L -o main.zip $ZIP_URL

# Extract the downloaded zip file
RUN unzip main.zip
Expand Down

0 comments on commit 3ad4566

Please sign in to comment.