-
Notifications
You must be signed in to change notification settings - Fork 25
/
.travis.yml
46 lines (46 loc) · 2.19 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
sudo: required
dist: trusty
language: node_js
node_js:
- "6"
cache:
apt: true
yarn: true
addons:
apt:
packages:
- wget
env:
global:
- BIN="bin"
- VICUI_H5_UI_PATH="h5c/vic"
- VICUI_H5_SERVICE_PATH="h5c/vic-service"
- GCP_DOWNLOAD_PATH="https://storage.googleapis.com/vic-engine-builds/"
- SDK_PACKAGE_ARCHIVE="vic-ui-sdk.tar.gz"
- ENV_VSPHERE_SDK_HOME="/tmp/sdk/vc_sdk_min"
- ENV_HTML_SDK_HOME="/tmp/sdk/html-client-sdk"
- BUILD_NUMBER="$TRAVIS_BUILD_NUMBER"
before_install:
- sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg
- echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
- sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- sudo apt-get update -qq
- sudo apt-get install -y openjdk-7-jdk maven ant ant-optional google-chrome-stable yarn=0.24.6-1
- export PATH=/usr/share/yarn/bin:$PATH
- export TAG=$(git describe --tags --abbrev=0)
- export TAG_NUM=$(git describe --tags --abbrev=0 | cut -c 2-)
branches:
only:
- new-master
script:
- sed -e "s/0.0.1/$(printf %s ${TAG_NUM}.${BUILD_NUMBER})/" -e "s/\-rc[[:digit:]]//g" ./$VICUI_H5_UI_PATH/plugin-package.xml > ./$VICUI_H5_UI_PATH/new_plugin-package.xml
- sed "s/UI_VERSION_PLACEHOLDER/$(printf %s ${TAG}.${BUILD_NUMBER})/" ./$VICUI_H5_SERVICE_PATH/src/main/resources/configs.properties > ./$VICUI_H5_SERVICE_PATH/src/main/resources/new_configs.properties
- mv ./$VICUI_H5_UI_PATH/new_plugin-package.xml ./$VICUI_H5_UI_PATH/plugin-package.xml
- mv ./$VICUI_H5_SERVICE_PATH/src/main/resources/new_configs.properties ./$VICUI_H5_SERVICE_PATH/src/main/resources/configs.properties
- wget -nv $GCP_DOWNLOAD_PATH$SDK_PACKAGE_ARCHIVE -O /tmp/$SDK_PACKAGE_ARCHIVE
- tar --warning=no-unknown-keyword -xzf /tmp/$SDK_PACKAGE_ARCHIVE -C /tmp/
- mkdir -p $BIN/ui
- cp -rf scripts/* $BIN/ui