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

Skip to content

Commit 2e2e943

Browse files
authored
Merge pull request #723 from utPLSQL/release/v3.1.2
releasing v3.1.2
2 parents db37f00 + 1bdb86c commit 2e2e943

279 files changed

Lines changed: 9801 additions & 6066 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@ addons:
55
apt:
66
packages:
77
- unzip
8-
# Java8 Required for Sonar and SQLCL
9-
- oracle-java8-installer
10-
- oracle-java8-set-default
8+
# Java9 Required for Sonar and SQLCL
9+
- oracle-java9-installer
10+
- oracle-java9-set-default
1111
sonarcloud:
1212
organization: utplsql
1313
token:
1414
secure: ${SONAR_TOKEN}
15-
branches:
16-
- develop
17-
- master
1815

1916
services:
2017
- docker
@@ -46,14 +43,14 @@ env:
4643
- DOCKHER_HUB_REPO="${DOCKER_BASE_TAG:-$UT3_DOCKER_REPO}"
4744
#utPLSQL released version directory
4845
- UTPLSQL_DIR="utPLSQL_latest_release"
49-
- SELFTESTING_BRANCH="develop"
46+
- SELFTESTING_BRANCH=${TRAVIS_BRANCH}
5047
- UTPLSQL_CLI_VERSION="3.1.0"
5148
# Maven
5249
- MAVEN_HOME=/usr/local/maven
5350
- MAVEN_CFG=$HOME/.m2
5451
matrix:
55-
- ORACLE_VERSION="${DOCKER_TAG_11G:-11g-r2-xe}" CONNECTION_STR='127.0.0.1:1521/XE' DOCKER_OPTIONS='--shm-size=1g'
56-
- ORACLE_VERSION="${DOCKER_TAG_12C:-12c-r1-se2}" CONNECTION_STR='127.0.0.1:1521/ORCLPDB1' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
52+
- ORACLE_VERSION="${DOCKER_TAG_11G:-11g-r2-xe}" CONNECTION_STR='127.0.0.1:1521/XE' DOCKER_OPTIONS='--shm-size=1g'
53+
- ORACLE_VERSION="${DOCKER_TAG_12C:-12c-r1-se2}" CONNECTION_STR='127.0.0.1:1521/ORCLPDB1' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
5754
- ORACLE_VERSION="${DOCKER_TAG_12C2:-12c-r2-se2}" CONNECTION_STR='127.0.0.1:1521/ORCLPDB1' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
5855

5956
cache:
@@ -64,12 +61,10 @@ cache:
6461
- $MAVEN_CFG
6562

6663
before_install:
67-
#The update_project_version is done before deployment to validate that the change of project files does not break installation
64+
#The update_project_version.sh is done before deployment to validate that the change of project files does not break installation
6865
- bash .travis/update_project_version.sh
69-
- git config --global user.email "[email protected]"
70-
- git config --global user.name "${UTPLSQL_BUILD_USER_NAME}"
71-
- git remote rm origin
72-
- git remote add origin https://${github_api_token}@github.com/${UTPLSQL_REPO}
66+
#Allow for sonar to blame issues
67+
- git fetch --unshallow
7368
# download latest utPLSQL release
7469
#- curl -LOk $(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip" | sed 's/"//g')
7570
- git clone --depth=1 --branch=${SELFTESTING_BRANCH:-master} https://github.com/utPLSQL/utPLSQL.git $UTPLSQL_DIR
@@ -81,49 +76,62 @@ install:
8176
- unzip utPLSQL-cli.zip && chmod -R u+x utPLSQL-cli
8277
# Get ojdbc via maven
8378
- bash .travis/maven_cfg.sh
84-
- pip install mkdocs
8579
- bash .travis/install_sqlcl.sh
8680
- sudo mkdir -p /dev/pdbs
8781
- sudo chmod -R 777 /dev/pdbs
82+
- df -h
8883
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/start_db.sh; fi
8984
- df -h
9085

9186
before_script:
9287
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/install.sh; fi
9388
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/install_utplsql_release.sh; fi
94-
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/create_additional_grants_for_old_tests.sh; fi
9589
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/run_examples.sh; fi
9690
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/run_old_tests.sh; fi
9791

