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

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Initial travis configuration
  • Loading branch information
viniciusam committed Apr 5, 2017
commit f4a9810cc1e71af1bddc2c66a73c9bcd702e39b9
25 changes: 25 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
language: java

services:
- docker

jdk:
- oraclejdk8
- oraclejdk7

env:
global:
- DOCKER_CFG=$HOME/.docker/config.json
- DOCKER_REPO="viniciusam/oracledb"
- UTPLSQL_VERSION="v3.0.0-beta"
- UTPLSQL_FILE="utPLSQLv3.0.0.562-beta"
matrix:
- ORACLE_VERSION="11g-xe-r2" CONNECTION_STR="127.0.0.1:1521/XE" DOCKER_OPTIONS="--shm-size=1g"

cache:
directories:
- $DOCKER_CFG

install:
- bash .travis/start_db.sh
- bash .travis/install_utplsql.sh
27 changes: 27 additions & 0 deletions .travis/install_utplsql.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -e

# Download the specified version of utPLSQL.
curl -L -O "https://github.com/utPLSQL/utPLSQL/releases/download/$UTPLSQL_VERSION/$UTPLSQL_FILE.tar.gz"

# Create a temporary install script.
cat > install.sh.tmp <<EOF
tar -xzf $UTPLSQL_FILE.tar.gz
rm $UTPLSQL_FILE.tar.gz

cd /$UTPLSQL_FILE/source

sqlplus -S -L system/oracle@//$CONNECTION_STR @install_headless.sql
sqlplus -S -L system/oracle@//$CONNECTION_STR @install.sql ut3
EOF

# Copy utPLSQL files to the container and install it.
docker cp ./$UTPLSQL_FILE.tar.gz $ORACLE_VERSION:/$UTPLSQL_FILE.tar.gz
docker cp ./install.sh.tmp $ORACLE_VERSION:/install.sh

# Remove temporary files.
rm $UTPLSQL_FILE.tar.gz
rm install.sh.tmp

# Execute the utPLSQL installation inside the container.
docker exec $ORACLE_VERSION bash install.sh
14 changes: 14 additions & 0 deletions .travis/start_db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -e

# If docker credentials are not cached, do the login.
if [ ! -f $DOCKER_CFG ]; then
docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
else
echo "Using docker login from cache..."
fi

# Pull the specified db version from docker hub.
docker pull $DOCKER_REPO:$ORACLE_VERSION
docker run -d --name $ORACLE_VERSION $DOCKER_OPTIONS -p 1521:1521 $DOCKER_REPO:$ORACLE_VERSION
docker logs -f $ORACLE_VERSION | grep -m 1 "DATABASE IS READY TO USE!" --line-buffered