forked from angoca/db2-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
36 lines (27 loc) · 1.64 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
env:
- ENV=expc
- ENV=ese
sudo: required
services:
- docker
before_install:
# Builds Express-C image
- bash -c "if [ '$ENV' = 'expc' ]; then docker build -t angoca/db2-install:expc install/expc/; fi"
- bash -c "if [ '$ENV' = 'expc' ]; then docker build -t angoca/db2-instance:expc instance/expc/; fi"
- bash -c "if [ '$ENV' = 'expc' ]; then docker build -t angoca/db2inst1:expc db2inst1/expc/; fi"
# Builds Enterprise Server Edition image
- bash -c "if [ '$ENV' = 'ese' ]; then docker build -t angoca/db2-install:ese install/10.5/server_t/; fi"
- bash -c "if [ '$ENV' = 'ese' ]; then docker build -t angoca/db2-instance:ese instance/server_t/; fi"
- bash -c "if [ '$ENV' = 'ese' ]; then docker build -t angoca/db2inst1:ese db2inst1/server_t/; fi"
script:
- docker images
# Starts Express-C image
- bash -c "if [ '$ENV' = 'expc' ]; then echo \". /home/db2inst1/sqllib/db2profile;db2start\" | docker run -i --ipc="host" --privileged=true --name="db2inst1" -p 50000:50000 angoca/db2inst1:expc ; fi"
# Starts Enterprise Server Edition image
- bash -c "if [ '$ENV' = 'ese' ]; then echo \". /home/db2inst1/sqllib/db2profile;db2start\" | docker run -i --ipc="host" --privileged=true --name="db2inst1" -p 50000:50000 angoca/db2inst1:ese ; fi"
- docker ps -a
# Starts the instance and creates a database.
- docker start $(docker ps -a -q)
- docker exec $(docker ps -a -q) su -c ". ~db2inst1/sqllib/db2profile ; db2start" db2inst1
- docker exec $(docker ps -a -q) su -c ". ~db2inst1/sqllib/db2profile ; db2 create db test" db2inst1
- docker exec $(docker ps -a -q) su -c ". ~db2inst1/sqllib/db2profile ; db2 connect to test" db2inst1