WIP automatic deployment
authorAntonin Descampe <antonin@gmail.com>
Sun, 15 May 2016 14:01:20 +0000 (16:01 +0200)
committerAntonin Descampe <antonin@gmail.com>
Sun, 15 May 2016 14:01:20 +0000 (16:01 +0200)
.travis.yml
tools/ctest_scripts/travis-ci.cmake
tools/travis-ci/run.sh

index 7f5748c8bdb5bac86f40ba6e430b18abf5cfa658..0618f26e9e131c4ce8f99f97fd05c04adc4a04ff 100644 (file)
@@ -67,7 +67,7 @@ script:
   - ./tools/travis-ci/abi-check.sh
 
 before_deploy:
-  - export OPJ_RELEASE_PKG_FILE=$(ls openjpeg*.zip)
+  - export OPJ_RELEASE_PKG_FILE=$(ls build/openjpeg-${TRAVIS_TAG}*)
   - echo "deploying $OPJ_RELEASE_PKG_FILE to GitHub releases"
 
 deploy:
index 93d65bc0e56fc04d661e4f0d9a151f6221165979..f8c50e5bed7fa213b2f13d49818319c3729df373 100644 (file)
@@ -123,12 +123,6 @@ endif()
 set( CTEST_SOURCE_DIRECTORY    "$ENV{OPJ_SOURCE_DIR}")
 set( CTEST_BINARY_DIRECTORY    "${CTEST_DASHBOARD_ROOT}")
 
-# #----------------------
-# # Package parameters in case of deployment
-# # Might add more parameters later on
-# set( CPACK_GENERATOR "ZIP" )
-
-
 #---------------------
 # Files to submit to the dashboard
 set (CTEST_NOTES_FILES
@@ -153,9 +147,5 @@ endif()
 if ("$ENV{OPJ_DO_SUBMIT}" STREQUAL "1")
        ctest_submit()
 endif()
-# # Generate package if deployment
-# if( "$ENV{OPJ_CI_DEPLOY}" STREQUAL "1")
-#      ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" TARGET "package")
-# endif()
 # Do not clean, we'll parse the log for known failure
 #ctest_empty_binary_directory( "${CTEST_BINARY_DIRECTORY}" )
index f0d39a87dddee19ee0518ff5adc684f526028810..245ad88bee15d7aec4e1357676a0ee474bc3c95b 100755 (executable)
@@ -190,17 +190,31 @@ ctest -S ${OPJ_SOURCE_DIR}/tools/ctest_scripts/travis-ci.cmake -V || true
 set +x
 
 # Deployment if needed
+#---------------------
 #if [ "${OPJ_CI_INCLUDE_IF_DEPLOY:-}" == "1" ] && [ [ "${TRAVIS_TAG:-}" != "" ] || [ "${APPVEYOR_REPO_TAG:-}" == "true" ] ]; then
 if [ "${OPJ_CI_INCLUDE_IF_DEPLOY:-}" == "1" ]; then
-       OPJ_CI_DEPLOY=1
+       OPJ_CI_DEPLOY=1         # unused for now
        OPJ_CUR_DIR=${PWD}
+       if [ "${TRAVIS_OS_NAME:-}" == "linux"]; then
+               OPJ_PACK_GENERATOR="TGZ" # ZIP generator currently segfaults on linux
+       else
+               OPJ_PACK_GENERATOR="ZIP"
+       fi
+       if [ "${TRAVIS_TAG:-}" != "" ]; then
+               OPJ_TAG_NAME=${TRAVIS_TAG}
+       elif [ "${APPVEYOR_REPO_TAG:-}" == "true" ]; then
+               OPJ_TAG_NAME=${APPVEYOR_REPO_TAG_NAME}
+       else
+               OPJ_TAG_NAME=test
+       fi
+       OPJ_PACK_NAME="openjpeg-${OPJ_TAG_NAME}-${TRAVIS_OS_NAME}-${OPJ_CI_ARCH}"
        cd ${OPJ_BINARY_DIR}
-       cmake -D CPACK_GENERATOR:STRING=ZIP ${OPJ_SOURCE_DIR}
+       cmake -D CPACK_GENERATOR:STRING=${OPJ_PACK_GENERATOR} -D CPACK_PACKAGE_FILE_NAME:STRING=${OPJ_PACK_NAME} ${OPJ_SOURCE_DIR}
        cd ${OPJ_CUR_DIR}
        cmake --build ${OPJ_BINARY_DIR} --target package
-       echo "ready to deploy $(ls ${OPJ_BINARY_DIR}/openjpeg*.zip) to GitHub releases"
+       echo "ready to deploy $(ls ${OPJ_BINARY_DIR}/${OPJ_PACK_NAME}*) to GitHub releases"
        if [ "${APPVEYOR_REPO_TAG:-}" == "true" ]; then
-               appveyor PushArtifact "${OPJ_BINARY_DIR}/openjpeg-*.zip"
+               appveyor PushArtifact "${OPJ_BINARY_DIR}/${OPJ_PACK_NAME}.zip"
        fi
 else
        OPJ_CI_DEPLOY=0