Skip to content

Commit

Permalink
Merge pull request #650 from utPLSQL/release/v3.1.0
Browse files Browse the repository at this point in the history
Release/v3.1.0
  • Loading branch information
jgebal committed Apr 25, 2018
2 parents 4ec39b3 + baf8436 commit cf725fb
Show file tree
Hide file tree
Showing 617 changed files with 19,755 additions and 7,379 deletions.
13 changes: 11 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
* export-ignore
^docs/* linguist-documentation
.gitattributes export-ignore
.gitignore export-ignore
.gitmodules export-ignore
.travis.yml export-ignore
mkdocs.yml export-ignore
.travis export-ignore
sonar-project.properties export-ignore
tests export-ignore
development export-ignore
node_modules export-ignore
^docs/* linguist-documentation
11 changes: 0 additions & 11 deletions .gitattributes.release

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ node_modules/
utPLSQL_latest_release/
utPLSQL-cli/
development/env.sh
*.log
40 changes: 25 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ env:
- CURRENT_BRANCH=${TRAVIS_BRANCH}
- UTPLSQL_REPO="utPLSQL/utPLSQL"
- UTPLSQL_BUILD_NO="${TRAVIS_BUILD_NUMBER:-0}"
- UTPLSQL_VERSION_PATTERN='v?([0-9X]+\.){3}[0-9X]+'
- 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'
Expand All @@ -46,7 +46,10 @@ env:
- DOCKHER_HUB_REPO="${DOCKER_BASE_TAG:-$UT3_DOCKER_REPO}"
#utPLSQL released version directory
- UTPLSQL_DIR="utPLSQL_latest_release"
- UTPLSQL_CLI_FILE="utPLSQL-cli-develop-test3.zip"
- UTPLSQL_CLI_VERSION="3.0.4"
# 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}" CONNECTION_STR='127.0.0.1:1521/ORCLPDB1' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
Expand All @@ -57,6 +60,7 @@ cache:
directories:
- $CACHE_DIR
- node_modules
- $MAVEN_CFG

before_install:
#The update_project_version is done before deployment to validate that the change of project files does not break installation
Expand All @@ -68,32 +72,34 @@ before_install:
# 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 utPLSQL-cli develop
- curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=${UTPLSQL_CLI_FILE}
# 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
- pip install mkdocs
- 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
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/start_db.sh; fi
- df -h

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/create_additional_grants_for_old_tests.sh; fi
- if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_examples.sh; fi
- if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_old_tests.sh; fi
- 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/create_additional_grants_for_old_tests.sh; fi
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/run_examples.sh; fi
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/run_old_tests.sh; fi

script:
- if [ "${TRAVIS_TAG}" = "" ]; then bash test/install_and_run_tests.sh; fi
- if [ "${TRAVIS_TAG}" = "" ] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then sonar-scanner; fi
- if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/coveralls_uploader.sh; fi
- if [[ ! $TRAVIS_TAG ]]; then bash test/install_and_run_tests.sh; fi
- if [[ ! $TRAVIS_TAG ]] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then sonar-scanner; fi
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/coveralls_uploader.sh; fi
- bash .travis/build_docs.sh
- if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/push_release_version.sh; fi
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/push_release_version.sh; fi
- bash .travis/push_docs_to_gh_pages.sh

before_deploy:
Expand All @@ -115,4 +121,8 @@ deploy:
condition: "${TRAVIS_JOB_NUMBER} =~ \\.1$"

notifications:
slack: utplsql:oiMuXO95TvKeAUENuDt4cPrB
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
1 change: 0 additions & 1 deletion .travis/build_release_archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ rm -rf docs/*
# and replace it with generated html documentation from the ignored site folder
cp -r -v site/* docs

mv -f .gitattributes.release .gitattributes
git add .
git commit -m "tmp commit for building a release archive"

Expand Down
2 changes: 1 addition & 1 deletion .travis/coveralls_uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if (process.env.COVERALLS_URL_BASE) {
url = 'https://coveralls.io/api/v1/jobs';
}

fs.readFile('../old_tests/coverage.json',function (err,data) {
fs.readFile('../coverage.json',function (err,data) {
if (err) {
return console.log(err);
}
Expand Down
10 changes: 7 additions & 3 deletions .travis/get_project_version.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#!/usr/bin/env bash
#If building a new version from a release branch - then version is taken from release branch name

#When building a new version from a release branch, the version is taken from release branch name
if [[ "${CURRENT_BRANCH}" =~ ^release/v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
version=${CURRENT_BRANCH#release\/}
elif [[ "${TRAVIS_TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
version=${TRAVIS_TAG}
else
#Otherwise, version is taken from the VERSION file
version=`cat VERSION`
#When on develop branch, add "-develop" to the version text
if [[ "${CURRENT_BRANCH}" == "develop" ]]; then
version=`sed -r "s/(v?[0-9]+\.[0-9]+\.[0-9]+).*/\1-develop/" <<< "${version}"`
fi
fi
echo ${version}
7 changes: 6 additions & 1 deletion .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set -ev
set feedback off
set verify off
alter session set plsql_warnings = 'ENABLE:ALL', 'DISABLE:(5004,5018,6000,6001,6003,6009,6010,7206)';
@install_headless.sql $UT3_OWNER $UT3_OWNER_PASSWORD
SQL

