-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
82 lines (82 loc) · 3.68 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
dist: trusty
group: deprecated-2017Q4
language: java
sudo: true
env:
- headless=true
jdk:
- openjdk8
services:
- postgresql
- docker
addons:
chrome: stable
postgresql: "9.6"
apt:
packages:
- postgresql-server-dev-9.6
before_install:
- gradle wrapper
- echo "hello world"
- echo "$TRAVIS_BRANCH"
- printenv
- which psql
- curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
- chmod +x ./kubectl
- sudo mv ./kubectl /usr/local/bin/kubectl
- gcloud config set project 'pgrepl-191221'
- mkdir -p /home/travis/.kube/
- cp -v ./kube/config /home/travis/.kube/config
- kubectl config set clusters.gke_pgrepl-191221_us-central1-a_pgrepl-cluster.certificate-authority-data "$KUBE_CLUSTER_CERTIFICATE"
- kubectl config set users.gke_pgrepl-191221_us-central1-a_pgrepl-cluster.client-certificate-data "$KUBE_CLIENT_CERTIFICATE"
- kubectl config set users.gke_pgrepl-191221_us-central1-a_pgrepl-cluster.client-key-data "$KUBE_CLIENT_KEY"
- kubectl proxy &
- sudo apt-get install postgresql-server-dev-9.6
- git clone https://github.com/eulerto/wal2json.git
- cd wal2json && USE_PGXS=1 make && sudo USE_PGXS=1 make install && cd ..
- ls -l /etc/postgresql/9.6/main/postgresql.conf
- echo "max_wal_senders = 4" | sudo tee -a /etc/postgresql/9.*/main/postgresql.conf
- echo "wal_keep_segments = 4" | sudo tee -a /etc/postgresql/9.*/main/postgresql.conf
- echo "wal_level = logical" | sudo tee -a /etc/postgresql/9.*/main/postgresql.conf
- echo "max_replication_slots = 4" | sudo tee -a /etc/postgresql/9.*/main/postgresql.conf
- echo "local replication postgres peer" | sudo tee -a /etc/postgresql/9.6/main/pg_hba.conf
- echo "host replication postgres 127.0.0.1/32 md5" | sudo tee -a /etc/postgresql/9.6/main/pg_hba.conf
- echo "host replication postgres ::1/128 md5" | sudo tee -a /etc/postgresql/9.6/main/pg_hba.conf
- sudo service postgresql restart
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
install:
- pwd
- ls -la
- wget -N http://chromedriver.storage.googleapis.com/2.33/chromedriver_linux64.zip -P ~/
- unzip ~/chromedriver_linux64.zip -d ~/
- rm ~/chromedriver_linux64.zip
- sudo mv -f ~/chromedriver /usr/local/share/
- sudo chmod +x /usr/local/share/chromedriver
- sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
before_script:
- sudo -u postgres psql -U postgres -d postgres -c "alter user postgres with password 'postgres';"
script:
- which chromedriver
- ./gradlew build fatJar
after_success:
- if [ "$TRAVIS_BRANCH" == "master" ]; then
docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD";
docker build -t bgard6977/pgrepl-db:latest -t bgard6977/pgrepl-db:0.1.$TRAVIS_BUILD_NUMBER -f db.Dockerfile .;
docker build -t bgard6977/pgrepl-app:latest -t bgard6977/pgrepl-app:0.1.$TRAVIS_BUILD_NUMBER -f app.Dockerfile .;
docker build -t bgard6977/pgrepl-kafka:latest -t bgard6977/pgrepl-kafka:0.1.$TRAVIS_BUILD_NUMBER -f kafka.Dockerfile .;
docker push bgard6977/pgrepl-db:0.1.$TRAVIS_BUILD_NUMBER;
docker push bgard6977/pgrepl-app:0.1.$TRAVIS_BUILD_NUMBER;
docker push bgard6977/pgrepl-kafka:0.1.$TRAVIS_BUILD_NUMBER;
docker push bgard6977/pgrepl-db:latest;
docker push bgard6977/pgrepl-app:latest;
docker push bgard6977/pgrepl-kafka:latest;
kubectl apply -f app.yaml;
kubectl delete pod --all;
fi
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/