mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-21 12:28:19 -05:00
Workaround for an issue that arised after Jenkins has been migrated to new machine. Because of some reason build would fail on rsync'ing non-existent '.db-journal' files - locally the same rsync works perfectly fine. These files are not needed anyway, so temporary exclude them from rsync. This should be reverted after CI/CD is fixed.
40 lines
1.2 KiB
CMake
40 lines
1.2 KiB
CMake
set(ASSETS_SOURCE_DIR ${CMAKE_SOURCE_DIR}/image)
|
|
|
|
function(add_assets_target)
|
|
cmake_parse_arguments(
|
|
_ASSETS
|
|
""
|
|
"TARGET;SOURCE_DIR;SYSTEM_DEST_DIR;USER_DEST_DIR;DEVEL;"
|
|
"DEPENDS"
|
|
${ARGN}
|
|
)
|
|
|
|
add_custom_target(
|
|
${_ASSETS_TARGET}
|
|
DEPENDS ${_ASSETS_DEPENDS}
|
|
|
|
# Copy user assets
|
|
COMMAND mkdir -p ${_ASSETS_USER_DEST_DIR}
|
|
COMMAND rsync -qau
|
|
${_ASSETS_SOURCE_DIR}/user/
|
|
${_ASSETS_USER_DEST_DIR}
|
|
COMMAND find ${_ASSETS_USER_DEST_DIR} -name "*-devel*" | sed "\"s,\\(.*\\)-devel\\(.*\\),& \\1\\2,\"" | xargs --no-run-if-empty -L1 mv
|
|
|
|
# Copy system assets
|
|
COMMAND mkdir -p ${_ASSETS_SYSTEM_DEST_DIR}
|
|
COMMAND rsync -qau
|
|
${_ASSETS_SOURCE_DIR}/system_a/data
|
|
${_ASSETS_SOURCE_DIR}/system_a/db
|
|
${_ASSETS_SYSTEM_DEST_DIR}
|
|
|
|
# Create 'golden copy' of DBs
|
|
COMMAND mkdir -p ${_ASSETS_SYSTEM_DEST_DIR}/db/factory
|
|
COMMAND rsync -qlptgoDu
|
|
--exclude '*.db-journal'
|
|
${_ASSETS_SYSTEM_DEST_DIR}/db/*
|
|
${_ASSETS_SYSTEM_DEST_DIR}/db/factory
|
|
|
|
COMMENT "Copying assets... add_assets_target (${_ASSETS_TARGET}) <- ${_ASSETS_DEPENDS}"
|
|
)
|
|
endfunction()
|