This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
.travis.yml
54 lines (46 loc) · 2.29 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
language: java
script: "mvn clean verify"
services:
- docker
env:
global:
- CACHE_DIR=$HOME/docker
- APIM_DOCKER_IMAGE=docker-registry.demo.axway.com/swagger-promote/api-mgr-with-policies:7.6.2-SP4
- CASSANDRA_DOCKER_IMAGE=cassandra:2.2.12
- CACHE_FILE_APIM=$CACHE_DIR/api-manager_7_6_2_SP4.cache.tar.gz
- CACHE_FILE_CASSANDRA=$CACHE_DIR/cassandra_2_2_12.cache.tar.gz
- counter=0
cache:
directories:
- $CACHE_DIR
- '$HOME/.m2/repository'
before_install:
# Avoid installation if unit-tests fail anyway
- mvn clean test
- if [ ! -f /etc/docker/daemon.json ]; then sudo cp -v .github/daemon-default.json /etc/docker/daemon.json; fi
- if [ ! -f $CACHE_FILE_APIM ]; then sudo cat /etc/default/docker; fi
- if [ ! -f $CACHE_FILE_APIM ]; then echo \"Restarting Docker-Daemon\"; sudo service docker restart; sudo systemctl status docker.service; sudo journalctl -xe; fi
#- sudo apt-get update
#- sudo apt-get install curl
# All files in this folder will be cached for the next build
- mkdir -p $CACHE_DIR
# Login to the Docker-Registry
- if [ ! -f $CACHE_FILE_APIM ]; then docker login --username $AXWAY_DOCKER_REG_USER --password $AXWAY_DOCKER_REG_PASS docker-registry.demo.axway.com; fi
# Downloading the APIM-Docker-Image takes too long (Timeout 10 minutes) - Externalized to make use of travis_wait
# In this script, we are either using the cached version or download a new Docker-Image
- travis_wait build/pull_apim_docker_image.sh $CACHE_FILE_APIM
# Now it's time to safe the downloaded API-Management Docker-Image into the cache folder
- if [ ! -f $CACHE_FILE_APIM ]; then docker save $APIM_DOCKER_IMAGE | gzip > $CACHE_FILE_APIM; fi
# Pull Cassandra Image or use the cache
- travis_wait build/pull_cassandra_docker_image.sh
# Safe Cassandra image inc cache file
- if [ ! -f $CACHE_FILE_CASSANDRA ]; then docker save $CASSANDRA_DOCKER_IMAGE | gzip > $CACHE_FILE_CASSANDRA; fi
install:
# Start Cassandra and wait that port 9042 is reachable
- docker-compose run --rm start_cassandra
# Start the API-Gateway + API-Manager
- docker-compose run --rm start_apimgmt
# Give API-Manager a moment to start
- docker-compose logs --tail 30 apimgmt
after_failure:
- docker-compose logs --tail 1000 apimgmt