Skip to content

Commit 3f9d5ca

Browse files
committed
feat: add support for refreshing sandboxes
1 parent 78abcd4 commit 3f9d5ca

File tree

11 files changed

+1010
-27
lines changed

11 files changed

+1010
-27
lines changed

messages/create.sandbox.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Path to a sandbox definition file.
4242

4343
# flags.definitionFile.description
4444

45-
The sandbox definition file is a blueprint for the sandbox. You can create different definition files for each sandbox type that you use in the development process. See <https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_sandbox_definition.htm> for all the options you can specify in the defintion file.
45+
The sandbox definition file is a blueprint for the sandbox. You can create different definition files for each sandbox type that you use in the development process. See <https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_sandbox_definition.htm> for all the options you can specify in the definition file.
4646

4747
# flags.name.summary
4848

messages/refresh.sandbox.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# summary
2+
3+
Refresh (update) a sandbox org by the sandbox name.
4+
5+
# description
6+
7+
Refresh (update) a sandbox org by the sandbox name, using a definition file for any `SandboxInfo` overrides.
8+
9+
Note that changing a sandbox name during a refresh is not allowed. If changing the sandbox name is desired, instead delete the sandbox and recreate it.
10+
11+
# examples
12+
13+
- Refresh the sandbox named "devSbx1". The production org that contains the sandbox license has the alias "prodOrg".
14+
15+
<%= config.bin %> <%= command.id %> -n devSbx1 --target-org prodOrg
16+
17+
- Refresh the sandbox named "devSbx2", overriding the SandboxInfo used when created with the properties in a definition file. The default target org is the production org, so specifying the `--target-org` flag is not necessary in this case.
18+
19+
<%= config.bin %> <%= command.id %> -n devSbx2 -f devSbx2-config.json
20+
21+
- Refresh the sandbox using the name defined in the definition file. The production org that contains the sandbox license has the alias "prodOrg".
22+
23+
<%= config.bin %> <%= command.id %> --definition-file devSbx3-config.json -o prodOrg
24+
25+
# flags.auto-activate.summary
26+
27+
[default: true] Activates the sandbox after successful refresh.
28+
29+
# flags.auto-activate.description
30+
31+
[default: true] Activates the sandbox after successful refresh.
32+
33+
# flags.targetOrg.summary
34+
35+
Username or alias of the production org that contains the sandbox license.
36+
37+
# flags.targetOrg.description
38+
39+
When it refreshes the sandbox org, Salesforce copies the metadata, and optionally data, from your production org to the sandbox org.
40+
41+
# flags.definitionFile.summary
42+
43+
Path to a sandbox definition file used to override the configuration used when created.
44+
45+
# flags.definitionFile.description
46+
47+
The sandbox definition file is a blueprint for the sandbox, and is used to change the configuration during a refresh. If no configuration changes from the sandbox creation are desired then simply target the sandbox org using the `--name` flag. See <https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_sandbox_definition.htm> for all the options you can specify in the definition file.
48+
49+
# flags.name.summary
50+
51+
Name of the existing sandbox org in your production org.
52+
53+
# flags.name.description
54+
55+
Name of the existing sandbox org in your production org.
56+
57+
# flags.wait.summary
58+
59+
Number of minutes to poll for sandbox refresh status.
60+
61+
# flags.wait.description
62+
63+
If the command continues to run after the wait period, the CLI returns control of the terminal to you and displays the "<%= config.bin %> org resume sandbox" command for you run to check the status of the refresh. The displayed command includes the job ID for the running sandbox refresh.
64+
65+
# flags.poll-interval.summary
66+
67+
Number of seconds to wait between status polling requests.
68+
69+
# flags.async.summary
70+
71+
Request the sandbox refresh, but don't wait for it to complete.
72+
73+
# flags.async.description
74+
75+
The command immediately displays the job ID and returns control of the terminal to you. This way, you can continue to use the CLI. To check the status of the sandbox refresh, run "<%= config.bin %> org resume sandbox".
76+
77+
# flags.noPrompt.summary
78+
79+
Don't prompt for confirmation about the sandbox configuration.
80+
81+
# isConfigurationOk
82+
83+
Is the configuration correct?
84+
85+
# error.SandboxNameLength
86+
87+
The sandbox name "%s" should be 10 or fewer characters.
88+
89+
# error.NoSandboxName
90+
91+
Must specify a sandbox name using the `--name` or `--definition-file` flag.
92+
93+
# warning.ConflictingSandboxNames
94+
95+
Different sandbox names were provided with the `--name` ('%s') and `--definition-file` flags ('%s'). Using the value provided by the `--name` flag. If you want to change the name of the sandbox, please delete and create using the new name.
96+
97+
# error.SandboxNotFound
98+
99+
The sandbox name "%s" could not be found in production org "%s".
100+
101+
# error.SandboxNotFound.actions
102+
103+
Ensure the sandbox name and casing is correct.
104+
Ensure the production org for the sandbox is correct.
105+
106+
# error.UserNotSatisfiedWithSandboxConfig
107+
108+
The sandbox request configuration isn't acceptable.
109+
110+
# error.pollIntervalGreaterThanWait
111+
112+
The poll interval (%d seconds) can't be larger that wait (%d in seconds)
113+
114+
# sandboxInfoRefreshFailed
115+
116+
The sandbox org refresh failed with a result of %s.

messages/sandboxbase.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# sandboxSuccess
22

3-
The sandbox org creation was successful.
3+
The sandbox org %s was successful.
44

55
# sandboxSuccess.actions
66

@@ -12,9 +12,9 @@ You can open the org by running "%s org open -o %s"
1212
Run "%s org resume sandbox --job-id %s -o %s" to check for status.
1313
If the org is ready, checking the status also authorizes the org for use with Salesforce CLI.
1414

15-
# warning.ClientTimeoutWaitingForSandboxCreate
15+
# warning.ClientTimeoutWaitingForSandboxProcess
1616

17-
The wait time for the sandbox creation has been exhausted. See the results below for more information.
17+
The wait time for the sandbox %s has been exhausted. See the results below for more information.
1818

1919
# warning.MultipleMatchingSandboxProcesses
2020

src/commands/org/create/sandbox.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ export default class CreateSandbox extends SandboxCommandBase<SandboxProcessObje
201201
alias: this.flags.alias,
202202
setDefault: this.flags['set-default'],
203203
prodOrgUsername: this.flags['target-org'].getUsername() as string,
204+
action: 'Create',
204205
sandboxProcessObject: {
205206
SandboxName: sandboxReq.SandboxName,
206207
},

0 commit comments

Comments
 (0)