File tree Expand file tree Collapse file tree 5 files changed +95
-3
lines changed Expand file tree Collapse file tree 5 files changed +95
-3
lines changed Original file line number Diff line number Diff line change 1
1
* .iml
2
+ .vagrant
2
3
.DS_Store
3
4
.project
4
5
.classpath
8
9
nbproject /
9
10
target /
10
11
gh-pages /
11
- atlassian-ide-plugin.xml
12
+ atlassian-ide-plugin.xml
Original file line number Diff line number Diff line change
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+
4
+ # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5
+ VAGRANTFILE_API_VERSION = "2"
6
+
7
+ Vagrant . configure ( VAGRANTFILE_API_VERSION ) do |config |
8
+
9
+ config . vm . box = "ubuntu-trusty-14.04-cloudimg"
10
+ config . vm . box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
11
+
12
+ config . vm . hostname = "sprocwrapper"
13
+
14
+ config . vm . provider "virtualbox" do |vb |
15
+ vb . customize [ "modifyvm" , :id , "--memory" , "1024" ]
16
+ end
17
+
18
+ config . vm . provision "shell" , path : "vagrant/setup.sh"
19
+
20
+ end
Original file line number Diff line number Diff line change 51
51
<project .reporting.outputEncoding>UTF-8</project .reporting.outputEncoding>
52
52
<spring .version>3.2.3.RELEASE</spring .version>
53
53
<postgresql .version>9.2-1003-jdbc4</postgresql .version>
54
+
54
55
</properties >
55
56
56
57
<build >
104
105
<groupId >junit</groupId >
105
106
<artifactId >junit</artifactId >
106
107
<scope >test</scope >
107
- <version >4.10 </version >
108
+ <version >4.12 </version >
108
109
</dependency >
109
110
<dependency >
110
111
<groupId >org.springframework</groupId >
265
266
<sqlCommand >
266
267
CREATE DATABASE ${test.db.name1} TEMPLATE template1;
267
268
CREATE DATABASE ${test.db.name2} TEMPLATE template1;
269
+ CREATE ROLE zalando_api_owner;
270
+ CREATE ROLE zalando_api_executor;
271
+ CREATE ROLE zalando_api_usage;
268
272
</sqlCommand >
269
273
<onError >continue</onError >
270
274
</configuration >
281
285
<driver >org.postgresql.Driver</driver >
282
286
<url >jdbc:postgresql://${test.db.host} :${test.db.port} /${test.db.name1} </url >
283
287
<sqlCommand >
288
+ CREATE EXTENSION hstore;
284
289
DROP SCHEMA IF EXISTS ztest_schema1 CASCADE;
285
290
DROP SCHEMA IF EXISTS ztest_schema2 CASCADE;
286
291
</sqlCommand >
307
312
</fileset >
308
313
</configuration >
309
314
</execution >
310
-
315
+
311
316
<!-- execution against database 2 -->
312
317
<execution >
313
318
<id >drop-schemas-database2</id >
319
324
<driver >org.postgresql.Driver</driver >
320
325
<url >jdbc:postgresql://${test.db.host} :${test.db.port} /${test.db.name2} </url >
321
326
<sqlCommand >
327
+ CREATE EXTENSION hstore;
322
328
DROP SCHEMA IF EXISTS ztest_schema1 CASCADE;
323
329
</sqlCommand >
324
330
<onError >continue</onError >
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if nc -w 5 -z localhost 5432; then
4
+ echo ' There is already some process listening on port 5432.'
5
+ echo ' Please shutdown any existing PostgreSQL instance and re-run this script.'
6
+ exit 1
7
+ fi
8
+
9
+ export PGHOST=localhost
10
+ export PGUSER=postgres
11
+ export PGPASSWORD=postgres
12
+ export PGDATABASE=local_zmon_db
13
+
14
+ container=$( docker ps | grep postgres:9.3.5)
15
+ if [ -z " $container " ]; then
16
+ docker rm postgres
17
+ echo ' Starting PostgreSQL instance..'
18
+ docker run --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres:9.3.5
19
+ fi
20
+
21
+ until nc -w 5 -z localhost 5432; do
22
+ echo ' Waiting for Postgres port..'
23
+ sleep 3
24
+ done
25
+
26
+ sleep 5
27
+
28
+ echo ' Running tests..'
29
+ mvn clean verify -Pintegration-test
30
+
31
+ echo ' Stopping PostgreSQL instance..'
32
+ docker stop postgres
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ apt-get remove --purge -y puppet chef
4
+ apt-get autoremove -y
5
+
6
+ if [ ! -x " /usr/bin/docker" ]; then
7
+
8
+ # add Docker repo
9
+ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
10
+ echo ' deb https://get.docker.io/ubuntu docker main' > /etc/apt/sources.list.d/docker.list
11
+
12
+ set +e
13
+ until apt-get update; do
14
+ # TODO: this should not even be necessary
15
+ echo ' apt-get update failed, retrying..'
16
+ rm -fr /var/lib/apt/lists/partial
17
+ sleep 1
18
+ done
19
+ set -e
20
+
21
+ # Docker
22
+ apt-get install -y --no-install-recommends -o Dpkg::Options::=" --force-confold" apparmor lxc-docker
23
+ fi
24
+
25
+ adduser vagrant docker
26
+
27
+ apt-get install -y postgresql-client maven openjdk-7-jdk
28
+
29
+ echo ' localhost:5432:*:postgres:postgres' > /root/.pgpass
30
+ chmod 600 /root/.pgpass
31
+ cp /root/.pgpass /home/vagrant/.pgpass
32
+
33
+ docker pull postgres:9.3.5
You can’t perform that action at this time.
0 commit comments