9892
script:
9993
- if [[ ! $TRAVIS_TAG ]]; then bash test/install_and_run_tests.sh; fi
100-
- if [[ ! $TRAVIS_TAG ]] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then sonar-scanner; fi
94+
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/validate_report_files.sh; fi
95+
- if [[ ! $TRAVIS_TAG ]] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ]; then bash .travis/run_sonar_scanner.sh; fi
10196
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/coveralls_uploader.sh; fi
102-
- bash .travis/build_docs.sh
103-
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/push_release_version.sh; fi
104-
- bash .travis/push_docs_to_gh_pages.sh
105-
106-
before_deploy:
107-
- bash .travis/build_release_archive.sh
108-
109-
deploy:
110-
provider: releases
111-
api_key: $github_api_token
112-
file:
113-
- utPLSQL.zip
114-
- utPLSQL.tar.gz
115-
- utPLSQL.zip.md5
116-
- utPLSQL.tar.gz.md5
117-
skip_cleanup: true
118-
on:
119-
repo: ${UTPLSQL_REPO}
120-
tags: true
121-
# when building from a release tag, use only first job "#xxx.1" to publish artifacts
122-
condition: "${TRAVIS_JOB_NUMBER} =~ \\.1$"
12397

12498
notifications:
12599
slack:
126100
rooms:
127101
- secure: "nemt9n2y5sVCAKqa/s7JDQ8AcM59Xu/XbH/RkMOXvPgc+KtR8lBtVD1LkvJ5BaQhqgjuDT7DNt/uisQJ7k6a2OsrVFbnkypZ1hCvntOBpJyoSpD/YL1X8a9GbGojuJcph0BX76KN21LaOVdyOfY0TSlw53XiYWS8iL5HtjpWCbIwHL1SJ8JT8mhdT4hDoUWZjcZ4s4bLH6BQm4un/bMQOmB4sDoCeg4CllJwxgkswVF7OHpOFjgPetvUp7ps8b/Rj8en6zCj9drb0SVbXFgumo2Wd1bC3HHZB8MAZU0kuEV5VgUdum6EelUL5yfB72hssNQA0+CaT3HjBFkTlqWYJmjC4/xyGN3sseiW82T9FDY0g0GAGayNRW+QSiTQ1hbJEcAnNe0GrBUdRsgXdI6COd76YP5VxzRSF6H7niLfgCZdKbIivKUd1o+wBhuyJmqCFIkRWmT38tMGJqJAzbY1jq5gQXbb6E7gt+KdTjlSjcnJYf7XI7zqm+BRr+fbA0ixfXHvfqOBgZN6g08y9nPlDnIjtSF2NSdrj2zqYQAtKuWSOD1bnTyfDJyrtK7OLffZcMYD5Bcss4c8op8tP7MGTjt1S046SJocboh6H4c/nTokpoMRsWs6MKRdebl8C2RObGf5FebSOJg+oh2ZYS5Z/G9GshiY2BD/81+Hc4Miacc="
128102
on_success: change
129103
on_failure: always
104+
105+
jobs:
106+
include:
107+
- stage: deploy
108+
env: ORACLE_VERSION="none"
109+
before_install: skip
110+
install:
111+
- pip install mkdocs
112+
before_script: skip
113+
script:
114+
- if [[ ($TRAVIS_BRANCH == develop) && ($TRAVIS_PULL_REQUEST == false) ]]; then bash .travis/trigger_travis.sh $TRAVIS_ACCESS_TOKEN; fi
115+
- #The update_project_version.sh needs to be done before pushing changes to develop branch
116+
- bash .travis/update_project_version.sh
117+
- git config --global user.email "[email protected]"
118+
- git config --global user.name "${UTPLSQL_BUILD_USER_NAME}"
119+
- git remote rm origin
120+
- git remote add origin https://${github_api_token}@github.com/${UTPLSQL_REPO}
121+
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/push_release_version.sh; fi
122+
- bash .travis/build_docs.sh
123+
- bash .travis/push_docs_to_gh_pages.sh
124+
before_deploy:
125+
- bash .travis/build_release_archive.sh
126+
deploy:
127+
provider: releases
128+
api_key: $github_api_token
129+
file:
130+
- utPLSQL.zip
131+
- utPLSQL.tar.gz
132+
- utPLSQL.zip.md5
133+
- utPLSQL.tar.gz.md5
134+
skip_cleanup: true
135+
on:
136+
repo: ${UTPLSQL_REPO}
137+
tags: true

