-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathinstall_demo_project.sh
More file actions
executable file
·42 lines (37 loc) · 1.56 KB
/
install_demo_project.sh
File metadata and controls
executable file
·42 lines (37 loc) · 1.56 KB
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
#!/bin/bash
set -evx
cd $(dirname $(readlink -f $0))
PROJECT_FILE="utPLSQL-demo-project"
git clone -b develop --single-branch https://github.com/utPLSQL/utPLSQL-demo-project.git
cat > demo_project.sh.tmp <<EOF
sqlplus -S -L sys/oracle@//localhost:1521/${SERVICE_NAME} AS SYSDBA <<SQL
PROMPT Creating Database User ${DB_USER}
PROMPT create user ${DB_USER} identified by ${DB_PASS} quota unlimited on USERS default tablespace USERS;
PROMPT grant create session, create procedure, create type, create table, create sequence, create view to ${DB_USER};
PROMPT grant connect to ${DB_USER};
PROMPT grant select any dictionary to ${DB_USER};
create user ${DB_USER} identified by ${DB_PASS} quota unlimited on USERS default tablespace USERS;
grant create session, create procedure, create type, create table, create sequence, create view to ${DB_USER};
grant connect to ${DB_USER};
grant select any dictionary to ${DB_USER};
exit
SQL
cd /${PROJECT_FILE}
sqlplus -S -L ${DB_USER}/${DB_PASS}@//localhost:1521/${SERVICE_NAME} <<SQL
whenever sqlerror exit failure rollback
whenever oserror exit failure rollback
PROMPT Installing sources of demo project into schema ${DB_USER}
@source/install.sql
exit
SQL
sqlplus -S -L ${DB_USER}/${DB_PASS}@//localhost:1521/${SERVICE_NAME} <<SQL
whenever sqlerror exit failure rollback
whenever oserror exit failure rollback
PROMPT Installing tests for demo project into schema ${DB_USER}
@test/install.sql
exit
SQL
EOF
docker cp ./${PROJECT_FILE} oracle:/${PROJECT_FILE}
docker cp ./demo_project.sh.tmp oracle:/demo_project.sh
docker exec oracle bash /demo_project.sh