WIP automatic deployment

This commit is contained in:
Antonin Descampe 2016-05-15 13:15:01 +02:00
parent a66c391519
commit 7269c8f7a6
4 changed files with 32 additions and 20 deletions

View File

@ -4,10 +4,10 @@ matrix:
include:
- os: osx
compiler: clang
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release OPJ_CI_DEPLOY=1
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release OPJ_CI_INCLUDE_IF_DEPLOY=1
- os: linux
compiler: gcc
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release OPJ_CI_DEPLOY=1
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release OPJ_CI_INCLUDE_IF_DEPLOY=1
- os: linux
compiler: gcc
env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release
@ -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 openjpeg*.zip)
- echo "deploying $OPJ_RELEASE_PKG_FILE to GitHub releases"
deploy:

View File

@ -8,10 +8,10 @@ environment:
matrix:
- OPJ_CI_ARCH: x86
OPJ_CI_VSCOMNTOOLS: $(VS140COMNTOOLS)
OPJ_CI_DEPLOY: 1
OPJ_CI_INCLUDE_IF_DEPLOY: 1
- OPJ_CI_ARCH: x64
OPJ_CI_VSCOMNTOOLS: $(VS140COMNTOOLS)
OPJ_CI_DEPLOY: 1
OPJ_CI_INCLUDE_IF_DEPLOY: 1
- OPJ_CI_ARCH: x86
OPJ_CI_VSCOMNTOOLS: $(VS100COMNTOOLS)
install:

View File

@ -123,6 +123,12 @@ 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
@ -147,5 +153,9 @@ 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}" )

View File

@ -176,6 +176,14 @@ 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}
@ -183,12 +191,21 @@ 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"
fi
# let's parse configure/build/tests for failure
echo "
@ -272,19 +289,4 @@ New/unknown test failure found!!!
fi
fi
echo "OPJ_CI_DEPLOY: ${OPJ_CI_DEPLOY:-}"
echo "TRAVIS_TAG: ${TRAVIS_TAG:-}"
echo "APPVEYOR_REPO_TAG: ${APPVEYOR_REPO_TAG:-}"
echo "APPVEYOR_REPO_TAG_NAME: ${APPVEYOR_REPO_TAG_NAME:-}"
if [ "${OPJ_CI_DEPLOY:-}" == "1" ]; then
cpack --config ${OPJ_SOURCE_DIR}/cmake/OpenJPEGCPack.cmake -V -G ZIP -P "OpenJPEG-${TRAVIS_TAG:-}-${OPJ_BUILDNAME_TEST}.zip"
# if [ "${TRAVIS_TAG:-}" != "" ]; then
# cpack --config ${OPJ_SOURCE_DIR}/cmake/OpenJPEGCPack.cmake -V -G ZIP -P "OpenJPEG-${TRAVIS_TAG}-${OPJ_BUILDNAME_TEST}.zip"
# fi
# if [ "${APPVEYOR_REPO_TAG:-}" == "true" ]; then
# cpack -G ZIP -P "OpenJPEG-${APPVEYOR_REPO_TAG_NAME}-${OPJ_BUILDNAME_TEST}.zip"
# appveyor PushArtifact "OpenJPEG-${APPVEYOR_REPO_TAG_NAME}-${OPJ_BUILDNAME_TEST}.zip"
# fi
fi
exit ${OPJ_CI_RESULT}