forked from blacklabelops-legacy/postgres
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
42 lines (39 loc) · 1.94 KB
/
circle.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
machine:
pre:
- curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0
services:
- docker
dependencies:
override:
- docker version
- docker info
- docker build -t blacklabelops/postgres .
test:
override:
#Test1
- docker run -d --name="postgres" blacklabelops/postgres
- sleep 20
- docker logs postgres
- runstate=$(docker inspect -f {{.State.Running}} postgres) && echo $runstate && if [ "$runstate" = "true" ]; then true ; else false ; fi
- docker stop postgres
#Test2
- docker run -d --name="postgres2" -e 'POSTGRES_USER=jira' -e 'POSTGRES_PASSWORD=jellyfish' -e 'POSTGRES_DB=jiradb' -e 'POSTGRES_ENCODING=UNICODE' -e 'POSTGRES_COLLATE=C' -e 'POSTGRES_COLLATE_TYPE=C' blacklabelops/postgres
- sleep 20
- docker logs postgres2
- runstate=$(docker inspect -f {{.State.Running}} postgres2) && echo $runstate && if [ "$runstate" = "true" ]; then true ; else false ; fi
#- docker exec postgres2 psql -l jiradb jira
- docker stop postgres2
#Test3
- docker run -d --name="postgres3" -e 'POSTGRES_USER=jira' -e 'POSTGRES_PASSWORD=jellyfish' -e 'POSTGRES_DB=jiradb' -e 'POSTGRES_DB_CREATE=CREATE DATABASE userdatabase' blacklabelops/postgres
- sleep 20
- docker logs postgres3
- runstate=$(docker inspect -f {{.State.Running}} postgres3) && echo $runstate && if [ "$runstate" = "true" ]; then true ; else false ; fi
#- docker exec postgres3 psql -l userdatabase jira
- docker stop postgres3
#Test4
- docker run -d --name="postgres4" -e 'POSTGRES_USER=jira' -e 'POSTGRES_PASSWORD=jellyfish' -e 'POSTGRES_DB=jiradb' -e 'POSTGRES_ENCODING=UNICODE' blacklabelops/postgres
- sleep 20
- docker logs postgres4
#- docker exec postgres4 psql -l jiradb jira
- runstate=$(docker inspect -f {{.State.Running}} postgres4) && echo $runstate && if [ "$runstate" = "true" ]; then true ; else false ; fi
- docker stop postgres4