Skip to content
Snippets Groups Projects
Commit d94a048f authored by Lars Bilke's avatar Lars Bilke
Browse files

Added target upload-data which transfers files to Amazon S3.

- requires s3cmd (http://s3tools.org/s3cmd)
parent 4b6c26d5
No related branches found
No related tags found
No related merge requests found
...@@ -60,6 +60,8 @@ endif() ...@@ -60,6 +60,8 @@ endif()
find_program(CURL_TOOL_PATH curl DOC "The curl-tool") find_program(CURL_TOOL_PATH curl DOC "The curl-tool")
find_program(S3CMD_TOOL_PATH s3cmd DOC "S3cmd tool for uploading to Amazon S3")
###################### ######################
### Find libraries ### ### Find libraries ###
###################### ######################
......
include(ExternalData) include(ExternalData)
set(ExternalData_LOCAL_FOLDER ogs6-data)
set(ExternalData_OBJECT_STORES "${ExternalData_OBJECT_STORES_DEFAULT}" CACHE STRING set(ExternalData_OBJECT_STORES "${ExternalData_OBJECT_STORES_DEFAULT}" CACHE STRING
"Semicolon-separated list of local directories holding test data files in the layout %(algo)/%(hash).") "Semicolon-separated list of local directories holding test data files in the layout %(algo)/%(hash).")
mark_as_advanced(ExternalData_OBJECT_STORES) mark_as_advanced(ExternalData_OBJECT_STORES)
if(NOT ExternalData_OBJECT_STORES) if(NOT ExternalData_OBJECT_STORES)
set(ExternalData_OBJECT_STORES "${CMAKE_SOURCE_DIR}/../ogs6-data") set(ExternalData_OBJECT_STORES "${CMAKE_SOURCE_DIR}/../${ExternalData_LOCAL_FOLDER}")
file(MAKE_DIRECTORY "${ExternalData_OBJECT_STORES}") file(MAKE_DIRECTORY "${ExternalData_OBJECT_STORES}")
endif() endif()
...@@ -12,7 +14,13 @@ set(ExternalData_SOURCE_ROOT ${CMAKE_SOURCE_DIR}/Tests/Data) ...@@ -12,7 +14,13 @@ set(ExternalData_SOURCE_ROOT ${CMAKE_SOURCE_DIR}/Tests/Data)
set(ExternalData_BINARY_ROOT ${CMAKE_BINARY_DIR}/Tests/Data) set(ExternalData_BINARY_ROOT ${CMAKE_BINARY_DIR}/Tests/Data)
set(ExternalData_LINK_CONTENT MD5) set(ExternalData_LINK_CONTENT MD5)
set(ExternalData_URL_TEMPLATES "http://www.opengeosys.org/images/dev/%(algo)/%(hash)") # Amazon S3 config
set(ExternalData_S3_Bucket opengeosys)
set(ExternalData_URL_TEMPLATES
"http://www.opengeosys.org/images/dev/%(algo)/%(hash)"
"http://${ExternalData_S3_Bucket}.s3.amazonaws.com/${ExternalData_LOCAL_FOLDER}/%(algo)/%(hash)"
)
add_custom_target( add_custom_target(
move-data move-data
...@@ -24,12 +32,20 @@ add_custom_target( ...@@ -24,12 +32,20 @@ add_custom_target(
VERBATIM VERBATIM
) )
if(S3CMD_TOOL_PATH)
add_custom_target(
upload-data
COMMAND ${S3CMD_TOOL_PATH} sync --acl-public --skip-existing --no-check-md5
${CMAKE_SOURCE_DIR}/../${ExternalData_LOCAL_FOLDER} s3://${ExternalData_S3_Bucket}
)
endif()
if(HOSTNAME STREQUAL "envinf1.eve.ufz.de") if(HOSTNAME STREQUAL "envinf1.eve.ufz.de")
add_custom_target( add_custom_target(
sync-data sync-data
COMMAND ${CMAKE_COMMAND} -E copy_directory COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/../ogs6-data ${CMAKE_SOURCE_DIR}/../${ExternalData_LOCAL_FOLDER}
/data/ogs/ogs6-data /data/ogs/${ExternalData_LOCAL_FOLDER}
) )
if(CURL_TOOL_PATH) if(CURL_TOOL_PATH)
add_custom_command( add_custom_command(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment