Skip to content

Commit a600e9b

Browse files
committed
docs(deploy-tooling): port README credentials docs and CLI test from PR #3384
- Add Credentials section to README explaining env: variable requirement - Update --username/--password CLI option descriptions in deploy and undeploy tables - Add cliCmdWithBasicAuth test case to CLI integration tests
1 parent f8d81f7 commit a600e9b

2 files changed

Lines changed: 38 additions & 4 deletions

File tree

packages/deploy-tooling/README.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,31 @@ This is the minimal custom task configuration for deployment using package `$TMP
7272
- /test/
7373
```
7474
75+
#### Credentials
76+
77+
You can provide credentials for the ABAP system using environment variables. The credentials are required for authentication against the ABAP system. Plain text credentials are not supported, use environment variables instead.
78+
79+
```yaml
80+
- name: abap-deploy-task
81+
configuration:
82+
credentials:
83+
username: env:XYZ_USER
84+
password: env:XYZ_PASSWORD
85+
app:
86+
name: Z_TEST
87+
package: $TMP
88+
target:
89+
url: https://target.example
90+
exclude:
91+
- /test/
92+
```
93+
Create an `.env` file in the root of your project with the following content:
94+
95+
```
96+
XYZ_USER=your-username
97+
XYZ_PASSWORD=your-password
98+
```
99+
75100
#### Configuration with logging enabled
76101
Set the level of detail for log messages, default is `Info`;
77102
```json
@@ -129,8 +154,8 @@ Options:
129154
--cloud target is an ABAP Cloud system
130155
--cloud-service-key <file-location> JSON file location with the ABAP cloud service key.
131156
--cloud-service-env Load ABAP cloud service properties from either a .env file or your environment variables. Secrets in your .env should not be committed to source control.
132-
--username ABAP Service username
133-
--password ABAP Service password
157+
--username ABAP Service username, plain text credentials are not supported, use environment variables
158+
--password ABAP Service password, plain text credentials are not supported, use environment variables
134159
--authentication-type Authentication type for the app (e.g. 'basic', 'reentranceTicket'). Required for 'reentranceTicket'.
135160
--create-transport Create a transport request during deployment/undeployment
136161
--transport <transport-request> Transport number to record the change in the ABAP system
@@ -206,8 +231,8 @@ Options:
206231
--cloud target is an ABAP Cloud system
207232
--cloud-service-key <file-location> JSON file location with the ABAP cloud service key.
208233
--cloud-service-env Load ABAP cloud service properties from either a .env file or your environment variables
209-
--username ABAP Service username
210-
--password ABAP Service password
234+
--username ABAP Service username, plain text credentials are not supported, use environment variables
235+
--password ABAP Service password, plain text credentials are not supported, use environment variables
211236
--authentication-type Authentication type for the app (e.g. 'basic', 'reentranceTicket'). Required for 'reentranceTicket'.
212237
--transport <transport-request> Transport number to record the change in the ABAP system
213238
--create-transport Create a transport request during deployment

packages/deploy-tooling/test/unit/cli/index.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ describe('cli', () => {
8181
const cliCmdWithUaa = [...cliCmd, '--cloud-service-env', '--service', '/bc/my/uaa/deploy/service'];
8282
const cliCmdWithAuthType = [...cliCmd, '--authentication-type', 'reentranceTicket'];
8383
const cliCmdWithConnectPath = [...cliCmd, '--connect-path', '/my/connect/path'];
84+
const cliCmdWithBasicAuth = [...cliCmd, '--username', 'env:username', '--password', 'env:password'];
8485

8586
test.each([
8687
{
@@ -127,11 +128,19 @@ describe('cli', () => {
127128
writeFileSyncCalled: 0,
128129
deployFn: mockedUi5RepoService.deploy,
129130
object: { connectPath: '/my/connect/path' }
131+
},
132+
{
133+
params: cliCmdWithBasicAuth,
134+
writeFileSyncCalled: 0,
135+
deployFn: mockedUi5RepoService.deploy,
136+
object: { retry: false, strictSsl: false }
130137
}
131138
])(
132139
'successful deploy with different options %s',
133140
async ({ params, writeFileSyncCalled, object, provider, deployFn }) => {
134141
process.argv = params;
142+
delete process.env.username;
143+
delete process.env.password;
135144
await runDeploy();
136145
expect(deployFn).toHaveBeenCalled();
137146
if (provider) {

0 commit comments

Comments
 (0)