SalesforceCommerceCloud / sfcc-ci

Salesforce Commerce Cloud CLI
https://npmjs.com/package/sfcc-ci
BSD 3-Clause "New" or "Revised" License
230 stars 92 forks source link

sandbox:create with sync return 2 json objects #188

Open osapishchuk opened 3 years ago

osapishchuk commented 3 years ago

Hi sfcc-ci team,

sfcc-ci sandbox:create --realm bdtw -s -j

returning 2 almost identical JSON objects (instead of one) and only time in milliseconds is different there. Example:

...finished (314646 ms). Sandbox id is ...
...finished (318858 ms). Sandbox id is ...

Because of this issue, commands (bellow) are not working, as SANDBOX_HOST now is 2 values in different rows with the same value:

SANDBOX=`sfcc-ci sandbox:create <a-realm> -s -j`
SANDBOX_HOST=`$SANDBOX | jq '.instance.host' -r`
sfcc-ci code:deploy <path/to/code.zip> -i $SANDBOX_HOST
sfcc-ci instance:upload <path/to/data.zip> -i $SANDBOX_HOST -s
sfcc-ci instance:import <data.zip> -i your-instance.demandware.net

Visual evidence: image

Based on the slack discussion steps to reproduce is to use -s parameter.

There is a workaround for me to use in the Docker as following: image and to run the jobs after I just read the first row: image

but that would be great to have this issue fixed as well :)

Regards, Oleg

osapishchuk commented 3 years ago

As a workaround @EvilJordan also suggested to use sfcc-ci sandbox:create --sync --json | jq -s -r '.[0]' while fix is not in place as of yet.

🌮 for that 🥇