mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-02-22 13:20:51 +01: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 CREATED="an unknown date"
|
||||
ARG COMMIT=unknown
|
||||
ENV COMMIT=${COMMIT}
|
||||
LABEL \
|
||||
org.opencontainers.image.authors="https://github.com/Bubka" \
|
||||
org.opencontainers.image.version=$VERSION \
|
||||
|
@ -23,15 +23,20 @@ else
|
||||
fi
|
||||
ln -sF /2fauth/storage /srv/storage
|
||||
|
||||
# Note: ${COMMIT} is set by the CI
|
||||
if [ -f /2fauth/installed ]; then
|
||||
php artisan migrate
|
||||
php artisan config:clear
|
||||
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 config:clear
|
||||
fi
|
||||
else
|
||||
php artisan migrate:refresh
|
||||
php artisan passport:install
|
||||
echo "do not remove me" > /2fauth/installed
|
||||
fi
|
||||
|
||||
echo "${COMMIT}" > /2fauth/installed
|
||||
php artisan storage:link
|
||||
php artisan config:cache
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user