Skip to content

Commit 4a1d223

Browse files
committed
Update of CONTRIBUTING.md. Fixed developer scripts.
1 parent a082451 commit 4a1d223

File tree

7 files changed

+70
-50
lines changed

7 files changed

+70
-50
lines changed

CONTRIBUTING.md

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -50,77 +50,79 @@ We use four different database accounts (users) for development process.
5050

5151

5252

53-
Snippet to get you started with development.
54-
55-
_If you're using Windows, you can run below scripts using `GIT bash` - Windows-based Unix-like command line._
53+
### To get started with development, follow the below steps.
5654

55+
_If you're using Windows, run the shell scripts using `GIT bash` - Windows-based bash command line._
56+
57+
**Clone your fork of utPLSQL git repository**
5758
```bash
5859
# clone your fork of utPLSQL
5960
git clone https://github.com/your account/utPLSQL.git utPLSQL
6061

6162
cd utPLSQL
6263

63-
# add main porject repo as upstream
64+
# add main project repo as upstream
6465
git remote add upstream https://github.com/utPLSQL/utPLSQL.git
6566

6667
# fetch all remote repositories
6768
git fetch --all
69+
```
6870

69-
# clone utPLSQL master branch from upstream into utPLSQL sub-directory of your project
70-
git clone --depth=1 --branch=master https://github.com/utPLSQL/utPLSQL.git utPLSQL_latest_release
71-
72-
# download beta version of utPLSQL-cli
73-
curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-test3.zip
74-
# unzip utPLSQL-cli and remove the zip file
75-
unzip utPLSQL-cli.zip && chmod -R u+x utPLSQL-cli && rm utPLSQL-cli.zip
71+
**Prepare environment script**
7672

73+
Copy the environment variables template `development/template.env.sh` to `development/env.sh`
74+
```bash
75+
cp development/template.env.sh development/env.sh
76+
chmod u+w development/env.sh
7777
```
7878

79-
Now copy the file `development/template.env.sh` to `development/env.sh` and adjust variables to match your local needs.
80-
You might have to adjust the following lines:
81-
82-
````bash
79+
You might have to adjust the following lines in `development/env.sh`:
80+
```bash
8381
export SQLCLI=sql # For sqlcl client
8482
#export SQLCLI=sqlplus # For sqlplus client
8583
export CONNECTION_STR=127.0.0.1:1521/xe # Adjust the connect string
8684
export ORACLE_PWD=oracle # Adjust your local SYS password
87-
````
85+
```
86+
87+
**Download utPLSQL release sources and utplsq-cli**
8888

89-
Refreshing your local repo.
89+
_The below script is fetching latest release version from utPLSQL repository. Latest release version is used for self-testing._
9090
```bash
91-
# fetch all remote repositories
92-
git fetch --all
91+
development/refresh_sources.sh
92+
```
9393

94-
# remove sub-direcotry containing master branch shallow copy
95-
rm -rf utPLSQL
96-
# clone utPLSQL master branch from upstream into utPLSQL sub-directory of your project
97-
git clone --depth=1 --branch=master https://github.com/utPLSQL/utPLSQL.git
94+
**Setup local database for utPLSQL development**
95+
```bash
96+
development/install.sh
97+
```
9898

