File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 158158#
159159# Generate new config.json if it does not exist
160160#
161+ SEMAPHORE_FIRST_RUN=no
161162if [ ! -f " ${SEMAPHORE_CONFIG_PATH} /config.json" ]; then
163+ SEMAPHORE_FIRST_RUN=yes
162164 echoerr " Generating setup file ${TMP_STDIN_CONFIG_FILE} ..."
163165
164166 TMP_STDIN_CONFIG_FILE=$( mktemp)
271273
272274
273275#
274- # Migrate from BoltDB if SEMAPHORE_MIGRATE_FROM_BOLTDB is set (SQLite only, skipped if DB file already exists)
276+ # Migrate from BoltDB if SEMAPHORE_MIGRATE_FROM_BOLTDB is set (first run only, SQLite only, skipped if DB file already exists)
275277#
276- if [ -n " ${SEMAPHORE_MIGRATE_FROM_BOLTDB:- } " ]; then
278+ if [ -n " ${SEMAPHORE_MIGRATE_FROM_BOLTDB:- } " ] && [ " ${SEMAPHORE_FIRST_RUN} " = " yes " ] ; then
277279 if [ " ${SEMAPHORE_DB_DIALECT} " != " sqlite" ]; then
278280 echoerr " SEMAPHORE_MIGRATE_FROM_BOLTDB is only supported with SQLite dialect, ignoring"
279- elif [ -f " ${SEMAPHORE_DB_HOST} " ]; then
280- echoerr " SQLite database ${SEMAPHORE_DB_HOST} already exists, skipping BoltDB migration"
281281 else
282282 echoerr " Migrating from BoltDB: ${SEMAPHORE_MIGRATE_FROM_BOLTDB} "
283283 MIGRATE_ARGS=" --from-boltdb=${SEMAPHORE_MIGRATE_FROM_BOLTDB} --merge-existing-users"
You can’t perform that action at this time.
0 commit comments