mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-04-30 20:34:35 +02:00
Migrate if installed commit differs from program commit
This commit is contained in:
parent
f0eb18653e
commit
482e97e2c1
@ -168,6 +168,7 @@ ENV \
|
|||||||
ARG VERSION=unknown
|
ARG VERSION=unknown
|
||||||
ARG CREATED="an unknown date"
|
ARG CREATED="an unknown date"
|
||||||
ARG COMMIT=unknown
|
ARG COMMIT=unknown
|
||||||
|
ENV COMMIT=${COMMIT}
|
||||||
LABEL \
|
LABEL \
|
||||||
org.opencontainers.image.authors="https://github.com/Bubka" \
|
org.opencontainers.image.authors="https://github.com/Bubka" \
|
||||||
org.opencontainers.image.version=$VERSION \
|
org.opencontainers.image.version=$VERSION \
|
||||||
|
@ -23,15 +23,20 @@ else
|
|||||||
fi
|
fi
|
||||||
ln -sF /2fauth/storage /srv/storage
|
ln -sF /2fauth/storage /srv/storage
|
||||||
|
|
||||||
|
# Note: ${COMMIT} is set by the CI
|
||||||
if [ -f /2fauth/installed ]; then
|
if [ -f /2fauth/installed ]; then
|
||||||
|
INSTALLED_COMMIT="$(cat /2fauth/installed)"
|
||||||
|
if [ "${INSTALLED_COMMIT}" != "${COMMIT}" ]; then
|
||||||
|
echo "Installed commit ${INSTALLED_COMMIT} is different from program commit ${COMMIT}, we are migrating..."
|
||||||
php artisan migrate
|
php artisan migrate
|
||||||
php artisan config:clear
|
php artisan config:clear
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
php artisan migrate:refresh
|
php artisan migrate:refresh
|
||||||
php artisan passport:install
|
php artisan passport:install
|
||||||
echo "do not remove me" > /2fauth/installed
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "${COMMIT}" > /2fauth/installed
|
||||||
php artisan storage:link
|
php artisan storage:link
|
||||||
php artisan config:cache
|
php artisan config:cache
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user