Skip to content

Commit

Permalink
feat: Add on_after_initialize parameter to the jobs (react-native-c…
Browse files Browse the repository at this point in the history
…ommunity#26 by @compojoom)

This allows commands to be run after `yarn install` is run.
  • Loading branch information
compojoom authored and matt-oakes committed Jan 4, 2020
1 parent 0e1c209 commit 0ff6621
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/jobs/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ parameters:
description: The build type to build. This is normally either "debug" or "release" but you may have custom build types configured for your app.
type: string
default: "debug"
on_after_initialize:
description: A custom command to run right after yarn install.
type: string
default: ""

steps:
- when:
Expand All @@ -45,6 +49,12 @@ steps:
- attach_workspace:
at: <<parameters.workspace_root>>
- yarn_install
- when:
condition: <<parameters.on_after_initialize>>
steps:
- run:
name: "on_after_initialize"
command: <<parameters.on_after_initialize>>
- android_build:
project_path: <<parameters.project_path>>
build_type: <<parameters.build_type>>
Expand Down
14 changes: 14 additions & 0 deletions src/jobs/android_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,26 @@ parameters:
type: enum
enum: ["fatal", "error", "warn", "info", "verbose", "trace"]
default: warn
on_after_initialize:
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
type: boolean
default: false
on_after_initialize:
description: A custom command to run right after yarn install.
type: string
default: ""

steps:
- attach_workspace:
at: <<parameters.workspace_root>>
- setup_macos_executor
- yarn_install
- when:
condition: <<parameters.on_after_initialize>>
steps:
- run:
name: "on_after_initialize"
command: <<parameters.on_after_initialize>>
- when:
condition: <<parameters.start_metro>>
steps:
Expand Down
10 changes: 10 additions & 0 deletions src/jobs/ios_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ parameters:
scheme:
description: The scheme to use.
type: string
on_after_initialize:
description: A custom command to run right after yarn install.
type: string
default: ""

steps:
- when:
Expand All @@ -57,6 +61,12 @@ steps:
at: <<parameters.workspace_root>>
- setup_macos_executor
- yarn_install
- when:
condition: <<parameters.on_after_initialize>>
steps:
- run:
name: "on_after_initialize_command by user"
command: <<parameters.on_after_initialize_command>>
- when:
condition: <<parameters.start_metro>>
steps:
Expand Down
10 changes: 10 additions & 0 deletions src/jobs/ios_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ parameters:
type: enum
enum: ["fatal", "error", "warn", "info", "verbose", "trace"]
default: warn
on_after_initialize:
description: A custom command to run right after yarn install.
type: string
default: ""

steps:
- when:
Expand All @@ -69,6 +73,12 @@ steps:
- ios_simulator_start:
device: <<parameters.device>>
- yarn_install
- when:
condition: <<parameters.on_after_initialize>>
steps:
- run:
name: "on_after_initialize_command by user"
command: <<parameters.on_after_initialize_command>>
- when:
condition: <<parameters.start_metro>>
steps:
Expand Down

0 comments on commit 0ff6621

Please sign in to comment.