Skip to content

Commit d87c6f2

Browse files
authored
feat(appflow): add flag for skipping artifact download after builds succeed (#4678)
1 parent 5ca557b commit d87c6f2

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

packages/@ionic/cli/src/commands/deploy/build.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ export class BuildCommand extends Command {
4848
groups: [MetadataGroup.PAID],
4949
summary: 'Create a deploy build on Appflow',
5050
description: `
51-
This command creates a deploy build on Ionic Appflow. While the build is running, it prints the remote build log to the terminal. If the build is successful, it downloads the created web build zip file in the current directory.
51+
This command creates a deploy build on Ionic Appflow. While the build is running, it prints the remote build log to the terminal. If the build is successful, it downloads the created web build zip file in the current directory. Downloading build artifacts can be skipped by supplying the flag ${input('skip-download')}.
52+
53+
Apart from ${input('--commit')}, every option can be specified using the full name setup within the Appflow Dashboard[^dashboard].
5254
5355
Customizing the build:
5456
- The ${input('--environment')} and ${input('--channel')} options can be used to customize the groups of values exposed to the build.
55-
56-
Apart from ${input('--commit')}, every option can be specified using the full name setup within the Appflow Dashboard[^dashboard].
5757
`,
5858
footnotes: [
5959
{
@@ -66,6 +66,7 @@ Apart from ${input('--commit')}, every option can be specified using the full na
6666
'--environment="My Custom Environment Name"',
6767
'--commit=2345cd3305a1cf94de34e93b73a932f25baac77c',
6868
'--channel="Master"',
69+
'--channel="Master" --skip-download',
6970
'--channel="Master" --channel="My Custom Channel"',
7071
],
7172
options: [
@@ -88,6 +89,13 @@ Apart from ${input('--commit')}, every option can be specified using the full na
8889
groups: [MetadataGroup.ADVANCED],
8990
spec: { value: 'sha1' },
9091
},
92+
{
93+
name: 'skip-download',
94+
summary: `Skip downloading build artifacts after command succeeds.`,
95+
type: Boolean,
96+
spec: { value: 'name' },
97+
default: false,
98+
},
9199
],
92100
};
93101
}
@@ -126,6 +134,10 @@ Apart from ${input('--commit')}, every option can be specified using the full na
126134
throw new Error(`Build ${build.state}`);
127135
}
128136

137+
if (options['skip-download']) {
138+
return;
139+
}
140+
129141
const url = await this.getDownloadUrl(appflowId, buildId, token);
130142

131143
if (!url.url) {

packages/@ionic/cli/src/commands/package/build.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class BuildCommand extends Command {
7171
groups: [MetadataGroup.PAID],
7272
summary: 'Create a package build on Appflow',
7373
description: `
74-
This command creates a package build on Ionic Appflow. While the build is running, it prints the remote build log to the terminal. If the build is successful, it downloads the created app package file in the current directory.
74+
This command creates a package build on Ionic Appflow. While the build is running, it prints the remote build log to the terminal. If the build is successful, it downloads the created app package file in the current directory. Downloading build artifacts can be skipped by supplying the flag ${input('skip-download')}.
7575
7676
Apart from ${input('--commit')}, every option can be specified using the full name setup within the Dashboard[^dashboard].
7777
@@ -104,6 +104,7 @@ if you do not wish to download ${input('apk')}.
104104
'android debug --native-config="My Custom Native Config Name"',
105105
'android debug --commit=2345cd3305a1cf94de34e93b73a932f25baac77c',
106106
'android debug --artifact-type=aab',
107+
'android debug --skip-download',
107108
'android debug --aab-name="my-app-prod.aab" --apk-name="my-app-prod.apk"',
108109
'ios development --signing-certificate="iOS Signing Certificate Name" --build-stack="iOS - Xcode 9"',
109110
'ios development --signing-certificate="iOS Signing Certificate Name" --ipa-name=my_custom_file_name.ipa',
@@ -201,6 +202,13 @@ if you do not wish to download ${input('apk')}.
201202
type: String,
202203
spec: { value: 'name' },
203204
},
205+
{
206+
name: 'skip-download',
207+
summary: `Skip downloading build artifacts after command succeeds.`,
208+
type: Boolean,
209+
spec: { value: 'name' },
210+
default: false,
211+
},
204212
],
205213
};
206214
}
@@ -332,6 +340,10 @@ if you do not wish to download ${input('apk')}.
332340
throw new Error(`Build ${build.state}`);
333341
}
334342

343+
if (options['skip-download']) {
344+
return;
345+
}
346+
335347
const availableArtifactTypes = build.artifacts.map((artifact) => artifact.artifact_type);
336348

337349
if (Array.isArray(options['artifact-type'])) {

0 commit comments

Comments
 (0)