.travis/create_additional_grants_for_old_tests.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

.travis/install.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,37 @@ alter session set plsql_warnings = 'ENABLE:ALL', 'DISABLE:(5004,5018,6000,6001,6
1111
@install_headless.sql $UT3_OWNER $UT3_OWNER_PASSWORD
1212
SQL
1313

14+
#uninstall core of utplsql
15+
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
16+
set feedback off
17+
set verify off
18+
19+
@uninstall_all.sql $UT3_OWNER
20+
declare
21+
v_leftover_objects_count integer;
22+
begin
23+
select sum(cnt)
24+
into v_leftover_objects_count
25+
from (select count(1) cnt from dba_objects where owner = '$UT3_OWNER'
26+
union all
27+
select count(1) cnt from dba_synonyms where table_owner = '$UT3_OWNER'
28+
);
29+
if v_leftover_objects_count > 0 then
30+
raise_application_error(-20000, 'Not all objects were successfully uninstalled - leftover objects count='||v_leftover_objects_count);
31+
end if;
32+
end;
33+
/
34+
SQL
35+
36+
#reinstall core of utplsql
37+
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
38+
set feedback off
39+
set verify off
40+
41+
alter session set plsql_warnings = 'ENABLE:ALL', 'DISABLE:(5004,5018,6000,6001,6003,6009,6010,7206)';
42+
@install.sql $UT3_OWNER
43+
SQL
44+
1445
#additional privileges to run scripted tests
1546
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
1647
set feedback on
@@ -38,3 +69,30 @@ revoke execute on dbms_crypto from $UT3_TESTER;
3869
grant create job to $UT3_TESTER;
3970
exit
4071
SQL
72+
73+
#additional privileges to run tests
74+
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
75+
set feedback on
76+
--needed for Mystats script to work
77+
grant select any dictionary to $UT3_OWNER;
78+
--Needed for testing a coverage outside ut3_owner.
79+
grant create any procedure, drop any procedure, execute any procedure to $UT3_OWNER;
80+
81+
exit
82+
SQL
83+
84+
#Create additional users
85+
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
86+
set feedback off
87+
@create_utplsql_owner.sql $UT3_USER $UT3_USER_PASSWORD $UT3_TABLESPACE
88+
89+
exit
90+
SQL
91+
92+
#Grant UT3 framework to UT3$USER#
93+
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
94+
set feedback off
95+
@create_user_grants.sql $UT3_OWNER $UT3_USER
96+
97+
exit
98+
SQL

.travis/lib/xml_validator.jar

9.89 KB
Binary file not shown.

.travis/push_docs_to_gh_pages.sh

Lines changed: 74 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -17,87 +17,85 @@ PAGES_TARGET_BRANCH="gh-pages"
1717
LATEST_DOCS_BRANCH="develop"
1818
# TRAVIS_* variables are set by travis directly and only need to be if testing externally
1919

20-
# Since we are running job matrix, only thie first job slave will need to do the work
21-
if [[ "${TRAVIS_JOB_NUMBER}" =~ \.1$ ]]; then
22-
# We don't want a pull request automatically updating the repository
23-
if [ "$TRAVIS_PULL_REQUEST" == "false" ] && { [ "${CURRENT_BRANCH}" == "${LATEST_DOCS_BRANCH}" ] || [ -n "${TRAVIS_TAG}" ]; }; then
20+
# We don't want a pull request automatically updating the repository
21+
if [ "$TRAVIS_PULL_REQUEST" == "false" ] && { [ "${CURRENT_BRANCH}" == "${LATEST_DOCS_BRANCH}" ] || [ -n "${TRAVIS_TAG}" ]; }; then
2422

