forked from Altinity/clickhouse-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
58 lines (58 loc) · 1.77 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
language: go
sudo: required
go:
- 1.13
env:
- CLICKHOUSE_VERSION=1.1.54390
- CLICKHOUSE_VERSION=19.4.4.33
- CLICKHOUSE_VERSION=19.15.3.6 GCS_TESTS=yes DEPLOY_ARTIFACTS=yes
services:
- docker
addons:
apt:
packages: rpm
install:
- gem install fpm
script:
# Building executable file
- make build || travis_terminate 1;
# Creating default config
- make config || travis_terminate 1;
# Running unit tests
- make test || travis_terminate 1;
# Decrypting credentials for Google Cloud Storage
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
openssl enc -base64 -aes-256-cbc -d -in test/integration/credentials.json.enc -out test/integration/credentials.json -k ${VAULT_PASSWORD} || travis_terminate 1;
fi
# Preparing to integration tests
- CLICKHOUSE_BACKUP_BIN="$(pwd)/clickhouse-backup/clickhouse-backup" docker-compose -f test/integration/docker-compose.yml up -d --force-recreate || travis_terminate 1;
# Running integration tests
- go test -tags=integration test/integration/integration_test.go || travis_terminate 1;
# Building docker image
- docker build -t alexakulov/clickhouse-backup:master .
after_success:
- tar -czvf clickhouse-backup.tar.gz clickhouse-backup
- CGO_ENABLED=0 make packages
deploy:
- provider: releases
api_key: "${GITHUB_TOKEN}"
file_glob: true
file:
- clickhouse-backup.tar.gz
- build/clickhouse-backup_*.deb
- build/clickhouse-backup-*.rpm
skip_cleanup: true
overwrite: true
on:
tags: true
condition: -n $DEPLOY_ARTIFACTS
- provider: script
script: bash docker_push.sh
on:
branch: master
condition: -n $DEPLOY_ARTIFACTS
- provider: script
script: bash docker_push.sh release
on:
tags: true
condition: -n $DEPLOY_ARTIFACTS