-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
.travis.yml
59 lines (52 loc) · 1.93 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
sudo: required
language: go
go:
- 1.13.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
- ssh-keygen -b 4096 -t rsa -N "" -f /tmp/ssh_host_rsa_key -q
- >-
docker run -dp 20023:22
-v /tmp/ssh_host_rsa_key.pub:/home/test/.ssh/keys/ssh_host_rsa_key.pub:ro
-v /tmp/ssh_host_rsa_key:/etc/ssh/ssh_host_rsa_key
--name test-sftp atmoz/sftp:alpine test::1001::backup
before_script:
- sleep 10
- >-
mongo test --eval 'db.test.insert({item: "item", val: "test" });'
- mongodump --archive=/backups/backup.gz --gzip --uri "mongodb://user:password@localhost:27017" --db test --authenticationDatabase admin
- sudo mc config host add local http://127.0.0.1:9000 AKIAIOSFODNN7EXAMPLE wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY --api S3v4
- sudo mc mb local/backup
script:
- make travis
- sleep 90
- 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'
- echo 'SFTP private key authorization integration test'
- docker logs mgob 2>&1 | grep "Backup finished .* sftp-authorization-test"
- echo 'Restore integration test'
- docker logs mgob 2>&1 | grep "restore procedure finished successfully, shutting down"
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: main