-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
41 lines (36 loc) · 1.6 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
language: c
git:
depth: false
services:
- docker
before_install:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
cache:
directories:
- $HOME/.ccache
timeout: 1000
matrix:
fast_finish: true
jobs:
include:
- stage: build
script:
- set -e
- BUILD_TYPE=Release
- |
if [[ $TRAVIS_BRANCH =~ ^debug- ]]; then
echo "Setting build type to Debug"
BUILD_TYPE=Debug
fi
- cp -r $HOME/.ccache .ccache #copy cache into build context
- docker build --build-arg registry=mixbytes --build-arg build_type=$BUILD_TYPE -t tmp-builder -f Docker/Dockerfile --target builder .
- docker run --rm -v $HOME/.ccache:/out tmp-builder /bin/bash -c "cp -r /haya/.ccache/* /out" #save updated cache
- docker build --build-arg registry=mixbytes --build-arg build_type=$BUILD_TYPE -t mixbytes/haya:$TRAVIS_BRANCH -f Docker/Dockerfile . #build main image
- if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ $BUILD_TYPE != "Debug" ]; then docker run tmp-builder /bin/bash -c 'cd /tmp/build && ctest -R "simulator|unit_test"'; fi
- if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ $BUILD_TYPE != "Debug" ]; then docker run tmp-builder /bin/bash -c 'cd /tmp/build && ctest -R "simulator|unit_test|nodeos_sanity|nodeos_run" -E "mongo"'; fi
- docker push mixbytes/haya:$TRAVIS_BRANCH #push main image to registry
- |
if [ $TRAVIS_BRANCH == "master" ]; then
docker tag mixbytes/haya:master mixbytes/haya:latest
docker push mixbytes/haya:latest
fi