Skip to content

Commit 0ff6621

Browse files
compojoommatt-oakes
authored andcommitted
feat: Add on_after_initialize parameter to the jobs (#26 by @compojoom)
This allows commands to be run after `yarn install` is run.
1 parent 0e1c209 commit 0ff6621

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

src/jobs/android_build.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ parameters:
3333
description: The build type to build. This is normally either "debug" or "release" but you may have custom build types configured for your app.
3434
type: string
3535
default: "debug"
36+
on_after_initialize:
37+
description: A custom command to run right after yarn install.
38+
type: string
39+
default: ""
3640

3741
steps:
3842
- when:
@@ -45,6 +49,12 @@ steps:
4549
- attach_workspace:
4650
at: <<parameters.workspace_root>>
4751
- yarn_install
52+
- when:
53+
condition: <<parameters.on_after_initialize>>
54+
steps:
55+
- run:
56+
name: "on_after_initialize"
57+
command: <<parameters.on_after_initialize>>
4858
- android_build:
4959
project_path: <<parameters.project_path>>
5060
build_type: <<parameters.build_type>>

src/jobs/android_test.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,26 @@ parameters:
3939
type: enum
4040
enum: ["fatal", "error", "warn", "info", "verbose", "trace"]
4141
default: warn
42+
on_after_initialize:
43+
description: Set this to true if you want to run a custom shell command right after yarn install. Provide the command in on_after_initialize_command
44+
type: boolean
45+
default: false
46+
on_after_initialize:
47+
description: A custom command to run right after yarn install.
48+
type: string
49+
default: ""
4250

4351
steps:
4452
- attach_workspace:
4553
at: <<parameters.workspace_root>>
4654
- setup_macos_executor
4755
- yarn_install
56+
- when:
57+
condition: <<parameters.on_after_initialize>>
58+
steps:
59+
- run:
60+
name: "on_after_initialize"
61+
command: <<parameters.on_after_initialize>>
4862
- when:
4963
condition: <<parameters.start_metro>>
5064
steps:

src/jobs/ios_build.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ parameters:
4444
scheme:
4545
description: The scheme to use.
4646
type: string
47+
on_after_initialize:
48+
description: A custom command to run right after yarn install.
49+
type: string
50+
default: ""
4751

4852
steps:
4953
- when:
@@ -57,6 +61,12 @@ steps:
5761
at: <<parameters.workspace_root>>
5862
- setup_macos_executor
5963
- yarn_install
64+
- when:
65+
condition: <<parameters.on_after_initialize>>
66+
steps:
67+
- run:
68+
name: "on_after_initialize_command by user"
69+
command: <<parameters.on_after_initialize_command>>
6070
- when:
6171
condition: <<parameters.start_metro>>
6272
steps:

src/jobs/ios_build_and_test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ parameters:
5454
type: enum
5555
enum: ["fatal", "error", "warn", "info", "verbose", "trace"]
5656
default: warn
57+
on_after_initialize:
58+
description: A custom command to run right after yarn install.
59+
type: string
60+
default: ""
5761

5862
steps:
5963
- when:
@@ -69,6 +73,12 @@ steps:
6973
- ios_simulator_start:
7074
device: <<parameters.device>>
7175
- yarn_install
76+
- when:
77+
condition: <<parameters.on_after_initialize>>
78+
steps:
79+
- run:
80+
name: "on_after_initialize_command by user"
81+
command: <<parameters.on_after_initialize_command>>
7282
- when:
7383
condition: <<parameters.start_metro>>
7484
steps:

0 commit comments

Comments
 (0)