Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
6dd94d1
Start of utPlSql maven plugin
antusus Nov 20, 2017
5938316
Rebuild the Mojo Plugin in order to add parameters the the Java UtPLSQL
alberto-hernandez Jan 26, 2018
e612ad2
Adding report handling
rostskadat Jan 26, 2018
3cb6bee
Adding handling of <paths>
rostskadat Jan 26, 2018
2193755
Exposing more parameters
rostskadat Jan 29, 2018
6324461
Fixed path attribute.
rostskadat Jan 29, 2018
963e128
Added some output when writing report
rostskadat Jan 30, 2018
a0c0fd1
Using lambda function for dumping parameters
rostskadat Jan 30, 2018
7f6cf27
Adding possibility to output to stdout
rostskadat Jan 30, 2018
1b0fa02
Added some documentation
rostskadat Jan 30, 2018
3c59e97
Removed handling of <includeObject> and <excludeObject>.
rostskadat Jan 30, 2018
16b60d8
Log which report logs to the stdout
rostskadat Jan 30, 2018
37d4591
Added friendly message for invalid <sources> and <tests> resources
rostskadat Feb 5, 2018
d74cbb4
Update README.md
alberto-hernandez Feb 6, 2018
b214363
Added Optional parameters to plugin
alberto-hernandez Feb 6, 2018
6b179c0
Update README.md
alberto-hernandez Feb 6, 2018
bdb8c10
* Modified Reporters Configuration
alberto-hernandez Feb 7, 2018
8eef742
Merge pull request #2 from alberto-hernandez/develop
jgebal Feb 9, 2018
47df5d5
Upgrade the Maven Plugin to the API version 3.1.0
alberto-hernandez May 15, 2018
0946db1
Upgraded version to 3.1.0 to be aligned with API
May 16, 2018
e3c4e4f
Adding initial Travis config for the project
jgebal May 17, 2018
69ad19d
Setting properties for the test run
jgebal May 17, 2018
54ec57f
Added slack notifications for Travis
jgebal May 17, 2018
ee999b8
Fix of #10, Sonar Coverage Reports
May 17, 2018
92a7cff
Merge branch 'develop' of https://github.com/utPLSQL/utPLSQL-maven-pl…
May 17, 2018
f420b07
Fixing mvn params.
jgebal May 17, 2018
09d5dc7
Fixing mvn params.
jgebal May 17, 2018
861d532
[#9] Tested on Oracle 11 with framework version of 3.0.4 and 3.1.1
May 17, 2018
0072f47
Merge branch 'develop' of https://github.com/utPLSQL/utPLSQL-maven-pl…
May 17, 2018
6068ce0
Fixing mvn params.
jgebal May 18, 2018
40ec31b
Fixing tests for issues with 3.0.4 annotations positioning.
jgebal May 18, 2018
a4a4bb5
Moved to utPLSQL 3.1.1
jgebal May 18, 2018
8e387cc
Refactored Travis build to use local project test resources
jgebal May 18, 2018
600c61c
Fixed include filters in tests
jgebal May 18, 2018
9941cf9
Merge pull request #13 from utPLSQL/feature/fix_file_mapping_in_tests
jgebal May 20, 2018
da9e28a
Refactor code to package org.utplsql.maven.plugin
May 20, 2018
08e3122
Merge branch 'develop' of
May 20, 2018
a3a1833
Comment Fixed DB Credentials
May 20, 2018
2a65eff
Implementation of #12
May 20, 2018
774b265
Update documentation
May 20, 2018
2d58506
Refactor test project
jgarec May 23, 2018
0b2284d
Add new test for regex params (#12)
jgarec May 23, 2018
ebcdeec
Update documentation for #12
jgarec May 23, 2018
3f3d101
Refactored Travis build to use local project test resources
jgebal May 23, 2018
31f1a3f
Refactored Travis build to use local project test resources
jgebal May 23, 2018
1e2dc42
Fix build, use simple-project to populate database
jgarec May 24, 2018
ea96029
Merge branch 'develop' into feature/add_regex_test
jgarec May 24, 2018
4cf00ef
Fix travis build
jgarec May 25, 2018
087505e
Merge pull request #15 from jgarec/feature/add_regex_test
alberto-hernandez May 29, 2018
a2c357f
Adds support of custom type parameters (#5)
jgarec May 29, 2018
fbfda71
Fix regex complexity
jgarec Jun 6, 2018
93abf66
Merge pull request #16 from jgarec/feature/add_type_mapping_params
alberto-hernandez Jun 7, 2018
204c4fa
Feature/refactor tests (#19)
jgarec Jul 15, 2018
ef684c2
Upgrade java-api to latest snapshot
jgarec Jun 7, 2018
47116e7
DbURL can be configured with an environment variable
jgarec Jun 7, 2018
e49b4cd
Adds owners parameters for #5
jgarec Jun 29, 2018
9039ac2
Fixes #21 : all parameters are now optional
jgarec Jul 18, 2018
3679285
Merge pull request #22 from jgarec/feature/minimalist_project
alberto-hernandez Jul 23, 2018
a4d9545
update java-api to 3.1.1
jgarec Jul 27, 2018
43d1752
Adding support for maven sonar on travis as per Travis:
jgebal Jul 29, 2018
22c8369
Touch on travis.yml
jgebal Jul 29, 2018
2010e3a
Added project badges and updated example pom in readme.
jgebal Jul 29, 2018
b13cd2a
fixes #4 (#25)
jgarec Jul 30, 2018
9722a4f
Fixes #27 : color logging is based on maven configuration (#31)
jgarec Aug 1, 2018
d163a29
Merge pull request #30 from utPLSQL/feature/sonar
jgebal Aug 5, 2018
50da81e
Sets the console output on by default if no output option specified
viniciusam Sep 6, 2018
4417c12
Merge pull request #32 from utPLSQL/feature/issue-29-console-output
jgebal Sep 19, 2018
0dd57b9
#28 Optional reporters tag
viniciusam Oct 2, 2018
08065ba
Merge pull request #33 from utPLSQL/feature/issue-28-optional-reporte…
jgebal Oct 3, 2018
a51ff74
#7 Adding javadocs and sources in preparation for the release
viniciusam Oct 3, 2018
f8ea81e
Added some missing information to the pom file
viniciusam Oct 8, 2018
5b842a7
More configuration tidy up
viniciusam Oct 8, 2018
407c481
README file update, code formatting
viniciusam Oct 13, 2018
9fb0a5b
Merge pull request #34 from utPLSQL/feature/prepare-release
viniciusam Oct 20, 2018
4ef5c16
Added travis deploy configuration
viniciusam Oct 14, 2018
4d11c35
Fix repo name
viniciusam Oct 20, 2018
33a53a3
Fix gpg key command
viniciusam Oct 20, 2018
e055f42
Fix gpg commands
viniciusam Oct 20, 2018
eb8443b
Added skip_cleanup config
viniciusam Oct 20, 2018
e69889b
Added execute permissions to deployment scripts
viniciusam Oct 20, 2018
3aec0d8
Fix deployment script path
viniciusam Oct 20, 2018
7c62ea6
Deployment scripts tidy up
viniciusam Oct 20, 2018
8f1395f
Using bash to run the deployment script
viniciusam Oct 20, 2018
d9bdc14
Update of `deploy_snapshot.sh` to obtain version using echo.
jgebal Oct 20, 2018
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
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Eclipse
.classpath
.project
.settings/

# Intellij
.idea/
*.iml
*.iws

# Mac
.DS_Store

# Bash
*.swp

# Maven
log/
target/
.mvn
log.txt
**/pom.xml.versionsBackup

# Docs
doc/
73 changes: 73 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
sudo: required
language: java

services:
- docker

jdk:
- oraclejdk8

addons:
sonarcloud:
organization: utplsql
token:
secure: ${SONAR_TOKEN}

env:
global:
- DOCKER_CFG=$HOME/.docker
- DOCKER_REPO="utplsqlv3/oracledb"
- CACHE_DIR=$HOME/.cache
- MAVEN_HOME=/usr/local/maven
- MAVEN_CFG=$HOME/.m2
- DB_URL="127.0.0.1:1521:XE"
- DB_UT3_USER=ut3
- DB_UT3_PASS=ut3
- ORACLE_VERSION="11g-r2-xe"
- DOCKER_OPTIONS="--shm-size=1g"

cache:
directories:
- $DOCKER_CFG
- $CACHE_DIR
- $MAVEN_CFG

install:
- bash .travis/maven_cfg.sh
- bash .travis/start_db.sh
- bash .travis/install_utplsql.sh $DB_UT3_USER $DB_UT3_PASS
- bash .travis/install_demo_project.sh
- bash .travis/install_demo_owner_project.sh

script:
- echo "Run Unit tests"
- mvn org.jacoco:jacoco-maven-plugin:prepare-agent test
- echo "Run Integration tests"
- mvn org.jacoco:jacoco-maven-plugin:prepare-agent verify -Dmaven.skip.test -DdbUser="${DB_UT3_USER}" -DdbPass="${DB_UT3_PASS}" -DdbUrl="jdbc:oracle:thin:@${DB_URL}"
- mvn sonar:sonar

before_deploy:
- echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import
- echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust

deploy:
- provider: script
skip_cleanup: true
script: bash .travis/deploy_snapshot.sh
on:
repo: utPLSQL/utPLSQL-maven-plugin
branch: develop
- provider: script
skip_cleanup: true
script: bash .travis/deploy_release.sh
on:
repo: utPLSQL/utPLSQL-maven-plugin
branch: master
tags: true

notifications:
slack:
rooms:
- secure: "Gz0pGOOM6xbnz8Q/B3RzOFoVr8QGXsDSHcgCloPnO3ZkEOh4JJikqWAVdZrksMxhewIBRpbdIWAZOgsNXvW+cEDXxfml3X9Clj2wg5Uon97UeI+5WEHDhLYHn7t9EYr9QvVSOuQgBIiddk6kURxY4N0eAA4VUti8BDcMRq+gPxF1w/toFJXVR/I/tkLxcHPTbWQ9X87nNWcQgMoHe2AixYpglntmtoLXJ5F8MF08fcyTX7GJQ5xjq7HbYy+/39nEhQo2ZPhHHfk2rS6gIUY0wc+MAqobxvesplgGDybdTQyrdl48VjJ/CiQDedglUbNN9VYTFjPIYMdWCUCLV1uL866aNMiBpB7CQoNhi5WS7RERE9gblVPX2k6tOda27fEWlhjha6OmdK6TQ9qTITU7U4OTSOz41dDPeVfqMHRggxo3ozlLONTiZ1y9fz/Ez9WjiJjtUDt60vgnVIo7BcQV/yDJcqAtQbfWyf0n73g5lMBvLGnO2Agm2N7hNEeCbpr+PZUoqkEM/e4SxdUCQGi8Ppi9Zp0E4v0iG7hyjzol+G4T8JN0bUGg0OOow/bfZa5J2aUsrC1qP/ZLpMA94NI6ZlL2wRHhZ9JtVSDLjtSwq9yW5XF7o7kdqBWBCslbGnYPoCoHOzfZuUvArSlRoGNu75dw/Qhoo9gFl1RG/RlChaU="
on_success: change
on_failure: always
8 changes: 8 additions & 0 deletions .travis/deploy_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -ev

VERSION=$(tr -d "/v/" <<<${TRAVIS_TAG})
mvn org.codehaus.mojo:versions-maven-plugin:2.7:set -DnewVersion=${VERSION}

cd utplsql-maven-plugin
mvn deploy -DskipTests -U -Prelease
13 changes: 13 additions & 0 deletions .travis/deploy_snapshot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -ev

DATE=`date +%Y%m%d%H%M`
#using this solution to get version into variable: https://stackoverflow.com/a/26514030/1470603
OLD_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
VERSION=`sed "s/-SNAPSHOT/-${DATE}-SNAPSHOT/g" <<<"${OLD_VERSION}"`

echo "Changing snapshot version, OLD: ${OLD_VERSION} NEW: ${VERSION}"
mvn org.codehaus.mojo:versions-maven-plugin:2.7:set -DnewVersion=${VERSION}

cd utplsql-maven-plugin
mvn deploy -DskipTests -U -Prelease
50 changes: 50 additions & 0 deletions .travis/install_demo_owner_project.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
set -ev

PROJECT_FILES_SRC="utplsql-maven-plugin-it/src/it/resources/owner-param-project"
PROJECT_FILES="resources-owner"
DB_CODE_USER=CODE_OWNER
DB_TESTS_USER=TESTS_OWNER
DB_PASS=pass

cat > demo_project.sh.tmp <<EOF
sqlplus -S -L sys/oracle@//127.0.0.1:1521/xe AS SYSDBA <<SQL
create user ${DB_CODE_USER} identified by ${DB_PASS} quota unlimited on USERS default tablespace USERS;
grant create session, create procedure, create type, create table, create sequence, create view to ${DB_CODE_USER};

create user ${DB_TESTS_USER} identified by ${DB_PASS} quota unlimited on USERS default tablespace USERS;
grant create session, create procedure, create type, create table, create sequence, create view, create synonym to ${DB_TESTS_USER};
grant select any dictionary to ${DB_TESTS_USER};
grant select any table, delete any table, drop any table to ${DB_TESTS_USER};
grant execute any procedure to ${DB_TESTS_USER};
exit
SQL

cd ${PROJECT_FILES}
sqlplus -S -L ${DB_CODE_USER}/${DB_PASS}@//127.0.0.1:1521/xe <<SQL
whenever sqlerror exit failure rollback
whenever oserror exit failure rollback

@scripts/sources/foo/tables/TO_TEST_ME.tab
@scripts/sources/foo/packages/PKG_TEST_ME.sql
@scripts/sources/foo/package_bodies/PKG_TEST_ME.sql

exit
SQL

sqlplus -S -L ${DB_TESTS_USER}/${DB_PASS}@//127.0.0.1:1521/xe <<SQL
whenever sqlerror exit failure rollback
whenever oserror exit failure rollback

create synonym TO_TEST_ME for ${DB_CODE_USER}.TO_TEST_ME;
create synonym PKG_TEST_ME for ${DB_CODE_USER}.PKG_TEST_ME;
@scripts/test/bar/packages/TEST_PKG_TEST_ME.sql
@scripts/test/bar/package_bodies/TEST_PKG_TEST_ME.sql

exit
SQL
EOF

docker cp ./$PROJECT_FILES_SRC $ORACLE_VERSION:/$PROJECT_FILES
docker cp ./demo_project.sh.tmp $ORACLE_VERSION:/demo_project.sh
docker exec $ORACLE_VERSION bash demo_project.sh
35 changes: 35 additions & 0 deletions .travis/install_demo_project.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
set -ev

PROJECT_FILES_SRC="utplsql-maven-plugin-it/src/it/resources/simple-project"
PROJECT_FILES="resources"
DB_USER=app
DB_PASS=app

cat > demo_project.sh.tmp <<EOF
sqlplus -S -L sys/oracle@//127.0.0.1:1521/xe AS SYSDBA <<SQL
create user ${DB_USER} identified by ${DB_PASS} quota unlimited on USERS default tablespace USERS;
grant create session, create procedure, create type, create table, create sequence, create view to ${DB_USER};
grant select any dictionary to ${DB_USER};
exit
SQL

cd ${PROJECT_FILES}
sqlplus -S -L ${DB_USER}/${DB_PASS}@//127.0.0.1:1521/xe <<SQL
whenever sqlerror exit failure rollback
whenever oserror exit failure rollback

@scripts/sources/TO_TEST_ME.tab
@scripts/sources/APP.PKG_TEST_ME.spc
@scripts/sources/APP.PKG_TEST_ME.bdy

@scripts/tests/APP.TEST_PKG_TEST_ME.spc
@scripts/tests/APP.TEST_PKG_TEST_ME.bdy

exit
SQL
EOF

docker cp ./$PROJECT_FILES_SRC $ORACLE_VERSION:/$PROJECT_FILES
docker cp ./demo_project.sh.tmp $ORACLE_VERSION:/demo_project.sh
docker exec $ORACLE_VERSION bash demo_project.sh
46 changes: 46 additions & 0 deletions .travis/install_utplsql.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
set -ev
cd $(dirname $(readlink -f $0))

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

# Download develop branch of utPLSQL.
#UTPLSQL_VERSION="develop"
#UTPLSQL_FILE="utPLSQL"
#git clone -b develop --single-branch https://github.com/utPLSQL/utPLSQL.git
# tar -czf $UTPLSQL_FILE.tar.gz $UTPLSQL_FILE && rm -rf $UTPLSQL_FILE

# 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 sys/oracle@//127.0.0.1:1521/xe AS SYSDBA @install_headless.sql $1 $2 users

sqlplus -S -L sys/oracle@//127.0.0.1:1521/xe AS SYSDBA << SQL
grant execute any procedure to $1;
grant create any procedure to $1;
grant execute on dbms_lob to $1;
grant execute on dbms_sql to $1;
grant execute on dbms_xmlgen to $1;
grant execute on dbms_lock to $1;


exit
SQL
EOF

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

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

# Execute the utPLSQL installation inside the container.
docker exec $ORACLE_VERSION bash install.sh
17 changes: 17 additions & 0 deletions .travis/maven_cfg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -ev
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

cp settings.xml $MAVEN_CFG/settings.xml

49 changes: 49 additions & 0 deletions .travis/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>${env.GPG_EXECUTABLE}</gpg.executable>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>

<servers>
<server>
<id>ossrh</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
<server>
<id>maven.oracle.com</id>
<username>${env.ORACLE_OTN_USER}</username>
<password>${env.ORACLE_OTN_PASSWORD}</password>
<configuration>
<basicAuthScope>
<host>ANY</host>
<port>ANY</port>
<realm>OAM 11g</realm>
</basicAuthScope>
<httpConfiguration>
<all>
<params>
<property>
<name>http.protocol.allow-circular-redirects</name>
<value>%b,true</value>
</property>
</params>
</all>
</httpConfiguration>
</configuration>
</server>
</servers>

</settings>
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 -ev

# If docker credentials are not cached, do the login.
if [ ! -f $DOCKER_CFG/config.json ]; 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
Loading