File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -287,6 +287,29 @@ if [ -n "${SEMAPHORE_IMPORT_PROJECT_FILE:-}" ]; then
287287fi
288288
289289
290+ #
291+ # Migrate from BoltDB if SEMAPHORE_MIGRATE_FROM_BOLTDB is set (SQLite only, skipped if DB file already exists)
292+ #
293+ if [ -n " ${SEMAPHORE_MIGRATE_FROM_BOLTDB:- } " ]; then
294+ if [ " ${SEMAPHORE_DB_DIALECT} " != " sqlite" ]; then
295+ echoerr " SEMAPHORE_MIGRATE_FROM_BOLTDB is only supported with SQLite dialect, ignoring"
296+ elif [ -f " ${SEMAPHORE_DB_HOST} " ]; then
297+ echoerr " SQLite database ${SEMAPHORE_DB_HOST} already exists, skipping BoltDB migration"
298+ else
299+ echoerr " Migrating from BoltDB: ${SEMAPHORE_MIGRATE_FROM_BOLTDB} "
300+ MIGRATE_ARGS=" --from-boltdb=${SEMAPHORE_MIGRATE_FROM_BOLTDB} "
301+ if [ -n " ${SEMAPHORE_MIGRATE_SKIP_TASK_OUTPUT:- } " ]; then
302+ MIGRATE_ARGS=" ${MIGRATE_ARGS} --skip-task-output"
303+ fi
304+ if test " $# " -ne 1; then
305+ /usr/local/bin/semaphore migrate ${MIGRATE_ARGS} --config " ${SEMAPHORE_CONFIG_PATH} /config.json"
306+ else
307+ " $1 " migrate ${MIGRATE_ARGS} --config " ${SEMAPHORE_CONFIG_PATH} /config.json"
308+ fi
309+ fi
310+ fi
311+
312+
290313#
291314# Start Semaphore server
292315#
You can’t perform that action at this time.
0 commit comments