@@ -16,61 +16,77 @@ addons:
1616
1717env :
1818 global :
19- # Oracle 11g XE R2 docker variables
19+ # Docker variables:
20+ - DOCKHER_HUB_REPO="${DOCKER_USER}/oracledb"
2021 - ORACLE_VERSION=11g-r2-xe
2122 - CONNECTION_STR='127.0.0.1:1521/XE'
2223 - DOCKER_OPTIONS='--shm-size=1g'
23- # Docker database Env
24- - SQLCLI="$HOME/sqlcl/bin/sql"
25- - OJDBC_HOME="$HOME/sqlcl/lib"
26- - ORACLE_PWD="oracle"
27- - UT3_DOCKER_REPO="utplsqlv3/oracledb"
28- - DOCKHER_HUB_REPO="${DOCKER_BASE_TAG:-$UT3_DOCKER_REPO}"
29- # project variables
24+
25+ # SYS account password for DB - could be stored in Travis secrets
26+ - ORACLE_SYS_PASS="oracle"
27+ # Adding utPLSQL-cli to path - to be able to invoke "utplsql" from command line
28+ - PATH=$PATH:${TRAVIS_BUILD_DIR}/utPLSQL-cli/bin
29+ # Adding Oracle SQLCL to path - to be able to invoke "sql" from command line
30+ - PATH=$PATH:${TRAVIS_BUILD_DIR}/sqlcl/bin
31+
32+ # Project-specific database variables
33+ # used for creating the user in database, deploying source code and tests as well as executing the tests
3034 - DB_USER=ut3_demo
31- - DB_PASS=LHZYPbWvYdu2ctp8
32- # # utPLSQL variables
35+ - DB_PASS=ut3_demo
36+ # utPLSQL variables
3337 - UTPLSQL_DIR="utPLSQL"
34- - ORA_SDTZ='Europe/London' # Needed as a client parameter
35- - TZ='Europe/London' # Needed as a DB Server parameter
36- # #utPLSQL-cli variables
37- - UTPLSQL_CLI_VERSION="3.1.0"
3838 - CACHE_DIR=$HOME/.cache
39- - MAVEN_HOME=/usr/local/maven
40- - MAVEN_CFG=$HOME/.m2
39+ # Additionally, you need to set following variables as Travis secrets:
40+ # DOCKER_USER
41+ # DOCKER_PASSWORD
42+ # ORACLE_OTN_USER
43+ # ORACLE_OTN_PASSWORD
4144 matrix :
42- - UTPLSQL_3_VERSION ='develop'
43- - UTPLSQL_3_VERSION ='v3.0.0' VERSION_PLACEHOLDER='utPLSQL - Version X.X.X.X'
44- - UTPLSQL_3_VERSION ='v3.0.4' VERSION_PLACEHOLDER='X.X.X.X'
45- - UTPLSQL_3_VERSION ='v3.1.1'
45+ - UTPLSQL_VERSION ='develop'
46+ - UTPLSQL_VERSION ='v3.0.0' VERSION_PLACEHOLDER='utPLSQL - Version X.X.X.X'
47+ - UTPLSQL_VERSION ='v3.0.4' VERSION_PLACEHOLDER='X.X.X.X'
48+ - UTPLSQL_VERSION ='v3.1.1'
4649
4750cache :
4851 pip : true
4952 directories :
5053 - $CACHE_DIR
5154 - node_modules
52- - $MAVEN_CFG
5355
5456before_install :
55- # download latest utPLSQL develop code
56- - git clone --depth=1 --branch=${UTPLSQL_3_VERSION} https://github.com/utPLSQL/utPLSQL.git ${UTPLSQL_DIR}
57- # download latest utPLSQL-cli release
58- - curl -Lk -o utPLSQL-cli.zip https://github.com/utPLSQL/utPLSQL-cli/releases/download/v${UTPLSQL_CLI_VERSION}/utPLSQL-cli.zip
59- # update version placeholder before install
60- - if [[ -n ${VERSION_PLACEHOLDER} ]] ; then sed -i "s/${VERSION_PLACEHOLDER}/${UTPLSQL_3_VERSION}/g" ${UTPLSQL_DIR}/source/core/ut_utils.pks; fi
57+ # Download Oracle sqlcl
58+ - .travis/install_sqlcl.sh -u ${ORACLE_OTN_USER} -p ${ORACLE_OTN_PASSWORD} -d ${CACHE_DIR} -o ${TRAVIS_BUILD_DIR}
59+ # Check if Oracle sqlcl it is installed correctly
60+ - sql -v
6161
62-
63- install :
62+ # download and unzip utPLSQL-cli release
63+ - curl -Lk -o utPLSQL-cli.zip "https://github.com/utPLSQL/utPLSQL-cli/releases/download/v3.1.6/utPLSQL-cli.zip"
6464 - unzip utPLSQL-cli.zip && chmod -R u+x utPLSQL-cli
65- # get ojdbc.jar from Oracle using maven
66- - bash .travis/maven_cfg.sh
67- - bash .travis/install_sqlcl.sh
68- # download and run Oracle docker DB image
69- - bash .travis/start_db.sh
65+ # copy ojdbc.jar from sqlcl to utPSLQL-cli so it can be visible to utPSLQL-cli
66+ - cp sqlcl/lib/ojdbc8.jar utPLSQL-cli/lib && cp sqlcl/lib/orai18n.jar utPLSQL-cli/lib
67+
68+ # Download specified version of utPLSQL from utPLSQL github repo
69+ # Allows any utPLSQL branch/tag name to be used
70+ - git clone --depth=1 --branch=${UTPLSQL_VERSION} https://github.com/utPLSQL/utPLSQL.git ${UTPLSQL_DIR}
7071
71- # Install utPLSQL
72+ # update version placeholder before install
73+ # This is only needed when downloading utPLSQL versions older than 3.1
74+ - if [[ -n ${VERSION_PLACEHOLDER} ]] ; then sed -i "s/${VERSION_PLACEHOLDER}/${UTPLSQL_VERSION}/g" ${UTPLSQL_DIR}/source/core/ut_utils.pks; fi
75+
76+ - docker login -u "${DOCKER_USER}" -p "${DOCKER_PASSWORD}"
77+ # download Oracle Database docker image from private repo and start the DB
78+ - time docker pull ${DOCKHER_HUB_REPO}:${ORACLE_VERSION}
79+ # start the docker container (DB)
80+ - docker run -d --name ${ORACLE_VERSION} ${DOCKER_OPTIONS} -p 1521:1521 ${DOCKHER_HUB_REPO}:${ORACLE_VERSION}
81+ # Wait for DB startup
82+ - time docker logs -f ${ORACLE_VERSION} | grep -m 1 "DATABASE IS READY TO USE!" --line-buffered
83+
84+ # Install utPLSQL into the Database
7285 - .travis/install_utplsql.sh
73- - .travis/setup_account.sh
86+
87+ install :
88+ # Create the demo project DB user account
89+ - source/setup_db_account.sh
7490 # Install project sources and tests
7591 - source/install.sh
7692 - test/install.sh
0 commit comments