diff --git a/docs/upload.md b/docs/upload.md index d18f2a6..751f9f3 100644 --- a/docs/upload.md +++ b/docs/upload.md @@ -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. diff --git a/lib/commands/upload.js b/lib/commands/upload.js index fa8176e..c1262e7 100644 --- a/lib/commands/upload.js +++ b/lib/commands/upload.js @@ -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}`, diff --git a/lib/util/util.js b/lib/util/util.js index c56a6ca..cdb8752 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -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', @@ -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; }