99-
rm -rf utPLSQL-cli/*
100-
# download beta version of utPLSQL-cli
101-
curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-test3.zip
102-
# unzip utPLSQL-cli and remove the zip file
103-
unzip utPLSQL-cli.zip && chmod -R u+x utPLSQL-cli && rm utPLSQL-cli.zip
99+
That's it! You now have the following:
100+
- sources from `develop` branch of your fork of utPLSQL repository in `utPLSQL/ut3_latest_release` directory
101+
- sources from `master` branch of utPLSQL/utPLSQL repository in `utPLSQL/ut3_latest_release` directory
102+
- binaries of `utplsql-cli` in `utPLSQL/utPLSQL-cli` directory
103+
- database users created
104+
- utPLSQL develop version deployed to `ut3` schema
105+
- utPLSQL released version deployed to `ut3_latest_release`
104106

105-
```
107+
At any time, if you need to refresh your database, the below scripts might be helpful.
106108

107-
Cleanup of utPLSQL installation (call from your base repo directory).
109+
### Cleanup of utPLSQL installation in local database
108110
```bash
109111
development/cleanup.sh
110112
```
111113

112-
Install utPLSQL for development (call from your base repo directory)
114+
### Reinstalling utPLSQL development in `ut3` schema
113115
```bash
114-
development/install.sh
116+
development/refresh_ut3.sh
115117
```
116118

117-
Reinstalling utPLSQL development in `ut3` schema (call from your base repo directory).
118-
```bash
119-
development/refresh.sh
120-
```
119+
Whenever a new version of utPLSQL or a new version of utPLSQL-cli is available, use `development/refresh_sources.sh` to refresh files in your local project folders.
121120

122121
## Modules ##
123122

123+
Below diagram gives a high-level overview of utPLSQL v3 modules and their dependencies.
124+
Dependencies to `ut_util` are not shown as most of modules are depending on it.
125+
124126
![utPLSQL V3 Modules](development/utPSLQLv3-modules.png)
125127

126128

development/cleanup.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env bash
2-
cd $(git rev-parse --show-cdup)
32

4-
development/env.sh
3+
#goto git root directory
4+
git rev-parse && cd "$(git rev-parse --show-cdup)"
5+
6+
. development/env.sh
57

68
"${SQLCLI}" sys/${ORACLE_PWD}@//${CONNECTION_STR} AS SYSDBA <<-SQL
79
drop user ${UT3_OWNER} cascade;

development/install.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/usr/bin/env bash
22

3-
cd $(git rev-parse --show-cdup)
3+
#goto git root directory
4+
git rev-parse && cd "$(git rev-parse --show-cdup)"
5+
6+
. development/env.sh
47

5-
development/env.sh
68
development/cleanup.sh
9+
710
.travis/install.sh
811
.travis/install_utplsql_release.sh
912
.travis/create_additional_grants_for_old_tests.sh

development/readme.md

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

development/refresh_sources.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
#goto git root directory
4+
git rev-parse && cd "$(git rev-parse --show-cdup)"
5+
6+
. development/env.sh
7+
8+
# remove sub-direcotry containing master branch shallow copy
9+
rm -rf ${UTPLSQL_DIR:-utPLSQL_latest_release}
10+
# clone utPLSQL master branch from upstream into utPLSQL sub-directory of your project
11+
git clone --depth=1 --branch=${SELFTESTING_BRANCH:-master} https://github.com/utPLSQL/utPLSQL.git ${UTPLSQL_DIR:-utPLSQL_latest_release}
12+
13+
rm -rf utPLSQL-cli/*
14+
# download beta version of utPLSQL-cli
15+
curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-test3.zip
16+
# unzip utPLSQL-cli and remove the zip file
17+
unzip utPLSQL-cli.zip && chmod u+x utPLSQL-cli/bin/utplsql && rm utPLSQL-cli.zip
18+

development/refresh.sh renamed to development/refresh_ut3.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/env bash
22

3-
cd $(git rev-parse --show-cdup)
3+
#goto git root directory
4+
git rev-parse && cd "$(git rev-parse --show-cdup)"
45

5-
development/env.sh
6+
. development/env.sh
67

78
cd source
89

development/template.env.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/usr/bin/env bash
22

3-
export UTPLSQL_DIR="utPLSQL_latest_release"
43
export SQLCLI=sql # For sqlcl client
54
#export SQLCLI=sqlplus # For sqlplus client
65
export CONNECTION_STR=127.0.0.1:1521/xe # Adjust the connect string
76
export ORACLE_PWD=oracle # Adjust your local SYS password
87

9-
8+
export UTPLSQL_DIR="utPLSQL_latest_release"
9+
export SELFTESTING_BRANCH=master
1010
export UT3_OWNER=ut3
1111
export UT3_OWNER_PASSWORD=ut3
1212
export UT3_RELEASE_VERSION_SCHEMA=ut3_latest_release

0 commit comments

Comments
 (0)