forked from microsoft/OMS-Agent-for-Linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
49 lines (43 loc) · 2.57 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
language: c
dist: trusty # Travis build machine is Ubuntu Trusty 14.04 x64
sudo: required # A sudo enabled, full VM is used for building instead of a docker container
git:
submodules: false
before_install:
- sudo apt-get update -qq
# Pre-reqs for building omsagent and omi
- sudo apt-get install -qq pkg-config make ruby bison g++ rpm librpm-dev libpam0g-dev libssl-dev libmysqlclient-dev libkrb5-dev
# Pre-reqs for building auoms
- sudo apt-get install cmake libboost-dev libboost-test-dev libaudit-dev libauparse-dev unzip
- sudo groupadd omiusers
- rvm use system # Use system ruby (v1.9.3p484) instead of ruby provided by rvm
- sed -i 's/--no-ri//' ~/.gemrc # ri data from installed gems is required for our build
# Travis-CI automatically clones the OMS-Agent-for-Linux repo since this is where this .travis.yml file is located
# We will ignore this clone and clone the superproject Build-OMS-Agent-for-Linux as follows
install:
- cd ../..
- git clone https://github.com/Microsoft/Build-OMS-Agent-for-Linux.git Microsoft/Build-OMS-Agent-for-Linux
- cd Microsoft/Build-OMS-Agent-for-Linux
# change url from ssh to https for submodules, travis-ci cannot download a submodule that isn’t on a public url
- sed -i 's/[email protected]:/https:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive dsc omi opsmgr-kits pal auoms scxcore-kits
- git clone https://github.com/Microsoft/OMS-Agent-for-Linux.git omsagent
- cd omsagent
# change url from ssh to https for submodules ruby and fluentd
- sed -i 's/[email protected]:/https:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive
before_script:
- cd ..
- git checkout master && git submodule foreach git checkout master
- cd omsagent
# PR validation during check-in will be setup in github in the settings section of our repo
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then git fetch origin refs/pull/$TRAVIS_PULL_REQUEST/head ; git checkout FETCH_HEAD; fi
- cd build
# pwd: /home/travis/build/Microsoft/Build-OMS-Agent-for-Linux/omsagent/build
# Since 'build' is a keyword for travis-CI, change Makefile to substitute 'omsagent/build' instead of 'build'
- sed -i 's/(subst \/build,,$(CURDIR))/(subst omsagent\/build,omsagent,$(CURDIR))/' Makefile
# Substitue 'build' in Makefile for auoms as well
- sed -i 's/(subst \/build,,$(CURDIR))/(subst auoms\/build,auoms,$(CURDIR))/' ../../auoms/build/Makefile
script:
- ./configure --enable-debug
- make && make unittest # System tests are not run because OMS-Agent-for-Linux-testconfig.git is a private repo