From 0ff6621d7a91c3ac65e065c4fdbf695d58868202 Mon Sep 17 00:00:00 2001 From: Daniel Dimitrov Date: Sat, 4 Jan 2020 12:45:55 +0100 Subject: [PATCH] feat: Add `on_after_initialize` parameter to the jobs (#26 by @compojoom) This allows commands to be run after `yarn install` is run. --- src/jobs/android_build.yml | 10 ++++++++++ src/jobs/android_test.yml | 14 ++++++++++++++ src/jobs/ios_build.yml | 10 ++++++++++ src/jobs/ios_build_and_test.yml | 10 ++++++++++ 4 files changed, 44 insertions(+) diff --git a/src/jobs/android_build.yml b/src/jobs/android_build.yml index f5d9679..4ecbef6 100644 --- a/src/jobs/android_build.yml +++ b/src/jobs/android_build.yml @@ -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: @@ -45,6 +49,12 @@ steps: - attach_workspace: at: <> - yarn_install + - when: + condition: <> + steps: + - run: + name: "on_after_initialize" + command: <> - android_build: project_path: <> build_type: <> diff --git a/src/jobs/android_test.yml b/src/jobs/android_test.yml index 4a4e06d..98d2dd0 100644 --- a/src/jobs/android_test.yml +++ b/src/jobs/android_test.yml @@ -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: <> - setup_macos_executor - yarn_install + - when: + condition: <> + steps: + - run: + name: "on_after_initialize" + command: <> - when: condition: <> steps: diff --git a/src/jobs/ios_build.yml b/src/jobs/ios_build.yml index a3f1ec9..e6d92dd 100644 --- a/src/jobs/ios_build.yml +++ b/src/jobs/ios_build.yml @@ -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: @@ -57,6 +61,12 @@ steps: at: <> - setup_macos_executor - yarn_install + - when: + condition: <> + steps: + - run: + name: "on_after_initialize_command by user" + command: <> - when: condition: <> steps: diff --git a/src/jobs/ios_build_and_test.yml b/src/jobs/ios_build_and_test.yml index 97daf20..11e9b2c 100644 --- a/src/jobs/ios_build_and_test.yml +++ b/src/jobs/ios_build_and_test.yml @@ -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: @@ -69,6 +73,12 @@ steps: - ios_simulator_start: device: <> - yarn_install + - when: + condition: <> + steps: + - run: + name: "on_after_initialize_command by user" + command: <> - when: condition: <> steps: