Skip to content

Commit

Permalink
OraOpenSource#354 Oracle Wallet support for apex-nitro upload
Browse files Browse the repository at this point in the history
  • Loading branch information
martindsouza committed Jan 9, 2021
1 parent 551557c commit 6fa0680
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
15 changes: 8 additions & 7 deletions docs/upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ apex-nitro upload

The files will be uploaded and stored according to your `apexnitro.config.json` properties.

| Property | Description | Default |
| ----------------------- | ---------------------------------------------------------------------------- | ------------- |
| upload.destination | Destination for your files when uploading them to the APEX Shared Components | `application` |
| upload.path | Path to the binary files of SQLcl. | `sql` |
| upload.username | User to your APEX parsing schema. |
| upload.password | (Optional) Password to your APEX parsing schema. |
| upload.connectionString | Connection string to your APEX parsing schema. |
| Property | Description | Default |
| ----------------------- | -------------------------------------------------------------------------------- | ------------- |
| upload.tns_admin | Path to TNS_ADMIN directory. Required when connecting to Oracle Cloud for wallet | |
| upload.destination | Destination for your files when uploading them to the APEX Shared Components | `application` |
| upload.path | Path to the binary files of SQLcl. | `sql` |
| upload.username | User to your APEX parsing schema. |
| upload.password | (Optional) Password to your APEX parsing schema. |
| upload.connectionString | Connection string to your APEX parsing schema. |

Note: `apex-nitro upload` is optional as you might want to put the files on a web server rather than the Shared Components.

Expand Down
5 changes: 5 additions & 0 deletions lib/commands/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ module.exports = function () {
// Compile and upload files
const launchUpload = async function () {
const upload = function () {
// #354 Support for Oracle Cloud Wallet
if (config.upload.hasOwnProperty('tns_admin')){
process.env['TNS_ADMIN'] = config.upload.tns_admin;
}

uploader.publish({
sqlclPath: config.upload.path,
connectString: `${config.upload.username}/${config.upload.password}@${config.upload.connectionString}`,
Expand Down
5 changes: 5 additions & 0 deletions lib/util/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = {
fs.writeFileSync(
path.resolve(process.cwd(), 'apexnitro.cred.json'),
JSON.stringify({
tns_admin: 'path/to/oracle/wallet/for.oracle.cloud.connections',
path: 'sql',
username: 'your_username',
password: 'your_password',
Expand All @@ -33,6 +34,10 @@ module.exports = {
}
}

if (cred.tns_admin) {
config.upload.tns_admin = cred.tns_admin;
}

if (cred.path) {
config.upload.path = cred.path;
}
Expand Down

0 comments on commit 6fa0680

Please sign in to comment.