From 073689ce7dec4e34db20058d755cfd30f415f532 Mon Sep 17 00:00:00 2001 From: Roni Date: Wed, 15 Jan 2020 23:39:03 -0300 Subject: [PATCH] feat: Update node version to the latest and add parameters --- .circleci/config.yml | 2 +- src/commands/setup_macos_executor.yml | 10 ++++++++-- src/examples/full.yml | 4 +++- src/executors/linux_js.yml | 2 +- src/jobs/ios_build_and_test.yml | 8 +++++++- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2e91d46..8dc36bb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,7 +22,7 @@ jobs: publish: docker: - - image: circleci/node:8 + - image: circleci/node:latest environment: - PATH: '~/bin:/opt/yarn/yarn-v1.5.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' steps: diff --git a/src/commands/setup_macos_executor.yml b/src/commands/setup_macos_executor.yml index b75ef09..05e1d88 100644 --- a/src/commands/setup_macos_executor.yml +++ b/src/commands/setup_macos_executor.yml @@ -1,10 +1,16 @@ description: Installs the required packages to build and test Android and iOS applications on the MacOS executor. You need to run this before running any other command on those executors. +parameters: + node_version: + description: The version of Node to use. This can be either a major version ("8"), a major and minor ("8.4"), or a fully qualified version ("8.4.1"). + type: string + default: 'latest' + steps: - run: name: Configure Environment Variables command: | - echo 'export PATH="$PATH:/usr/local/opt/node@8/bin:~/.yarn/bin:~/project/node_modules/.bin:~/project/example/node_modules/.bin"' >> $BASH_ENV + echo 'export PATH="$PATH:/usr/local/opt/node@<>/bin:~/.yarn/bin:~/project/node_modules/.bin:~/project/example/node_modules/.bin"' >> $BASH_ENV echo 'export ANDROID_HOME="/usr/local/share/android-sdk"' >> $BASH_ENV echo 'export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"' >> $BASH_ENV echo 'export PATH="$ANDROID_SDK_ROOT/emulator:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH"' >> $BASH_ENV @@ -21,7 +27,7 @@ steps: command: | HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null HOMEBREW_NO_AUTO_UPDATE=1 brew tap homebrew/cask >/dev/null - HOMEBREW_NO_AUTO_UPDATE=1 brew install node@8 >/dev/null + HOMEBREW_NO_AUTO_UPDATE=1 brew install node@<> >/dev/null HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null HOMEBREW_NO_AUTO_UPDATE=1 brew cask install android-sdk >/dev/null touch .watchmanconfig diff --git a/src/examples/full.yml b/src/examples/full.yml index 9a0acab..5f91f0a 100644 --- a/src/examples/full.yml +++ b/src/examples/full.yml @@ -10,7 +10,9 @@ usage: # Custom jobs which are not part of the Orb jobs: checkout_code: - executor: rn/linux_js + executor: + name: rn/linux_js + node_version: 'latest' steps: - checkout - persist_to_workspace: diff --git a/src/executors/linux_js.yml b/src/executors/linux_js.yml index 6f8deee..ba4130d 100644 --- a/src/executors/linux_js.yml +++ b/src/executors/linux_js.yml @@ -2,7 +2,7 @@ parameters: node_version: description: The version of Node to use. This can be either a major version ("8"), a major and minor ("8.4"), or a fully qualified version ("8.4.1"). type: string - default: '8' + default: 'latest' resource_class: description: Changes the resource class of the executor. Requires a support request to enable the resource_class parameter. See https://circleci.com/docs/2.0/configuration-reference/#resource_class type: string diff --git a/src/jobs/ios_build_and_test.yml b/src/jobs/ios_build_and_test.yml index be94090..1ec05b6 100644 --- a/src/jobs/ios_build_and_test.yml +++ b/src/jobs/ios_build_and_test.yml @@ -58,6 +58,11 @@ parameters: description: A custom command to run right after yarn install. type: string default: "" + # For macos executor + node_version: + description: The version of Node to use. This can be either a major version ("8"), a major and minor ("8.4"), or a fully qualified version ("8.4.1"). + type: string + default: 'latest' steps: - when: @@ -69,7 +74,8 @@ steps: steps: - attach_workspace: at: <> - - setup_macos_executor + - setup_macos_executor: + node_version: <> - ios_simulator_start: device: <> - yarn_install