Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/slas-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiaslohr authored Sep 2, 2022
2 parents 486a3d7 + 64a8610 commit 52fe711
Show file tree
Hide file tree
Showing 13 changed files with 368 additions and 223 deletions.
52 changes: 52 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Bug Report
description: File a bug report
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Please provide details on how to reproduce your bug. If possible provide as much information in the fields below regarding your environment and versions.
- type: input
id: version
attributes:
label: sfcc-ci Version
description: Run `sfcc-ci --version`
placeholder: x.x.x
validations:
required: false
- type: input
id: nodeversion
attributes:
label: NodeJS Version
description: Run `node --version`
placeholder: x.x.x
validations:
required: false
- type: input
id: path
attributes:
label: sfcc-ci Path
description: Run `which sfcc-ci` on Mac/Linux or `where sfcc-ci` on Windows
placeholder: /path/to/sfcc-ci
validations:
required: false
- type: textarea
id: hostinfo
attributes:
label: Host OS Details
description: On Mac run `sw_vers` and `uname -a`; on linux `uname -a` and `lsb_release`; Windows `systeminfo` and retrieve the OS Name/Version from the output
validations:
required: false
- type: textarea
id: description
attributes:
label: Description
description: Please describe your issue
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant output from the command. If possible use `sfcc-ci -D` for additional debug output. This will be automatically formatted into code, so no need for backticks.
render: shell
52 changes: 52 additions & 0 deletions .github/ISSUE_TEMPLATE/HELP_WANTED.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Help Wanted
description: Request help with using sfcc-ci
labels: ["help wanted"]
body:
- type: markdown
attributes:
value: |
Please provide details of your issue. If possible provide as much information in the fields below regarding your environment and versions
- type: input
id: version
attributes:
label: sfcc-ci Version
description: Run `sfcc-ci --version`
placeholder: x.x.x
validations:
required: false
- type: input
id: nodeversion
attributes:
label: NodeJS Version
description: Run `node --version`
placeholder: x.x.x
validations:
required: false
- type: input
id: path
attributes:
label: sfcc-ci Path
description: Run `which sfcc-ci` on Mac/Linux or `where sfcc-ci` on Windows
placeholder: /path/to/sfcc-ci
validations:
required: false
- type: textarea
id: hostinfo
attributes:
label: Host OS Details
description: On Mac run `sw_vers` and `uname -a`; on linux `uname -a` and `lsb_release`; Windows `systeminfo` and retrieve the OS Name/Version from the output
validations:
required: false
- type: textarea
id: description
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant output from the command. If possible use `sfcc-ci -D` for additional debug output. This will be automatically formatted into code, so no need for backticks.
render: shell
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: 'Unofficial Commerce Cloud Slack: #sfcc-ci'
url: https://sfcc-unofficial.slack.com/archives/CAUFG3SHF
about: 'Community help can be found on the CC Unofficial Slack (https://github.com/sfcc-unofficial/docs) in the #sfcc-ci channel'
3 changes: 3 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Please provide a description of the feature request or steps to reproduce your issue

