-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy path.travis.yml
41 lines (36 loc) · 1.32 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
---
sudo: required
env:
- vault='0.10.3'
- vault='0.9.6'
VAULT_API_FAMILY='0_9'
- vault='0.6.0'
VAULT_API_FAMILY='0_6'
# whitelist
#branches:
# only:
# - master
# - develop
services:
- docker
before_install:
- "export HOME_DIR=$PWD"
- "git clone https://github.com/sstephenson/bats.git"
- "mkdir -p bin && cd bats && ./install.sh ../bin"
- "sudo docker pull voronenko/vault:$vault"
- "export ROOT_TOKEN=abfd0e04-7922-6850-e1bd-f02c325f1e2c"
- "docker run -d -p 8200:8200 --hostname vault --name vault voronenko/vault:${vault}"
- "echo ROOT_TOKEN - $ROOT_TOKEN"
- "export VAULT_ADDR=http://$(docker inspect -f '{{ .NetworkSettings.IPAddress }}' vault):8200"
- "echo VAULT_ADDR - $VAULT_ADDR"
- "wget -O $HOME_DIR/vault_${vault}_linux_amd64.zip https://releases.hashicorp.com/vault/${vault}/vault_${vault}_linux_amd64.zip"
- "unzip -d $HOME_DIR/tests $HOME_DIR/vault_${vault}_linux_amd64.zip && rm $HOME_DIR/vault_${vault}_linux_amd64.zip && chmod 755 $HOME_DIR/tests/vault"
script:
# execute tests
- "$HOME_DIR/tests/vault --version"
- "export PATH=$HOME_DIR:$HOME_DIR/tests:$PWD/bin/bin:$PATH"
- '$HOME_DIR/bin/bin/bats $HOME_DIR/tests/vault${VAULT_API_FAMILY}.bats'
- '$HOME_DIR/bin/bin/bats $HOME_DIR/tests/print_test.sh'
# Clean up
- sudo docker stop "vault"
- sudo docker rm "vault"