-
Notifications
You must be signed in to change notification settings - Fork 9
/
.travis.yml
72 lines (68 loc) · 3.22 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
language: minimal
env:
DOCKER_IMAGE=$(grep -v '#' < $TRAVIS_BUILD_DIR/docker/nanoprobe/docker-tag.txt | head -n1)
DOCKER_TAG=${DOCKER_IMAGE#assimilationproject/nanoprobe:}
stages:
- name: build
- name: package
- name: "test on different distributions"
script:
- cd /tmp
- wget --quiet "https://github.com/assimilation/assimilation-official/releases/download/v${DOCKER_TAG}/nanoprobe_${DOCKER_TAG}_amd64.deb"
- wget --quiet "https://github.com/assimilation/assimilation-official/releases/download/v${DOCKER_TAG}/sums"
- sudo dpkg -i nanoprobe_${DOCKER_TAG}_amd64.deb
- ls -al /usr/share/assimilation/copyright
- grep nanoprobe /tmp/sums > /tmp/sums.nanoprobe
- cd /usr/bin && sha256sum -c /tmp/sums.nanoprobe
jobs:
include:
- stage: test on different distributions
name: ubuntu 12.04
dist: precise
- stage: test on different distributions
name: ubuntu 14.04
dist: trusty
- stage: test on different distributions
name: ubuntu 16.04
dist: xenial
- stage: test on different distributions
name: ubuntu 18.04
dist: bionic
- stage: build
name: nanoprobe
dist: bionic
install:
- cd /tmp
- wget --quiet https://github.com/github/hub/releases/download/v2.14.2/hub-linux-amd64-2.14.2.tgz
- tar xvfz hub-linux-amd64-2.14.2.tgz
- cd hub-linux-amd64-2.14.2/
- sudo ./install
script:
- cd $TRAVIS_BUILD_DIR/docker
- ./dockit
- docker run -v /tmp/package:/workdir -it $DOCKER_IMAGE bash -c "cp /tmp/build/bin/nanoprobe /workdir"
- docker run -v /tmp/package:/workdir -it $DOCKER_IMAGE bash -c "cp /tmp/build/bin/sums /workdir"
- cd $TRAVIS_BUILD_DIR && ci/scripts/attach_asset.sh /tmp/package nanoprobe "v${DOCKER_TAG}"
- cd $TRAVIS_BUILD_DIR && ci/scripts/attach_asset.sh /tmp/package sums "v${DOCKER_TAG}"
- stage: package
name: debian
install:
- cd /tmp
- wget --quiet https://github.com/github/hub/releases/download/v2.14.2/hub-linux-amd64-2.14.2.tgz
- tar xvfz hub-linux-amd64-2.14.2.tgz
- cd hub-linux-amd64-2.14.2/
- sudo ./install
script:
- mkdir /tmp/package
- cd /tmp/package
- wget --quiet "https://github.com/assimilation/assimilation-official/releases/download/v${DOCKER_TAG}/nanoprobe"
- mkdir -p /tmp/package/usr/share/assimilation/discovery_agents
- mkdir -p /tmp/package/usr/share/crypto.d
- mkdir -p /tmp/package/usr/lib/ocf/resource.d/assimilation
- cp $TRAVIS_BUILD_DIR/ocf/neo4j /tmp/package/usr/lib/ocf/resource.d/assimilation/
- cp $TRAVIS_BUILD_DIR/legal/copyright /tmp/package/usr/share/assimilation/
- cp $TRAVIS_BUILD_DIR/ci/scripts/fix.sh /tmp/package
- rsync -a --exclude Windows $TRAVIS_BUILD_DIR/discovery_agents/ /tmp/package/usr/share/assimilation/discovery_agents/
- docker build --build-arg VERSION=$DOCKER_TAG -f $TRAVIS_BUILD_DIR/ci/Dockerfiles/ubuntu1804_fpm.dockerfile -t ubuntu_fpm /tmp/package/
- docker run -v /tmp/package:/output ubuntu_fpm bash -c "cp /workdir/*.deb /output"
- cd $TRAVIS_BUILD_DIR && ci/scripts/attach_asset.sh /tmp/package "nanoprobe_${DOCKER_TAG}_amd64.deb" "v${DOCKER_TAG}"