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

Skip to content

Commit 81376a1

Browse files
committed
test cache implementations from cbandy/travis-oracle#17
1 parent 8c4ff86 commit 81376a1

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,17 @@ env:
1717
- ORA_SDTZ='Europe/London' #Needed as a client parameter
1818
- TZ='Europe/London' #Needed as a DB Server parameter
1919

20+
cache:
21+
directories:
22+
- .cache/oracle
23+
24+
before_install:
25+
# On trusty, download the zip file into a cachable directory
26+
- test "$DIST" = precise || export ORACLE_ZIP_DIR=$HOME/.cache
27+
# If the zip file already exists, do not download it again
28+
- test -f "$ORACLE_ZIP_DIR"/$(basename $ORACLE_FILE) || bash .travis/oracle/download.sh
29+
2030
install:
21-
- bash .travis/oracle/download.sh
2231
- bash .travis/oracle/install.sh
2332

2433
script:

.travis/oracle/download.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
// vim: set et sw=2 ts=2:
22
"use strict";
3+
4+
var fs = require('fs');
5+
36
var env = process.env;
47
var Promise = require('bluebird');
58
var Phantom = Promise.promisifyAll(require('node-phantom-simple'));
69
var PhantomError = require('node-phantom-simple/headless_error');
710

11+
if (env['ORACLE_ZIP_DIR']) {
12+
var directory = env['ORACLE_ZIP_DIR'];
13+
if (!fs.existsSync(directory)) {
14+
fs.mkdirSync(directory);
15+
}
16+
process.chdir(directory);
17+
}
18+
819
Phantom.createAsync({ parameters: { 'ssl-protocol': 'tlsv1' } }).then(function (browser) {
920
browser = Promise.promisifyAll(browser, { suffix: 'Promise' });
1021

.travis/oracle/install.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ test -f /sbin/chkconfig ||
1818

1919
test -d /var/lock/subsys || sudo mkdir /var/lock/subsys
2020

21-
unzip -j "$(basename $ORACLE_FILE)" "*/$ORACLE_RPM"
21+
if [ "$ORACLE_ZIP_DIR" != "" ]; then
22+
ORACLE_ZIP="$ORACLE_ZIP_DIR/$(basename $ORACLE_FILE)"
23+
else
24+
ORACLE_ZIP="$(basename $ORACLE_FILE)"
25+
fi
26+
27+
unzip -j $ORACLE_ZIP "*/$ORACLE_RPM"
28+
2229
sudo rpm --install --nodeps --nopre "$ORACLE_RPM"
2330

2431
echo 'OS_AUTHENT_PREFIX=""' | sudo tee -a "$ORACLE_HOME/config/scripts/init.ora" > /dev/null

0 commit comments

Comments
 (0)