forked from stefanprodan/mgob
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
48 lines (41 loc) · 1.25 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
sudo: required
language: go
go:
- 1.8.x
services:
- docker
- mongodb
before_install:
- docker run -dp 9000:9000 -e "MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE" -e "MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" minio/minio server /export
- sudo curl -s -o /usr/bin/mc https://dl.minio.io/client/mc/release/linux-amd64/mc
- sudo chmod u+x /usr/bin/mc
- docker run -dp 20022:22 atmoz/sftp:alpine test:test:::backup
before_script:
- sleep 10
- >-
mongo test --eval 'db.test.insert({item: "item", val: "test" });'
- sudo mc config host add local http://127.0.0.1:9000 AKIAIOSFODNN7EXAMPLE wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY S3v4
- sudo mc mb local/backup
script:
- make travis
- sleep 60
- docker logs mgob
- curl http://localhost:8090/version
- echo 'SFTP integration test'
- docker logs mgob 2>&1 | grep 'SFTP upload finished'
- echo 'S3 integration test'
- docker logs mgob 2>&1 | grep 'S3 upload finished'
- echo 'Local backup integration test'
- docker logs mgob 2>&1 | grep 'Backup finished'
after_success:
- if [ -z "$DOCKER_USER" ]; then
echo "PR build, skipping Docker Hub push";
else
make publish;
fi
deploy:
provider: script
script: make release
on:
tags: true
branch: master