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

Skip to content

Commit 51bb0a9

Browse files
committed
Merge branch 'version3' into feature/teamcity-reporter
# Conflicts: # source/install.sql
2 parents a1fce13 + 2a18482 commit 51bb0a9

213 files changed

Lines changed: 1336 additions & 1647 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.

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
.gitattributes export-ignore
3+
.gitignore export-ignore
4+
.gitmodules export-ignore
5+
.travis.yml export-ignore
6+
7+
.travis export-ignore
8+
9+
^docs/* linguist-documentation

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
55
# User-specific stuff:
66
.idea/
7-
docsource/project/Data/
8-
docs/
7+
site/
8+
pages/

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "tools/ndocs"]
2-
path = tools/ndocs
3-
url = https://github.com/rlove/NaturalDocs.git

.travis.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
sudo: required
2-
3-
language: perl
2+
language: python
43

54
env:
65
global:
@@ -19,6 +18,9 @@ env:
1918
- UT3_USER=ut3
2019
- UT3_PASSWORD=ut3
2120
- UT3_TABLESPACE=users
21+
# Target Branch and Directory for Deployment of Docs
22+
- PAGES_TARGET_BRANCH="gh-pages"
23+
- PAGES_VERSION_BASE="version3"
2224

2325
addons:
2426
apt:
@@ -27,7 +29,6 @@ addons:
2729
- bc
2830
- rpm
2931
- unzip
30-
# - libaio1
3132

3233

3334
cache:
@@ -36,25 +37,23 @@ cache:
3637
- $HOME/.cache
3738

3839
before_install:
39-
# perl modules needed for documenation generation
40-
- "cpanm IPC::System::Simple"
41-
- "cpanm Markdent"
42-
- "cpanm File::Map"
4340
# On trusty, download the zip file into a cachable directory
4441
- test "$DIST" = precise || export ORACLE_ZIP_DIR=$HOME/.cache
4542
# If the zip file already exists, do not download it again
4643
- test -f "$ORACLE_ZIP_DIR"/$(basename $ORACLE_FILE) || bash .travis/oracle/download.sh
4744

4845
install:
46+
- sudo pip install -r .travis/python_req.txt
4947
- bash .travis/oracle/install.sh
50-
48+
5149
script:
5250
- bash .travis/create_utplsql_user.sh
5351
- bash .travis/install_libraries.sh
5452
- bash .travis/install.sh
5553
- bash .travis/run_examples.sh
5654
- bash .travis/run_test.sh
57-
- perl docsource/builddocs.pl
55+
- bash .travis/build_docs.sh
56+
- bash .travis/push_docs_to_gh_pages.sh
5857

5958
notifications:
6059
slack: utplsql:oiMuXO95TvKeAUENuDt4cPrB

.travis/build_docs.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
mkdocs build --clean --strict

.travis/deploy_key.enc

3.18 KB
Binary file not shown.

.travis/install.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ set -ev
55
cd source
66
#install core of utplsql
77
"$ORACLE_HOME/bin/sqlplus" $UT3_USER/$UT3_PASSWORD @install.sql
8+
9+
10+
cd ..
11+
cd build
12+
#do style check
13+
"$ORACLE_HOME/bin/sqlplus" $UT3_USER/$UT3_PASSWORD @utplsql_style_check.sql

.travis/push_docs_to_gh_pages.sh

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
#!/bin/bash
2+
3+
# Many aspsects of this came from https://gist.github.com/domenic/ec8b0fc8ab45f39403dd
4+
# Significant alterations
5+
# - Avoid pulling all history for cloned repo
6+
# - Support for multiple copies of documenation,
7+
# - only clearing out latest
8+
# - doc-history.md logging doc history
9+
# - Wrapped calls with actual encrypt keys with > /dev/null 2> /dev/null4
10+
11+
# How to run:
12+
# - From repository root .travis/push_docs_to_gh_pages.sh
13+
14+
# Required files / directories (relative from repo root)
15+
# - Folder : "site" with that contains latest docs
16+
# - File : ".travis/deploy_key.enc" SSH deployment key encrypted by Travis command line tool
17+
18+
# Required ENV Variables
19+
# ENCRYPTION_LABEL - Manually Set in travis web settings. Value can be displayed in LOG
20+
# encrypted_${ENCRYPTION_LABEL}_key - Set in web settings using travis cmdline encryption
21+
# encrypted_${ENCRYPTION_LABEL}_iv - Set in web settings using travis cmdline encryption
22+
# PAGES_TARGET_BRANCH="gh-pages" - Set in .travis.yml, branch were pages will be deployed
23+
# PAGES_VERSION_BASE="version3" -Set in .travis.yml, directory for pages deployment
24+
# TRAVIS_* variables are set by travis directly and only need to be if testing externally
25+
26+
# Pull requests are special...
27+
# They won't have acceess to the encrypted variables.
28+
# This prevent access to the Encrypted SSH Key
29+
# Regardless we don't want a pull request automatically updating the repository
30+
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
31+
32+
# ENV Variable checks are to help with configuration troubleshooting
33+
# they silently exit with unique message. Anyone one of them not set
34+
# can be used to turn off this functionality.
35+
# For example a feature branch in the master repository that we don't want docs produced for yet.
36+
[[ -n "$PAGES_VERSION_BASE" ]] || { echo "PAGES_VERSION_BASE Missing"; exit 0; }
37+
[[ -n "$PAGES_TARGET_BRANCH" ]] || { echo "PAGES_TARGET_BRANCH Missing"; exit 0; }
38+
[[ -n "$ENCRYPTION_LABEL" ]] || { echo "ENCRYPTION_LABEL Missing"; exit 0; }
39+
40+
# Fail because required script to generate documenation must have not been run, or was changed.
41+
[[ -d ./site ]] || { echo "site directory not found"; exit 1; }
42+
43+
# Save some useful information
44+
REPO=`git config remote.origin.url`
45+
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
46+
SHA=`git rev-parse --verify HEAD`
47+
48+
# shallow clone the repostoriy and switch to PAGES_TARGET_BRANCH branch
49+
mkdir pages
50+
cd pages
51+
git clone --depth 1 $REPO .
52+
PAGES_BRANCH_EXISTS=$(git ls-remote --heads $REPO $PAGES_TARGET_BRANCH)
53+
54+
if [ -n "$PAGES_BRANCH_EXISTS" ] ; then
55+
echo "Pages Branch Found"
56+
echo "-$PAGES_BRANCH_EXISTS-"
57+
git remote set-branches origin $PAGES_TARGET_BRANCH
58+
git fetch --depth 1 origin $PAGES_TARGET_BRANCH
59+
git checkout $PAGES_TARGET_BRANCH
60+
else
61+
echo "Creating Pages Branch"
62+
git checkout --orphan $PAGES_TARGET_BRANCH
63+
git rm -rf .
64+
fi
65+
66+
#clear out latest and copy site contents to it.
67+
echo "updating $VERSION_BASE/latest"
68+
mkdir -p $PAGES_VERSION_BASE/latest
69+
rm -rf $PAGES_VERSION_BASE/latest/**./* || exit 0
70+
cp -a ../site/. $PAGES_VERSION_BASE/latest
71+
72+
# If a Tagged Build then copy to it's own directory as well.
73+
if [ -n "$TRAVIS_TAG" ]; then
74+
echo "Creating $PAGES_VERSION_BASE/$TRAVIS_TAG"
75+
mkdir -p $PAGES_VERSION_BASE/$TRAVIS_TAG || exit 0
76+
cp -a ../site/. $PAGES_VERSION_BASE/$TRAVIS_TAG
77+
fi
78+
79+
#Check if there are doc changes, if none exit the script
80+
if [[ -z `git diff --exit-code` ]] && [ -n "$PAGES_BRANCH_EXISTS" ] ; then
81+
echo "No changes to docs detected."
82+
exit 0
83+
fi
84+
85+
#Chganges where detected, so it's safe to write to log.
86+
now=$(date +"%d %b %Y - %r")
87+
export latest=" - [Latest Doc Change]($PAGES_VERSION_BASE/latest/) - Created $now"
88+
if [ ! -f doc-history.md ]; then
89+
echo "<!-- Auto generated in .travis/push_docs_to_gh_pages.sh -->" >doc-history.md
90+
echo "#Doc Generation Log" >>doc-history.md
91+
echo "" >>doc-history.md
92+
echo "- 4th line placeholder see below" >>doc-history.md
93+
echo "" >>doc-history.md
94+
echo "##Released Version Doc History" >>doc-history.md
95+
echo "" >>doc-history.md
96+
fi
97+
if [ -n "$TRAVIS_TAG" ]; then
98+
echo " - [$TRAVIS_TAG]($PAGES_VERSION_BASE/$TRAVIS_TAG/) - Created $now" >>doc-history.md
99+
fi
100+
101+
#replace 4th line in log
102+
sed -i '4s@.*@'"$latest"'@' doc-history.md
103+
104+
#Setup Git with Commiter info
105+
git config user.name "Travis CI"
106+
git config user.email "[email protected]"
107+
108+
#Add and Commit the changes back to pages repo.
109+
git add .
110+
git commit -m "Deploy to GitHub Pages: ${SHA}"
111+
112+
#unencrypt and configure deployment key
113+
[[ -e ../.travis/deploy_key.enc ]] || { echo ".travis/deploy_key.enc file not found"; exit 1; }
114+
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
115+
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
116+
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR} > /dev/null 2> /dev/null
117+
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR} > /dev/null 2> /dev/null
118+
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in ../.travis/deploy_key.enc -out ../.travis/deploy_key -d > /dev/null 2> /dev/null
119+
chmod 600 ../.travis/deploy_key
120+
eval `ssh-agent -s`
121+
ssh-add ../.travis/deploy_key
122+
123+
# Now that we're all set up, we can push.
124+
echo "git push $SSH_REPO $PAGES_TARGET_BRANCH"
125+
git push $SSH_REPO $PAGES_TARGET_BRANCH
126+
fi

.travis/python_req.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mkdocs

build/utplsql_style_check.sql

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
ALTER SESSION SET PLSCOPE_SETTINGS= 'IDENTIFIERS:ALL';
2+
3+
--install or comple all code here
4+
exec dbms_utility.compile_schema(USER,compile_all => TRUE,reuse_settings => FALSE);
5+
6+
7+
var errcnt number
8+
9+
column errcnt_a noprint new_value errcnt_a
10+
column errcnt_l noprint new_value errcnt_l
11+
column errcnt_c noprint new_value errcnt_c
12+
13+
--find parameters that donot begin with A_
14+
prompt parameters should start with A_
15+
select NAME,TYPE,OBJECT_NAME,OBJECT_TYPE,USAGE,LINE,COL , count(*) over() errcnt_a
16+
from user_identifiers
17+
where type like 'FORMAL%' and usage = 'DECLARATION'
18+
and name != 'SELF'
19+
and name not like 'A#_%' escape '#'
20+
order by object_name, object_type, line, col
21+
;
22+
23+
prompt variables should start with L_
24+
--variables start with l_ or g_
25+
select NAME,TYPE,OBJECT_NAME,OBJECT_TYPE,USAGE,LINE,COL , count(*) over() errcnt_l
26+
from user_identifiers
27+
where type like 'VARIABLE' and usage = 'DECLARATION'
28+
and object_type not in ('TYPE')
29+
and (name not like 'L#_%' escape '#'
30+
and name not like 'G#_%' escape '#' --TODO: only valid on package level
31+
)
32+
order by object_name, object_type, line, col
33+
;
34+
35+
--constants start with c_ or gc_
36+
prompt constants should start with C_
37+
select NAME,TYPE,OBJECT_NAME,OBJECT_TYPE,USAGE,LINE,COL , count(*) over() errcnt_c
38+
from user_identifiers
39+
where type like 'CONSTANT' and usage = 'DECLARATION'
40+
and (name not like 'C#_%' escape '#'
41+
and name not like 'GC#_%' escape '#'
42+
)
43+
order by object_name, object_type, line, col
44+
;
45+
46+
47+
exec :errcnt := nvl('&errcnt_a',0) + nvl('&errcnt_l',0) + nvl('&errcnt_c',0);
48+
49+
--quit :errcnt
50+
exit success

0 commit comments

Comments
 (0)