Expand All @@ -20,16 +21,20 @@ grant create any procedure, drop any procedure, execute any procedure to $UT3_OW
conn $UT3_OWNER/$UT3_OWNER_PASSWORD@//$CONNECTION_STR
@../development/utplsql_style_check.sql
exit
SQL

#Create additional users
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
set feedback off
@create_utplsql_owner.sql $UT3_TESTER $UT3_TESTER_PASSWORD $UT3_TABLESPACE
--needed for testing distributed transactions
grant create public database link to $UT3_TESTER;
grant drop public database link to $UT3_TESTER;
set feedback on
--Needed for testing coverage outside of main UT3 schema.
grant create any procedure, drop any procedure, execute any procedure, create any type, drop any type, execute any type, under any type, select any table, update any table, insert any table, delete any table, create any table, drop any table, alter any table, select any dictionary to $UT3_TESTER;
revoke execute on dbms_crypto from $UT3_TESTER;
grant create job to $UT3_TESTER;
exit
SQL
6 changes: 5 additions & 1 deletion .travis/install_utplsql_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ end;
/
SQL

"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA @install_headless.sql ${UT3_RELEASE_VERSION_SCHEMA}
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<SQL
alter session set plsql_warnings = 'ENABLE:ALL', 'DISABLE:(5004,5018,6000,6001,6003,6009,6010,7206)';
@install_headless.sql ${UT3_RELEASE_VERSION_SCHEMA}
exit
SQL

"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<SQL
grant select any dictionary to ${UT3_RELEASE_VERSION_SCHEMA};
Expand Down
18 changes: 18 additions & 0 deletions .travis/maven_cfg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -ev
cp .travis/settings.xml $MAVEN_CFG/settings.xml

cd $(dirname $(readlink -f $0))

# Download wagon-http recommended by Oracle.
# On maven latest version this is not needed, but travis doesn't have it.
if [ ! -f $CACHE_DIR/wagon-http-2.8-shaded.jar ]; then
curl -L -O "http://central.maven.org/maven2/org/apache/maven/wagon/wagon-http/2.8/wagon-http-2.8-shaded.jar"
mv wagon-http-2.8-shaded.jar $CACHE_DIR/
sudo cp $CACHE_DIR/wagon-http-2.8-shaded.jar $MAVEN_HOME/lib/ext/
else
echo "Using cached wagon-http..."
sudo cp $CACHE_DIR/wagon-http-2.8-shaded.jar $MAVEN_HOME/lib/ext/
fi

mvn dependency:copy-dependencies -DoutputDirectory=../utPLSQL-cli/lib
62 changes: 62 additions & 0 deletions .travis/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!--Used to obtain ojdbc8 and orai18n files that are needed for client-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.utplsql</groupId>
<artifactId>utplsql</artifactId>
<version>3.0.4-SNAPSHOT</version>
<packaging>jar</packaging>

<name>utPLSQL</name>
<url>https://github.com/utPLSQL/utPLSQL</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>com.oracle.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>12.2.0.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.oracle.jdbc</groupId>
<artifactId>orai18n</artifactId>
<version>12.2.0.1</version>
<scope>compile</scope>
</dependency>
</dependencies>

<repositories>
<repository>
<id>maven.oracle.com</id>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>https://maven.oracle.com</url>
<layout>default</layout>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>maven.oracle.com</id>
<url>https://maven.oracle.com</url>
</pluginRepository>
</pluginRepositories>

