ci: ensure Pulumi versions always match

This commit is contained in:
Stefan Reimer 2023-12-04 16:51:28 +00:00
parent ff2de9d390
commit 95a667c57b

View File

@ -1,9 +1,7 @@
ARG RUNTIME_VERSION="3.11" ARG RUNTIME_VERSION="3.11"
ARG DISTRO_VERSION="3.18" ARG DISTRO_VERSION="3.18"
ARG PULUMI_VERSION="3.89.0"
FROM python:${RUNTIME_VERSION}-alpine${DISTRO_VERSION} AS builder FROM python:${RUNTIME_VERSION}-alpine${DISTRO_VERSION} AS builder
ARG PULUMI_VERSION
ARG RUNTIME_VERSION="3.11" ARG RUNTIME_VERSION="3.11"
RUN apk add --no-cache \ RUN apk add --no-cache \
@ -20,12 +18,6 @@ RUN apk add --no-cache \
openssl-dev \ openssl-dev \
git git
RUN if [ "$PULUMI_VERSION" = "latest" ]; then \
curl -fsSL https://get.pulumi.com/ | sh; \
else \
curl -fsSL https://get.pulumi.com/ | sh -s -- --version $PULUMI_VERSION ; \
fi
ENV VIRTUAL_ENV=/venv ENV VIRTUAL_ENV=/venv
RUN python -m venv $VIRTUAL_ENV RUN python -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH" ENV PATH="$VIRTUAL_ENV/bin:$PATH"
@ -33,7 +25,10 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Install CloudBender # Install CloudBender
WORKDIR /app WORKDIR /app
COPY . /app COPY . /app
RUN pip install . RUN pip install . --disable-pip-version-check
# Install matching Pulumi binaries
RUN curl -fsSL https://get.pulumi.com/ | sh -s -- --version $(pip show pulumi --disable-pip-version-check | grep Version: | awk '{print $2}')
# minimal pulumi # minimal pulumi
RUN cd /root/.pulumi/bin && rm -f *dotnet *yaml *go *java && strip pulumi* || true RUN cd /root/.pulumi/bin && rm -f *dotnet *yaml *go *java && strip pulumi* || true