forked from utPLSQL/utPLSQL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
143 lines (133 loc) · 6.27 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
sudo: required
language: python
addons:
apt:
packages:
- unzip
# Java9 Required for Sonar and SQLCL
- oracle-java9-installer
- oracle-java9-set-default
sonarcloud:
organization: utplsql
token:
secure: ${SONAR_TOKEN}
services:
- docker
env:
global:
- UT3_OWNER=ut3
- UT3_OWNER_PASSWORD=ut3
- UT3_RELEASE_VERSION_SCHEMA=UT3_LATEST_RELEASE
- UT3_USER="UT3\$USER#"
- UT3_USER_PASSWORD=ut3
- UT3_TESTER=ut3_tester
- UT3_TESTER_PASSWORD=ut3
- UT3_TESTER_HELPER=ut3_tester_helper
- UT3_TESTER_HELPER_PASSWORD=ut3
- UT3_TABLESPACE=users
# Environment for building a release
- CURRENT_BRANCH=${TRAVIS_BRANCH}
- UTPLSQL_REPO="utPLSQL/utPLSQL"
- UTPLSQL_BUILD_NO="${TRAVIS_BUILD_NUMBER:-0}"
- UTPLSQL_VERSION_PATTERN="v?([0-9]+\.){3}[0-9]+[^']*"
- UTPLSQL_VERSION=$(. .travis/get_project_version.sh)
- UTPLSQL_BUILD_VERSION=$(. .travis/get_project_build_version.sh)
- UTPLSQL_SOURCES_DIR='source'
- UTPLSQL_BUILD_USER_NAME="Travis CI"
- CACHE_DIR=$HOME/.cache
# Database Env
- SQLCLI="$HOME/sqlcl/bin/sql"
- OJDBC_HOME="$HOME/sqlcl/lib"
- ORACLE_PWD="oracle"
- UT3_DOCKER_REPO="utplsqlv3/oracledb"
- DOCKHER_HUB_REPO="${DOCKER_BASE_TAG:-$UT3_DOCKER_REPO}"
#utPLSQL released version directory
- UTPLSQL_DIR="utPLSQL_latest_release"
- SELFTESTING_BRANCH=${TRAVIS_BRANCH}
- UTPLSQL_CLI_VERSION="3.1.6"
# Maven
- MAVEN_HOME=/usr/local/maven
- MAVEN_CFG=$HOME/.m2
matrix:
- ORACLE_VERSION="${DOCKER_TAG_11G:-11g-r2-xe}" CONNECTION_STR='127.0.0.1:1521/XE' DOCKER_OPTIONS='--shm-size=1g'
- ORACLE_VERSION="${DOCKER_TAG_12C:-12c-r1-se2-small}" CONNECTION_STR='127.0.0.1:1521/ORCLCDB' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
- ORACLE_VERSION="${DOCKER_TAG_12C2:-12c-r2-se2-small}" CONNECTION_STR='127.0.0.1:1521/ORCLCDB' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
- ORACLE_VERSION="${DOCKER_TAG_18:-18c-se2-small}" CONNECTION_STR='127.0.0.1:1521/ORCLCDB' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
- ORACLE_VERSION="${DOCKER_TAG_19:-19c-se2-small}" CONNECTION_STR='127.0.0.1:1521/ORCLCDB' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
cache:
pip: true
directories:
- $CACHE_DIR
- /home/travis/.sonar/cache
- node_modules
- $MAVEN_CFG
before_install:
#cache to be used between stages. Based on https://github.com/travis-ci/docs-travis-ci-com/issues/1329
#delete all files in cache that are older than 5 days
- mkdir -p $CACHE_DIR/stages_cache; find $CACHE_DIR/stages_cache/ -mtime +5 -exec rm {} \;
#The update_project_version.sh is done before deployment to validate that the change of project files does not break installation
- bash .travis/update_project_version.sh
#Allow for sonar to blame issues
- git fetch --unshallow
# download latest utPLSQL release
#- curl -LOk $(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip" | sed 's/"//g')
- git clone --depth=1 --branch=${SELFTESTING_BRANCH:-master} https://github.com/utPLSQL/utPLSQL.git $UTPLSQL_DIR
# download latest utPLSQL-cli release
- curl -Lk -o utPLSQL-cli.zip https://github.com/utPLSQL/utPLSQL-cli/releases/download/v${UTPLSQL_CLI_VERSION}/utPLSQL-cli.zip
install:
#- unzip utPLSQL.zip
- unzip utPLSQL-cli.zip && chmod -R u+x utPLSQL-cli
# Get ojdbc via maven
- bash .travis/maven_cfg.sh
- bash .travis/install_sqlcl.sh
- sudo mkdir -p /dev/pdbs
- sudo chmod -R 777 /dev/pdbs
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/start_db.sh; fi
before_script:
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/install.sh; fi
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/install_utplsql_release.sh; fi
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/run_examples.sh; fi
script:
- if [[ ! $TRAVIS_TAG ]]; then bash test/install_and_run_tests.sh; fi
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/validate_report_files.sh; fi
- if [[ ! $TRAVIS_TAG ]] && [[ ("${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" && "${TRAVIS_PULL_REQUEST}" == false) || ("${TRAVIS_PULL_REQUEST_SLUG}" = "${UTPLSQL_REPO}") ]]; then bash .travis/run_sonar_scanner.sh; fi
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/coveralls_uploader.sh; fi
notifications:
slack:
rooms:
- secure: "nemt9n2y5sVCAKqa/s7JDQ8AcM59Xu/XbH/RkMOXvPgc+KtR8lBtVD1LkvJ5BaQhqgjuDT7DNt/uisQJ7k6a2OsrVFbnkypZ1hCvntOBpJyoSpD/YL1X8a9GbGojuJcph0BX76KN21LaOVdyOfY0TSlw53XiYWS8iL5HtjpWCbIwHL1SJ8JT8mhdT4hDoUWZjcZ4s4bLH6BQm4un/bMQOmB4sDoCeg4CllJwxgkswVF7OHpOFjgPetvUp7ps8b/Rj8en6zCj9drb0SVbXFgumo2Wd1bC3HHZB8MAZU0kuEV5VgUdum6EelUL5yfB72hssNQA0+CaT3HjBFkTlqWYJmjC4/xyGN3sseiW82T9FDY0g0GAGayNRW+QSiTQ1hbJEcAnNe0GrBUdRsgXdI6COd76YP5VxzRSF6H7niLfgCZdKbIivKUd1o+wBhuyJmqCFIkRWmT38tMGJqJAzbY1jq5gQXbb6E7gt+KdTjlSjcnJYf7XI7zqm+BRr+fbA0ixfXHvfqOBgZN6g08y9nPlDnIjtSF2NSdrj2zqYQAtKuWSOD1bnTyfDJyrtK7OLffZcMYD5Bcss4c8op8tP7MGTjt1S046SJocboh6H4c/nTokpoMRsWs6MKRdebl8C2RObGf5FebSOJg+oh2ZYS5Z/G9GshiY2BD/81+Hc4Miacc="
on_success: change
on_failure: always
jobs:
include:
- stage: deploy
env: ORACLE_VERSION="none"
before_install: skip
install:
- pip install mkdocs
before_script: skip
script:
- if [[ ($TRAVIS_BRANCH == develop) && ($TRAVIS_PULL_REQUEST == false) ]]; then bash .travis/trigger_travis.sh $TRAVIS_ACCESS_TOKEN; fi
- #The update_project_version.sh needs to be done before pushing changes to develop branch
- bash .travis/update_project_version.sh
- git config --global user.email "[email protected]"
- git config --global user.name "${UTPLSQL_BUILD_USER_NAME}"
- git remote rm origin
- git remote add origin https://${github_api_token}@github.com/${UTPLSQL_REPO}
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/push_release_version.sh; fi
- bash .travis/build_docs.sh
- bash .travis/push_docs_to_gh_pages.sh
before_deploy:
- bash .travis/build_release_archive.sh
deploy:
provider: releases
api_key: $github_api_token
file:
- utPLSQL.zip
- utPLSQL.tar.gz
- utPLSQL.zip.md5
- utPLSQL.tar.gz.md5
skip_cleanup: true
on:
repo: ${UTPLSQL_REPO}
tags: true