Ivan Schaller
bbfd70238c
Some checks reported errors
continuous-integration/drone/tag Build was killed
20 lines
488 B
Text
20 lines
488 B
Text
#!/usr/bin/with-contenv bash
|
|
# shellcheck shell=bash
|
|
|
|
# source env variables
|
|
source /etc/cont-init.d/20-setenv
|
|
|
|
|
|
# check if lock file is present
|
|
if [[ ! -f /flox/.lock ]]; then
|
|
printf 'Copying files to bind mount path\n'
|
|
# move app to permanent path
|
|
rsync --archive --delete --backup --backup-dir=/tmp /app/flox/ /flox
|
|
|
|
# create lock file to prevent overwriting existing files
|
|
touch /flox/.lock
|
|
chmod 600 /flox/.lock
|
|
else
|
|
printf 'Lock file present. Not copying files\n'
|
|
fi
|
|
|