For bug reports or help please use the issue templates to provide environment details.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ coverage
dist
node_modules
.*
*.iml
!.github
*.iml
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ Use `sfcc-ci --help` or just `sfcc-ci` to get started and see the full list of c
$SFCC_OAUTH_CLIENT_SECRET client secret used for authentication
$SFCC_OAUTH_USER_NAME user name used for authentication
$SFCC_OAUTH_USER_PASSWORD user password used for authentication
$SFCC_SANDBOX_API_HOST set sandbox API host
$SFCC_SANDBOX_API_HOST set alternative sandbox API host
$SFCC_SANDBOX_API_POLLING_TIMEOUT set timeout for sandbox polling in minutes
$SFCC_SCAPI_SHORTCODE the Salesforce Commerce (Headless) API Shortcode
$SFCC_SCAPI_TENANTID the Salesforce Commerce (Headless) API TenantId
Expand Down Expand Up @@ -399,7 +399,7 @@ The use of environment variables is optional. `sfcc-ci` respects the following e
* `SFCC_OAUTH_CLIENT_SECRET` client secret used for authentication
* `SFCC_OAUTH_USER_NAME` user name used for authentication
* `SFCC_OAUTH_USER_PASSWORD` user password used for authentication
* `SFCC_SANDBOX_API_HOST` set sandbox API host
* `SFCC_SANDBOX_API_HOST` set alternative sandbox API host
* `SFCC_SANDBOX_API_POLLING_TIMEOUT` set timeout for sandbox polling in minutes
* `DEBUG` enable verbose output
Expand Down Expand Up @@ -478,7 +478,7 @@ users:* | Account Administrator role assigned to user _or_ OCAPI Data API Settin
### API Server ###
`sfcc-ci` uses a default host for the sandbox API. You can overwrite this host and use an alternative host using the env var `SFCC_SANDBOX_API_HOST`:
`sfcc-ci` uses a default host for the sandbox API. This is the standard Sandbox API Gateway at admin.dx.commercecloud.salesforce.com. Usually this is fine and you don't need to change this. However, you can overwrite this host and use an alternative host using the env var `SFCC_SANDBOX_API_HOST`:
```bash
export SFCC_SANDBOX_API_HOST=<alternative-sandbox-api-host>
Expand Down
37 changes: 34 additions & 3 deletions bin/test-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,37 @@ else
exit 1
fi

###############################################################################
###### Testing ´sfcc-ci sandbox:ips´
###############################################################################

echo "Testing command ´sfcc-ci sandbox:ips´:"
node ./cli.js sandbox:ips
if [ $? -eq 0 ]; then
echo -e "\t> OK"
else
echo -e "\t> FAILED"
exit 1
fi

echo "Testing command ´sfcc-ci sandbox:ips --realm (expected to fail)´:"
node ./cli.js sandbox:ips --realm
if [ $? -eq 1 ]; then
echo -e "\t> OK"
else
echo -e "\t> FAILED"
exit 1
fi

echo "Testing command ´sfcc-ci sandbox:ips --realm <realm>´:"
node ./cli.js sandbox:ips --realm $ARG_SANDBOX_REALM
if [ $? -eq 0 ]; then
echo -e "\t> OK"
else
echo -e "\t> FAILED"
exit 1
fi

###############################################################################
###### Testing ´sfcc-ci sandbox:list´
###############################################################################
Expand Down Expand Up @@ -1170,7 +1201,7 @@ else
fi

echo "Testing command ´sfcc-ci user:create --login <login>´:"
node ./cli.js user:create --login "$ARG_TEST_USER" --user '{"firstName": "John", "lastName": "Doe"}'
node ./cli.js user:create --org "$ARG_TEST_ORG" --login "$ARG_TEST_USER" --user '{"firstName": "John", "lastName": "Doe"}'
if [ $? -eq 0 ]; then
echo -e "\t> OK"
else
Expand Down Expand Up @@ -1222,8 +1253,8 @@ else
exit 1
fi

echo "Testing command ´sfcc-ci user:delete --login <login>´ with invalid user (expected to fail):"
node ./cli.js user:delete --login does_not_exist
echo "Testing command ´sfcc-ci user:delete --login <login>´ --noprompt with invalid user (expected to fail):"
node ./cli.js user:delete --login does_not_exist --noprompt
if [ $? -eq 1 ]; then
echo -e "\t> OK"
else
Expand Down
16 changes: 12 additions & 4 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,23 @@ program
program
.command('sandbox:ips')
.description('List inbound and outbound IP addresses for sandboxes')
.option('-r, --realm <realm>','Realm to get IP details for')
.option('-j, --json','Formats the output in json')
.action(function(options) {
var realm = ( options.realm ? options.realm : null );
var asJson = ( options.json ? options.json : false );
require('./lib/sandbox').cli.ips(asJson);
require('./lib/sandbox').cli.ips(realm, asJson);
}).on('--help', function() {
console.log('');
console.log(' Details:');
console.log();
console.log(' Use the optional --realm parameter to only retrieve IP addresses relevant for a particular');
console.log(' realm.');
console.log('');
console.log(' Examples:');
console.log();
console.log(' $ sfcc-ci sandbox:ips');
console.log(' $ sfcc-ci sandbox:ips --realm zzzz');
console.log(' $ sfcc-ci sandbox:ips --json');
console.log();
});
Expand Down Expand Up @@ -1819,7 +1827,7 @@ program
console.log(' If an org is passed using -o,--org, the user will be created in the Account Manager');
console.log(' for the passed org. The login (an email) must be unique. After a successful');
console.log(' creation the user will receive a confirmation e-mail with a link to activate his');
console.log(' account. Default roles of the user in Account Manager are "xchange-user" and "doc-user".');
console.log(' account.');
console.log('');
console.log(' Use -i,--instance to create a local user is on the Commerce Cloud instance.');
console.log(' The login must be unique. By default no roles will be assigned to the user on the instance.');
Expand All @@ -1829,7 +1837,7 @@ program
console.log(' Examples:');
console.log();
console.log(' $ sfcc-ci user:create --org my-org --login jdoe@email.org --user \'{"firstName":' +
'"John", "lastName":"Doe", "roles": ["xchange-user"]}\'');
'"John", "lastName":"Doe", "roles": ["controlcenter-user"]}\'');
console.log(' $ sfcc-ci user:create --instance my-instance --login "my-user" --user \'{"email":' +
'"jdoe@email.org", "first_name":"John", "last_name":"Doe", "roles": ["Administrator"]}\'');
console.log();
Expand Down Expand Up @@ -2139,7 +2147,7 @@ program.on('--help', function() {
console.log(' $SFCC_OAUTH_CLIENT_SECRET client secret used for authentication');
console.log(' $SFCC_OAUTH_USER_NAME user name used for authentication');
console.log(' $SFCC_OAUTH_USER_PASSWORD user password used for authentication');
console.log(' $SFCC_SANDBOX_API_HOST set sandbox API host');
console.log(' $SFCC_SANDBOX_API_HOST set alternative sandbox API host');
console.log(' $SFCC_SANDBOX_API_POLLING_TIMEOUT set timeout for sandbox polling in minutes')
console.log(' $SFCC_SCAPI_SHORTCODE the Salesforce Commerce (Headless) API Shortcode');
console.log(' $SFCC_SCAPI_TENANTID the Salesforce Commerce (Headless) API TenantId')
Expand Down
Loading

0 comments on commit 52fe711

Please sign in to comment.