25-
# ENV Variable checks are to help with configuration troubleshooting, they silently exit with unique message.
26-
# Anyone one of them not set can be used to turn off this functionality.
23+
# ENV Variable checks are to help with configuration troubleshooting, they silently exit with unique message.
24+
# Anyone one of them not set can be used to turn off this functionality.
2725

28-
# If a version of the project is not defined
29-
[[ -n "${UTPLSQL_VERSION}" ]] || { echo "variable UTPLSQL_VERSION is not defines or missing value"; exit 0; }
30-
# Fail if the markdown documentation is not present.
31-
[[ -f ./docs/index.md ]] || { echo "file docs/index.md not found"; exit 1; }
26+
# If a version of the project is not defined
27+
[[ -n "${UTPLSQL_VERSION}" ]] || { echo "variable UTPLSQL_VERSION is not defines or missing value"; exit 0; }
28+
# Fail if the markdown documentation is not present.
29+
[[ -f ./docs/index.md ]] || { echo "file docs/index.md not found"; exit 1; }
3230

33-
# Save some useful information
34-
SHA=`git rev-parse --verify HEAD`
31+
# Save some useful information
32+
SHA=`git rev-parse --verify HEAD`
3533

36-
# clone the repository and switch to PAGES_TARGET_BRANCH branch
37-
mkdir pages
38-
cd pages
39-
git clone https://${github_api_token}@github.com/${UTPLSQL_REPO} .
34+
# clone the repository and switch to PAGES_TARGET_BRANCH branch
35+
mkdir pages
36+
cd pages
37+
git clone https://${github_api_token}@github.com/${UTPLSQL_REPO} .
4038

41-
PAGES_BRANCH_EXISTS=$(git ls-remote --heads origin ${PAGES_TARGET_BRANCH})
39+
PAGES_BRANCH_EXISTS=$(git ls-remote --heads origin ${PAGES_TARGET_BRANCH})
4240

