File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
circleci/images/exttester Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ ENV CITUS_VERSIONS=$CITUS_VERSION
189189
190190WORKDIR /build-citus/
191191COPY citusupgradetester/files/sbin/build-citus .
192- RUN ./build-citus
192+ RUN if [ -n "${CITUS_VERSION}" ]; then ./build-citus; else echo "Skipping citus build - CITUS_VERSION not set" ; fi
193193
194194
195195FROM setup-environment
@@ -205,10 +205,17 @@ ENV PG_VERSION=$PG_VERSION
205205COPY --from=dev-tools-collection /collect/ /
206206
207207# copy citus so files from the build-citus stage
208- WORKDIR /opt/citus-versions/${CITUS_VERSION}
209- COPY --from=build-citus /build-citus/so-pg${PG_MAJOR}-citus${CITUS_VERSION}.tar .
210- RUN tar xvf so-pg${PG_MAJOR}-citus${CITUS_VERSION}.tar
211- # cleanup build artifacts
212- RUN rm so-pg${PG_MAJOR}-citus${CITUS_VERSION}.tar
208+ COPY --from=build-citus /build-citus/ /tmp/build-citus/
209+
210+ # Extract conditionally in shell
211+ RUN <<'EOF'
212+ set -eux
213+ if [ -n "${CITUS_VERSION}" ] && [ -f "/tmp/build-citus/so-pg${PG_MAJOR}-citus${CITUS_VERSION}.tar" ]; then
214+ mkdir -p /opt/citus-versions/${CITUS_VERSION}
215+ cd /opt/citus-versions/${CITUS_VERSION}
216+ tar xvf /tmp/build-citus/so-pg${PG_MAJOR}-citus${CITUS_VERSION}.tar
217+ fi
218+ EOF
219+ RUN rm -rf /tmp/build-citus/
213220
214221WORKDIR /home/circleci
You can’t perform that action at this time.
0 commit comments