download during build

This commit is contained in:
aptalca 2019-07-16 10:55:30 -04:00 committed by Ryan Kuba
parent 0af4cfff5b
commit 121c47b60d
4 changed files with 17 additions and 10 deletions

View file

@ -35,12 +35,15 @@ RUN \
re2c \
unzip \
wget && \
echo "**** set version tag ****" && \
echo "**** download piwigo ****" && \
if [ -z ${PIWIGO_RELEASE+x} ]; then \
PIWIGO_RELEASE=$(curl -sX GET "https://api.github.com/repos/Piwigo/Piwigo/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
echo ${PIWIGO_RELEASE} > /version.txt
mkdir /piwigo && \
curl -o \
/piwigo/piwigo.zip -L \
"http://piwigo.org/download/dlcounter.php?code=${PIWIGO_RELEASE}"
# copy local files
COPY root/ /

View file

@ -35,12 +35,15 @@ RUN \
re2c \
unzip \
wget && \
echo "**** set version tag ****" && \
echo "**** download piwigo ****" && \
if [ -z ${PIWIGO_RELEASE+x} ]; then \
PIWIGO_RELEASE=$(curl -sX GET "https://api.github.com/repos/Piwigo/Piwigo/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
echo ${PIWIGO_RELEASE} > /version.txt
mkdir /piwigo && \
curl -o \
/piwigo/piwigo.zip -L \
"http://piwigo.org/download/dlcounter.php?code=${PIWIGO_RELEASE}"
# copy local files
COPY root/ /

View file

@ -35,12 +35,15 @@ RUN \
re2c \
unzip \
wget && \
echo "**** set version tag ****" && \
echo "**** download piwigo ****" && \
if [ -z ${PIWIGO_RELEASE+x} ]; then \
PIWIGO_RELEASE=$(curl -sX GET "https://api.github.com/repos/Piwigo/Piwigo/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
echo ${PIWIGO_RELEASE} > /version.txt
mkdir /piwigo && \
curl -o \
/piwigo/piwigo.zip -L \
"http://piwigo.org/download/dlcounter.php?code=${PIWIGO_RELEASE}"
# copy local files
COPY root/ /

View file

@ -6,11 +6,9 @@ mkdir -p \
# install piwigo
if [ ! -f "/config/www/gallery/index.php" ]; then
PIWIGO_RELEASE=$(cat /version.txt)
curl -o /tmp/piwigo.zip -L "http://piwigo.org/download/dlcounter.php?code=${PIWIGO_RELEASE}"
unzip -q /tmp/piwigo.zip -d /tmp
unzip -q /piwigo/piwigo.zip -d /tmp
mv /tmp/piwigo/* /config/www/gallery
rm -rf /tmp/piwigo /tmp/piwigo.zip
rm -rf /tmp/piwigo
fi
# copy config