-
Notifications
You must be signed in to change notification settings - Fork 19
/
.travis.yml
52 lines (52 loc) · 2.78 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
sudo: false
language: java
os:
- linux
env:
global:
- PROJECT_NAME=vmbix
- DEPLOY_ROOT=$TRAVIS_BUILD_DIR/deploy-root
- MAJOR_VERSION=2.9
- MINOR_VERSION=1
- VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.$TRAVIS_BUILD_NUMBER
- secure: 03i1ibazRKbDhLJlEzhy203E/UgO8VJlgSDIWWCng4NafcLLNzQ5XjSzEW3td+wErsCgToyF1P1ScyTXfsmxJz0hY2vzltqlAgmrTbfUGBLW8ToSO+nZ7NciHAwowz0fqEcvDEFASMGemIAlh+7yyRycfJ30IZoKKQZD0Xdp1aNDWT8Ogb0/ZtBSoeuCE/r35jvGnO/QBrMx9Usu7/2mFvwAczcC6XTl3GJ0fBjtcTBZFY+P1mbCQRtvcAFr09R6axERdV9tkOq/7jBHbhfT7/+vNUh8zWuD5B6jfxzcHPS8oITWl4Dqa0CTVxkLDqAyEHdU1th6ZXXe1ZHsSe8cnIjY0duc1U9NyQVnZwnBnQRcJ6hX7CBHqqct97WG8qFut+z5+iF/cWdb6yvolgWLdV5GF6Brhr+75eRLQOXxEhqVbgHl7sLp+KICEcBVeRGztLzYoKU4WOpEDNG8aPinWgBkxRDcWwOq7AhXvqA2taRRJ/HNg351Lb+MpF/b3jMERrLnHhMx1fDiZS5ONn/CxizhGatvCvpxrWCewgqoYNQzYY1XrTSCM74a7JyCaOQ/FX0q+767m0TKCvf/OfeBfXeP17ea/IYyKNYkqlh+M/a3eEiZFBUynJaXMee2wdGyf9G2VTxhw7vj/duVdbeJSe5piLEzi+0MiMawupLXPNc=
matrix:
- TARGET_PLATFORM=deb
- TARGET_PLATFORM=rpm
addons:
apt:
packages:
- rpm
sources:
- ubuntu-toolchain-r-test
install:
- export PROJECT_VERSION=${VERSION}
- mkdir -p ${DEPLOY_ROOT}/usr/local/sbin/
- mkdir -p ${DEPLOY_ROOT}/usr/local/vmbix/
- mkdir -p ${DEPLOY_ROOT}/etc
- mkdir -p ${DEPLOY_ROOT}/usr/share/vmbix/
- gem install json -v 1.8.6
- gem install fpm
- export TAR_FILE_NAME=${PROJECT_NAME}-${VERSION}.tar.gz
- if [ "$TARGET_PLATFORM" == "deb" ]; then export FILE_NAME="${PROJECT_NAME}_${VERSION}-1_amd64";
export JAVA_PACKAGE="default-jre-headless"; fi
- if [ "$TARGET_PLATFORM" == "rpm" ]; then export FILE_NAME="${PROJECT_NAME}-${VERSION}-1.x86_64";
export JAVA_PACKAGE="java-1.8.0-openjdk-devel"; fi
script:
- mvn package
- cp -dR ${TRAVIS_BUILD_DIR}/target/vmbix-${VERSION}-jar-with-dependencies.jar ${DEPLOY_ROOT}/usr/local/vmbix/vmbix.jar
- cp -dR ${TRAVIS_BUILD_DIR}/etc-${TARGET_PLATFORM}/* ${DEPLOY_ROOT}/etc/
- cp -dR ${TRAVIS_BUILD_DIR}/usr/ ${DEPLOY_ROOT}/
- cp -dR ${TRAVIS_BUILD_DIR}/zabbix ${DEPLOY_ROOT}/usr/share/vmbix/
- chmod +x ${DEPLOY_ROOT}/etc/init.d/vmbixd
- chmod +x ${DEPLOY_ROOT}/usr/local/sbin/vmbix
- chmod +x ${DEPLOY_ROOT}/usr/local/sbin/vmbixd
- cd ${DEPLOY_ROOT}/
- tar -zcf $TRAVIS_BUILD_DIR/$TAR_FILE_NAME .
- fpm -p $TRAVIS_BUILD_DIR/${FILE_NAME}.${TARGET_PLATFORM} -s dir -t ${TARGET_PLATFORM} --config-files etc
-n ${PROJECT_NAME} -v ${VERSION} --iteration 1 -C ${DEPLOY_ROOT} --description "${PROJECT_NAME}
${VERSION}" -d "${JAVA_PACKAGE}" usr etc
after_success:
- curl -T $TRAVIS_BUILD_DIR/${TAR_FILE_NAME} -udav3860:${BINTRAY_KEY} https://api.bintray.com/content/dav3860/generic/${PROJECT_NAME}/${MAJOR_VERSION}/${TAR_FILE_NAME}
- curl -T $TRAVIS_BUILD_DIR/${FILE_NAME}.${TARGET_PLATFORM} -udav3860:${BINTRAY_KEY}
https://api.bintray.com/content/dav3860/generic/${PROJECT_NAME}/${MAJOR_VERSION}/${FILE_NAME}.${TARGET_PLATFORM}