<build>
<extensions>
<extension>
<groupId>io.packagecloud.maven.wagon</groupId>
<artifactId>maven-packagecloud-wagon</artifactId>
<version>0.0.6</version>
</extension>
</extensions>
</build>
</project>
16 changes: 9 additions & 7 deletions .travis/push_docs_to_gh_pages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,16 @@ if [[ "${TRAVIS_JOB_NUMBER}" =~ \.1$ ]]; then
mkdir -p develop
rm -rf develop/**./* || exit 0
cp -a ../docs/. ./develop
# If a Tagged Build then copy to it's own directory as well.
# If a Tagged Build then copy to it's own directory as well and to the 'latest' release directory
if [ -n "$TRAVIS_TAG" ]; then
echo "Creating ${UTPLSQL_VERSION}"
mkdir -p ${UTPLSQL_VERSION}
rm -rf ${UTPLSQL_VERSION}/**./* || exit 0
cp -a ../docs/. ${UTPLSQL_VERSION}
echo "Populating 'latest' directory"
mkdir -p latest
rm -rf latest/**./* || exit 0
cp -a ../docs/. latest
fi
# Stage changes for commit
git add .
Expand All @@ -69,7 +73,6 @@ if [[ "${TRAVIS_JOB_NUMBER}" =~ \.1$ ]]; then
fi
#Changes where detected, so we need to update the version log.
now=$(date +"%d %b %Y - %r")
export latest=" - [Latest development version](develop/) - Created $now"
if [ ! -f index.md ]; then
echo "---" >>index.md
echo "layout: default" >>index.md
Expand All @@ -85,13 +88,12 @@ if [[ "${TRAVIS_JOB_NUMBER}" =~ \.1$ ]]; then
fi
#If build running on a TAG - it's a new release - need to add it to documentation
if [ -n "${TRAVIS_TAG}" ]; then
latest_release=" [${TRAVIS_TAG} documentation](${UTPLSQL_VERSION}/) - Created $now"
sed -i '7s@.*@'" - Latest release: ${latest_release}"'@' index.md
#add entry to the end of file - ## Released Version Doc History
echo "- ${latest_release}">>index.md
sed -i '7s@.*@'" - [Latest ${TRAVIS_TAG} documentation](latest/) - Created $now"'@' index.md
#add entry to the top of version history (line end of file - ## Released Version Doc History
sed -i '12i'" - [${TRAVIS_TAG} documentation](${UTPLSQL_VERSION}/) - Created $now" index.md
fi
#replace 4th line in log
sed -i '8s@.*@'"${latest}"'@' index.md
sed -i '8s@.*@'" - [Latest development version](develop/) - Created $now"'@' index.md
#Add and Commit the changes back to pages repo.
git add .
git commit -m "Deploy to gh-pages branch: base commit ${SHA}"
Expand Down
21 changes: 12 additions & 9 deletions .travis/push_release_version.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
#!/usr/bin/env bash

echo Current branch is "${CURRENT_BRANCH}"
if [[ "${CURRENT_BRANCH}" =~ ^release/v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then

# We are updating version number only when:
# - not a pull request
# - branch name is = develop or branch name is like release/vX.X.X...
if [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [[ "${CURRENT_BRANCH}" =~ ^(release/v[0-9]+\.[0-9]+\.[0-9]+.*|develop)$ ]]; then
echo Current branch is "${CURRENT_BRANCH}"
echo Current job number is "${TRAVIS_JOB_NUMBER}"
#The publishing is done only once (for first job on a build matrix)
if [[ "${TRAVIS_JOB_NUMBER}" =~ \.1$ ]]; then
echo Publishing will be done for a job no. "${TRAVIS_JOB_NUMBER}"
echo "Committing version & buildNo into branch (${CURRENT_BRANCH})"
git add sonar-project.properties
git add VERSION
git commit -m 'Updated project version after building a release [skip ci]'

echo Pushing to origin
git add source/*
git commit -m 'Updated project version after build [skip ci]'
echo "Pushing to origin"
git push --quiet origin HEAD:${CURRENT_BRANCH}
else
echo Publishing will not be done for a job no.: "${TRAVIS_JOB_NUMBER}"
echo "Publishing of version skipped for job No.: ${TRAVIS_JOB_NUMBER}"
fi
else
echo Not on a release branch - skipping publishing of version
echo "Publishing of version skipped for branch ${CURRENT_BRANCH}, pull request ${TRAVIS_PULL_REQUEST}"
fi
Loading

0 comments on commit cf725fb

Please sign in to comment.