Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1a71932

Browse files
committed
Added .gitignore file for project.
Added any_data library download scripts. Added new assertions that make use of any_data lib. Added install_libraries.sh to the travis install. Added travis env variables for DB connectivity. Added lib directory to .gitignore - We do not store copies of libraries in project repository.
1 parent 83624eb commit 1a71932

14 files changed

Lines changed: 108 additions & 23 deletions

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### JetBrains template
3+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
4+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
5+
# User-specific stuff:
6+
.idea/
7+
8+
lib/

.travis.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ env:
1616
- DATABASE_NAME=XE
1717
- ORA_SDTZ='Europe/London' #Needed as a client parameter
1818
- TZ='Europe/London' #Needed as a DB Server parameter
19+
- UT3_USER=ut3
20+
- UT3_PASSWORD=ut3
21+
- UT3_TABLESPACE=users
1922

2023
addons:
2124
apt:
@@ -42,9 +45,11 @@ install:
4245
- bash .travis/oracle/install.sh
4346

4447
script:
48+
- bash .travis/create_utplsql_user.sh
49+
- bash .travis/install_libraries.sh
4550
- bash .travis/install.sh
46-
- bash .travis/examples.sh
47-
- bash .travis/test.sh
51+
- bash .travis/run_examples.sh
52+
- bash .travis/run_test.sh
4853

4954
notifications:
5055
slack: utplsql:oiMuXO95TvKeAUENuDt4cPrB

.travis/any_data_download.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
lib_dir=$1
4+
version=$2
5+
6+
wget -O ${lib_dir}/v${version}.zip https://github.com/jgebal/any_data/archive/v${version}.zip
7+
unzip ${lib_dir}/v${version}.zip -d ${lib_dir}

.travis/any_data_install.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
lib_dir=$1
4+
version=$2
5+
6+
cd ${lib_dir}/any_data-${version}/sources
7+
sqlplus $UT3_USER/$UT3_PASSWORD @install.sql
8+
cd ../../..
9+

.travis/create_utplsql_user.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -ev
3+
4+
#create user
5+
"$ORACLE_HOME/bin/sqlplus" -L -S / AS SYSDBA <<SQL
6+
set echo off
7+
@@$(dirname "$(readlink -f "$0")")/create_utplsql_user.sql $UT3_USER $UT3_PASSWORD $UT3_TABLESPACE
8+
SQL

.travis/create_utplsql_user.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ set heading off
66
set verify off
77

88
define ut3_user = &1
9-
define ut3_pass = &2
9+
define ut3_password = &2
1010
define ut3_tablespace = &3
1111

12-
create user &ut3_user identified by &ut3_pass default tablespace &ut3_tablespace quota unlimited on &ut3_tablespace;
12+
create user &ut3_user identified by &ut3_password default tablespace &ut3_tablespace quota unlimited on &ut3_tablespace;
1313

1414
grant create session, create procedure, create type, create table to &ut3_user;
1515

.travis/examples.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

.travis/install.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
#!/bin/bash
22

33
set -ev
4-
echo "$(dirname "$(readlink -f "$0")")"
5-
#create user
6-
"$ORACLE_HOME/bin/sqlplus" -L -S / AS SYSDBA <<SQL
7-
set echo off
8-
@@$(dirname "$(readlink -f "$0")")/create_utplsql_user.sql ut3 ut3 users
9-
SQL
104

115
cd source
126
#install core of utplsql
13-
"$ORACLE_HOME/bin/sqlplus" ut3/ut3 @install.sql
7+
"$ORACLE_HOME/bin/sqlplus" $UT3_USER/$UT3_PASSWORD @install.sql

.travis/install_libraries.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
work_dir="$(dirname "$(readlink -f "$0")")"
4+
lib_dir=lib
5+
#Create directory if it's not already there
6+
[ -d lib ] || mkdir lib
7+
8+
# Install any_data into lib directory
9+
any_data_version=1.0.4
10+
11+
. ${work_dir}/any_data_download.sh ${lib_dir} ${any_data_version}
12+
. ${work_dir}/any_data_install.sh ${lib_dir} ${any_data_version}

.travis/run_examples.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
set -ev
4+
5+
cd examples
6+
"$ORACLE_HOME/bin/sqlplus" $UT3_USER/$UT3_PASSWORD @RunAllExamplesAsTests.sql

0 commit comments

Comments
 (0)