43-
if [ -n "$PAGES_BRANCH_EXISTS" ] ; then
44-
echo "Pages Branch Found"
45-
git checkout ${PAGES_TARGET_BRANCH}
46-
else
47-
echo "Creating Pages Branch"
48-
git checkout --orphan ${PAGES_TARGET_BRANCH}
49-
git rm -rf .
50-
fi
51-
#clear out develop documentation directory and copy docs contents to it.
52-
echo "updating 'develop' directory"
53-
mkdir -p develop
54-
rm -rf develop/**./* || exit 0
55-
cp -a ../docs/. ./develop
56-
# If a Tagged Build then copy to it's own directory as well and to the 'latest' release directory
57-
if [ -n "$TRAVIS_TAG" ]; then
58-
echo "Creating ${UTPLSQL_VERSION}"
59-
mkdir -p ${UTPLSQL_VERSION}
60-
rm -rf ${UTPLSQL_VERSION}/**./* || exit 0
61-
cp -a ../docs/. ${UTPLSQL_VERSION}
62-
echo "Populating 'latest' directory"
63-
mkdir -p latest
64-
rm -rf latest/**./* || exit 0
65-
cp -a ../docs/. latest
66-
fi
67-
# Stage changes for commit
68-
git add .
69-
#Check if there are doc changes, if none exit the script
70-
if [[ -z `git diff HEAD --exit-code` ]] && [ -n "${PAGES_BRANCH_EXISTS}" ] ; then
71-
echo "No changes to docs detected."
72-
exit 0
73-
fi
74-
#Changes where detected, so we need to update the version log.
75-
now=$(date +"%d %b %Y - %r")
76-
if [ ! -f index.md ]; then
77-
echo "---" >>index.md
78-
echo "layout: default" >>index.md
79-
echo "---" >>index.md
80-
echo "<!-- Auto generated from .travis/push_docs_to_gh_pages.sh -->" >>index.md
81-
echo "# Documentation versions" >>index.md
82-
echo "" >>index.md
83-
echo "" >>index.md #- 7th line - placeholder for latest release doc
84-
echo "" >>index.md #- 8th line - placeholder for develop branch doc
85-
echo "" >>index.md
86-
echo "## Released Version Doc History" >>index.md
87-
echo "" >>index.md
88-
fi
89-
#If build running on a TAG - it's a new release - need to add it to documentation
90-
if [ -n "${TRAVIS_TAG}" ]; then
91-
sed -i '7s@.*@'" - [Latest ${TRAVIS_TAG} documentation](latest/) - Created $now"'@' index.md
92-
#add entry to the top of version history (line end of file - ## Released Version Doc History
93-
sed -i '12i'" - [${TRAVIS_TAG} documentation](${UTPLSQL_VERSION}/) - Created $now" index.md
94-
fi
95-
#replace 4th line in log
96-
sed -i '8s@.*@'" - [Latest development version](develop/) - Created $now"'@' index.md
97-
#Add and Commit the changes back to pages repo.
98-
git add .
99-
git commit -m "Deploy to gh-pages branch: base commit ${SHA}"
100-
# Now that we're all set up, we can push.
101-
git push --quiet origin HEAD:${PAGES_TARGET_BRANCH}
41+
if [ -n "$PAGES_BRANCH_EXISTS" ] ; then
42+
echo "Pages Branch Found"
43+
git checkout ${PAGES_TARGET_BRANCH}
44+
else
45+
echo "Creating Pages Branch"
46+
git checkout --orphan ${PAGES_TARGET_BRANCH}
47+
git rm -rf .
10248
fi
49+
#clear out develop documentation directory and copy docs contents to it.
50+
echo "updating 'develop' directory"
51+
mkdir -p develop
52+
rm -rf develop/**./* || exit 0
53+
cp -a ../docs/. ./develop
54+
# If a Tagged Build then copy to it's own directory as well and to the 'latest' release directory
55+
if [ -n "$TRAVIS_TAG" ]; then
56+
echo "Creating ${UTPLSQL_VERSION}"
57+
mkdir -p ${UTPLSQL_VERSION}
58+
rm -rf ${UTPLSQL_VERSION}/**./* || exit 0
59+
cp -a ../docs/. ${UTPLSQL_VERSION}
60+
echo "Populating 'latest' directory"
61+
mkdir -p latest
62+
rm -rf latest/**./* || exit 0
63+
cp -a ../docs/. latest
64+
fi
65+
# Stage changes for commit
66+
git add .
67+
#Check if there are doc changes, if none exit the script
68+
if [[ -z `git diff HEAD --exit-code` ]] && [ -n "${PAGES_BRANCH_EXISTS}" ] ; then
69+
echo "No changes to docs detected."
70+
exit 0
71+
fi
72+
#Changes where detected, so we need to update the version log.
73+
now=$(date +"%d %b %Y - %r")
74+
if [ ! -f index.md ]; then
75+
echo "---" >>index.md
76+
echo "layout: default" >>index.md
77+
echo "---" >>index.md
78+
echo "<!-- Auto generated from .travis/push_docs_to_gh_pages.sh -->" >>index.md
79+
echo "# Documentation versions" >>index.md
80+
echo "" >>index.md
81+
echo "" >>index.md #- 7th line - placeholder for latest release doc
82+
echo "" >>index.md #- 8th line - placeholder for develop branch doc
83+
echo "" >>index.md
84+
echo "## Released Version Doc History" >>index.md
85+
echo "" >>index.md
86+
fi
87+
#If build running on a TAG - it's a new release - need to add it to documentation
88+
if [ -n "${TRAVIS_TAG}" ]; then
89+
sed -i '7s@.*@'" - [Latest ${TRAVIS_TAG} documentation](latest/) - Created $now"'@' index.md
90+
#add entry to the top of version history (line end of file - ## Released Version Doc History
91+
sed -i '12i'" - [${TRAVIS_TAG} documentation](${UTPLSQL_VERSION}/) - Created $now" index.md
92+
fi
93+
#replace 4th line in log
94+
sed -i '8s@.*@'" - [Latest development version](develop/) - Created $now"'@' index.md
95+
#Add and Commit the changes back to pages repo.
96+
git add .
97+
git commit -m "Deploy to gh-pages branch: base commit ${SHA}"
98+
# Now that we're all set up, we can push.
99+
git push --quiet origin HEAD:${PAGES_TARGET_BRANCH}
103100
fi
101+

0 commit comments

Comments
 (0)