Simplified docker image building, as it will now be run in a different job as the dist file release

This commit is contained in:
Alejandro Celaya 2020-05-17 10:13:33 +02:00
parent 68253c3bc4
commit 0a3a97242b
2 changed files with 2 additions and 6 deletions

View file

@ -4,3 +4,4 @@
./node_modules ./node_modules
./test ./test
./shlink-web-client.gif ./shlink-web-client.gif
./dist

View file

@ -3,12 +3,7 @@ COPY . /shlink-web-client
ARG VERSION="latest" ARG VERSION="latest"
ENV VERSION ${VERSION} ENV VERSION ${VERSION}
RUN cd /shlink-web-client && \ RUN cd /shlink-web-client && \
UNCOMPRESSED="shlink-web-client_${VERSION}_dist" && \ npm install && npm run build -- ${VERSION} --no-dist
DIST_FILE="./dist/${UNCOMPRESSED}.zip" && \
# If a dist file already exists, just unzip it
if [[ -f ${DIST_FILE} ]]; then unzip ${DIST_FILE} && mv ./${UNCOMPRESSED} ./build ; fi && \
# If no dist file exsts, build from scratch
if [[ ! -f ${DIST_FILE} ]]; then npm install && npm run build -- ${VERSION} --no-dist ; fi
FROM nginx:1.17.10-alpine FROM nginx:1.17.10-alpine
LABEL maintainer="Alejandro Celaya <alejandro@alejandrocelaya.com>" LABEL maintainer="Alejandro Celaya <alejandro@alejandrocelaya.com>"