From d851d0e39a0c88bee1c45498eec79e8bbe8c468b Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sat, 23 Jul 2016 11:09:31 +0100 Subject: [PATCH] Package and deploy Travis targets to Bintray --- .travis.yml | 60 ++++++++++++++----- scripts/travis/loot-api.bintray.json | 15 +++++ scripts/travis/loot.bintray.json | 15 +++++ .../travis/metadata-validator.bintray.json | 15 +++++ 4 files changed, 90 insertions(+), 15 deletions(-) create mode 100644 scripts/travis/loot-api.bintray.json create mode 100644 scripts/travis/loot.bintray.json create mode 100644 scripts/travis/metadata-validator.bintray.json diff --git a/.travis.yml b/.travis.yml index a30fe59d..964e728a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,6 @@ sudo: false language: cpp compiler: gcc -# Need GCC 5 and Boost 1.54+, which aren't in the 12.04 repositories - install -# from PPAs. Also install the libssl-dev package, which is needed to build -# libgit2 with support for cloning from HTTPS URLs. addons: apt: sources: @@ -65,20 +62,53 @@ script: - ./tests - ./api-tests -before_deploy: - # Build the metadata validator - - make metadata-validator - - tar -pczf metadata-validator.tar.gz metadata-validator +after_success: + - cd $TRAVIS_BUILD_DIR + # Get the full repo history before trying to run the archiver. + - git fetch --unshallow + - node scripts/potomo.js + - node scripts/archive.js + # Need to replace the HEAD branch descriptor in the archive filenames + - for ARCHIVE in build/*.tar.xz; do mv $ARCHIVE $(echo $ARCHIVE | sed "s/HEAD/$TRAVIS_BRANCH/"); done + # Need to replace the Bintray config files' version placeholders. + - VERSION=$(ls build/loot_*.tar.xz | sed 's/build\/loot_//;s/.tar.xz//;') + - sed -i "s/REPLACE_THIS_VERSION/$VERSION/" scripts/travis/loot.bintray.json + - sed -i "s/REPLACE_THIS_VERSION/$VERSION/" scripts/travis/loot-api.bintray.json + - sed -i "s/REPLACE_THIS_VERSION/$VERSION/" scripts/travis/metadata-validator.bintray.json deploy: - provider: releases - api_key: - secure: YOgb6thQKlp9aG19Vo8mFSzDRKntCcmMD+A4SAxmg919j6ONoSkaeuVxnUz5V2UKWbCaGzUN/fSnYbp51yDxWTFXalvRMckl0GaP5U0543ilpZPs3QdmDYQD7xlDevWBnYlZyU0jbFwX1U+yfW9k3lxea/JSFDwIkFZXY2Dxqmw= - file: metadata-validator.tar.gz - skip_cleanup: true - on: - repo: loot/loot - tags: true + - provider: bintray + file: scripts/travis/loot.bintray.json + user: wrinklyninja + key: + secure: "YjcfW+VRF3NC3pDxhpn7mAZ/Qs26KPLOwQS3VaC/0F8/tdPqznqEFGiuWGvC7i7NjUyJXDBHEso5GsRG3jxhGt1KOkCptiIsMiubUeUE3xY83oVvzJ/MbK7AXGM5heR3nUYLijzqxSSCbFdVewTdymfpGSWUbf1K+EV0qXUdinA=" + skip_cleanup: true + on: + all_branches: true + - provider: bintray + file: scripts/travis/loot-api.bintray.json + user: wrinklyninja + key: + secure: "YjcfW+VRF3NC3pDxhpn7mAZ/Qs26KPLOwQS3VaC/0F8/tdPqznqEFGiuWGvC7i7NjUyJXDBHEso5GsRG3jxhGt1KOkCptiIsMiubUeUE3xY83oVvzJ/MbK7AXGM5heR3nUYLijzqxSSCbFdVewTdymfpGSWUbf1K+EV0qXUdinA=" + skip_cleanup: true + on: + all_branches: true + - provider: bintray + file: scripts/travis/metadata-validator.bintray.json + user: wrinklyninja + key: + secure: "YjcfW+VRF3NC3pDxhpn7mAZ/Qs26KPLOwQS3VaC/0F8/tdPqznqEFGiuWGvC7i7NjUyJXDBHEso5GsRG3jxhGt1KOkCptiIsMiubUeUE3xY83oVvzJ/MbK7AXGM5heR3nUYLijzqxSSCbFdVewTdymfpGSWUbf1K+EV0qXUdinA=" + skip_cleanup: true + on: + all_branches: true + - provider: releases + api_key: + secure: YOgb6thQKlp9aG19Vo8mFSzDRKntCcmMD+A4SAxmg919j6ONoSkaeuVxnUz5V2UKWbCaGzUN/fSnYbp51yDxWTFXalvRMckl0GaP5U0543ilpZPs3QdmDYQD7xlDevWBnYlZyU0jbFwX1U+yfW9k3lxea/JSFDwIkFZXY2Dxqmw= + file: metadata-validator.tar.xz + skip_cleanup: true + on: + repo: loot/loot + tags: true notifications: irc: diff --git a/scripts/travis/loot-api.bintray.json b/scripts/travis/loot-api.bintray.json new file mode 100644 index 00000000..355de630 --- /dev/null +++ b/scripts/travis/loot-api.bintray.json @@ -0,0 +1,15 @@ +{ + "package": { + "name": "LOOT_API", + "repo": "loot", + "subject": "wrinklyninja" + }, + "version": { + "name": "REPLACE_THIS_VERSION" + }, + "files": [{ + "includePattern": "build/(loot-api_.+\\.tar.xz)", + "uploadPattern": "$1" + }], + "publish": true +} diff --git a/scripts/travis/loot.bintray.json b/scripts/travis/loot.bintray.json new file mode 100644 index 00000000..a3f5bb43 --- /dev/null +++ b/scripts/travis/loot.bintray.json @@ -0,0 +1,15 @@ +{ + "package": { + "name": "LOOT", + "repo": "loot", + "subject": "wrinklyninja" + }, + "version": { + "name": "REPLACE_THIS_VERSION" + }, + "files": [{ + "includePattern": "build/(loot_.+\\.tar.xz)", + "uploadPattern": "$1" + }], + "publish": true +} diff --git a/scripts/travis/metadata-validator.bintray.json b/scripts/travis/metadata-validator.bintray.json new file mode 100644 index 00000000..c2f931b5 --- /dev/null +++ b/scripts/travis/metadata-validator.bintray.json @@ -0,0 +1,15 @@ +{ + "package": { + "name": "metadata-validator", + "repo": "loot", + "subject": "wrinklyninja" + }, + "version": { + "name": "REPLACE_THIS_VERSION" + }, + "files": [{ + "includePattern": "build/(metadata-validator_.+\\.tar.xz)", + "uploadPattern": "$1" + }], + "publish": true +}