WIP automatic deployment
authorAntonin Descampe <antonin@gmail.com>
Sun, 15 May 2016 11:38:32 +0000 (13:38 +0200)
committerAntonin Descampe <antonin@gmail.com>
Sun, 15 May 2016 11:38:32 +0000 (13:38 +0200)
.travis.yml
appveyor.yml
tools/ctest_scripts/travis-ci.cmake
tools/travis-ci/run.sh

index c55c706d21fce22c4a7f0305315449af5091681f..7f5748c8bdb5bac86f40ba6e430b18abf5cfa658 100644 (file)
@@ -80,5 +80,5 @@ deploy:
   on:
     repo: uclouvain/openjpeg
     tags: true
-    condition: "$OPJ_CI_DEPLOY = 1"
+    condition: "$OPJ_CI_INCLUDE_IF_DEPLOY = 1"
 
index e0be65b20d2b734ef1c6955f120c1e7aa4491685..068deaea1b9fab2a9c1dda19d5a43d153c479b6b 100644 (file)
@@ -34,6 +34,5 @@ deploy:
   draft: true
   prerelease: false
   on:
-    branch: openjpeg-*
     appveyor_repo_tag: true        # deploy on tag push only
-    OPJ_CI_DEPLOY: 1
+    OPJ_CI_INCLUDE_IF_DEPLOY: 1
index 05a0e002a16686bdacc72b5fe1645541d2e35015..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 440945aa5a33fda6ea8da2eb7f59fa081b542509..7c325ce10ffd5da8da0dad66ca873fa8aeec89e3 100755 (executable)
@@ -176,14 +176,6 @@ set -x
 # travis-ci doesn't dump cmake version in system info, let's print it 
 cmake --version
 
-# Check condition to deploy
-#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
-else
-       OPJ_CI_DEPLOY=0
-fi
-
 export TRAVIS_OS_NAME=${TRAVIS_OS_NAME}
 export OPJ_SITE=${OPJ_SITE}
 export OPJ_BUILDNAME=${OPJ_BUILDNAME}
@@ -191,19 +183,23 @@ export OPJ_SOURCE_DIR=$(opjpath -m ${OPJ_SOURCE_DIR})
 export OPJ_BINARY_DIR=$(opjpath -m ${PWD}/build)
 export OPJ_BUILD_CONFIGURATION=${OPJ_CI_BUILD_CONFIGURATION}
 export OPJ_DO_SUBMIT=${OPJ_DO_SUBMIT}
-export OPJ_CI_DEPLOY=${OPJ_CI_DEPLOY}
 
 ctest -S ${OPJ_SOURCE_DIR}/tools/ctest_scripts/travis-ci.cmake -V || true
 # ctest will exit with various error codes depending on version.
 # ignore ctest exit code & parse this ourselves
 set +x
 
-# Push Artifact in APPVEYOR case
-if [ "${OPJ_CI_DEPLOY:-}" == "1" ] && [ "${APPVEYOR_REPO_TAG:-}" == "true" ]; then
-       appveyor PushArtifact "openjpeg-*.zip"
-fi
-if [ "${OPJ_CI_DEPLOY:-}" == "1" ]; then
-       echo "ready to deploy $(ls openjpeg*.zip) to GitHub releases"
+# 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
+       cmake --build ${OPJ_BINARY_DIR} --target package -D CPACK_GENERATOR:STRING="ZIP"
+       echo "ready to deploy $(ls ${OPJ_BINARY_DIR}/openjpeg*.zip) to GitHub releases"
+       if [ "${APPVEYOR_REPO_TAG:-}" == "true" ]; then
+               appveyor PushArtifact "${OPJ_BINARY_DIR}/openjpeg-*.zip"
+       fi
+else
+       OPJ_CI_DEPLOY=0
 fi
 
 # let's parse configure/build/tests for failure