@@ -16,73 +16,77 @@ addons:
1616
1717env :
1818 global :
19- # Docker variables
20- # You need to additionally set secret variables:
21- # DOCKER_USER, DOCKER_PASSWORD in Travis settings panel to make sure they are not visible
19+ # Docker variables:
20+ - DOCKHER_HUB_REPO="${DOCKER_USER}/oracledb"
2221 - ORACLE_VERSION=11g-r2-xe
2322 - CONNECTION_STR='127.0.0.1:1521/XE'
2423 - DOCKER_OPTIONS='--shm-size=1g'
25- - ORACLE_PWD="oracle"
26- - UT3_DOCKER_REPO="utplsqlv3/oracledb"
27- - DOCKHER_HUB_REPO="${DOCKER_BASE_TAG:-$UT3_DOCKER_REPO}"
28- - SQLCLI="$HOME/sqlcl/bin/sql"
29- - OJDBC_HOME="$HOME/sqlcl/lib"
3024
31- # Project database user variables
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
3233 # used for creating the user in database, deploying source code and tests as well as executing the tests
3334 - DB_USER=ut3_demo
3435 - DB_PASS=ut3_demo
3536 # utPLSQL variables
3637 - UTPLSQL_DIR="utPLSQL"
37- # - ORA_SDTZ='Europe/London' #Needed as a client parameter
38- # - TZ='Europe/London' #Needed as a DB Server parameter
39- # #utPLSQL-cli variables
40- - UTPLSQL_CLI_VERSION="3.1.0"
4138 - CACHE_DIR=$HOME/.cache
42- - MAVEN_HOME=/usr/local/maven
43- - 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
4444 matrix :
45- - UTPLSQL_3_VERSION ='develop'
46- - UTPLSQL_3_VERSION ='v3.0.0' VERSION_PLACEHOLDER='utPLSQL - Version X.X.X.X'
47- - UTPLSQL_3_VERSION ='v3.0.4' VERSION_PLACEHOLDER='X.X.X.X'
48- - 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'
4949
5050cache :
5151 pip : true
5252 directories :
5353 - $CACHE_DIR
5454 - node_modules
55- - $MAVEN_CFG
5655
5756before_install :
58-
59-
60- install :
6157 # Download Oracle sqlcl
62- - bash .travis/install_sqlcl.sh
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
6361
64- # download latest utPLSQL-cli release
65- - curl -Lk -o utPLSQL-cli.zip https://github.com/utPLSQL/utPLSQL-cli/releases/download/v${UTPLSQL_CLI_VERSION}/utPLSQL-cli.zip
66- # and unzip it into utPLSQL-cli directory
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"
6764 - unzip utPLSQL-cli.zip && chmod -R u+x utPLSQL-cli
68- # get ojdbc.jar from Oracle using maven --maybe we could copy it from sqlcl ?
69- # this is needed for utPSLQL-cli
70- - bash .travis/maven_cfg.sh
71- # download ORacle Database docker image from private repo and start the DB
72- - 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
7367
7468 # Download specified version of utPLSQL from utPLSQL github repo
75- # Allows to set any branch name to be used
76- - git clone --depth=1 --branch=${UTPLSQL_3_VERSION } https://github.com/utPLSQL/utPLSQL.git ${UTPLSQL_DIR}
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}
7771
7872 # update version placeholder before install
7973 # This is only needed when downloading utPLSQL versions older than 3.1
80- - if [[ -n ${VERSION_PLACEHOLDER} ]] ; then sed -i "s/${VERSION_PLACEHOLDER}/${UTPLSQL_3_VERSION }/g" ${UTPLSQL_DIR}/source/core/ut_utils.pks; fi
74+ - if [[ -n ${VERSION_PLACEHOLDER} ]] ; then sed -i "s/${VERSION_PLACEHOLDER}/${UTPLSQL_VERSION }/g" ${UTPLSQL_DIR}/source/core/ut_utils.pks; fi
8175
82- # Install utPLSQL into DB
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
8385 - .travis/install_utplsql.sh
86+
87+ install :
8488 # Create the demo project DB user account
85- - .travis/setup_account .sh
89+ - source/setup_db_account .sh
8690 # Install project sources and tests
8791 - source/install.sh
8892 - test/install.sh
0 commit comments