Skip to content

Commit

Permalink
feat: Update node version to the latest and add parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
roni-castro committed Jan 16, 2020
1 parent 9522fe8 commit 073689c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 8 additions & 2 deletions src/commands/setup_macos_executor.yml
Original file line number Diff line number Diff line change
@@ -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@<<parameters.node_version>>/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
Expand All @@ -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@<<parameters.node_version>> >/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
Expand Down
4 changes: 3 additions & 1 deletion src/examples/full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/executors/linux_js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion src/jobs/ios_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -69,7 +74,8 @@ steps:
steps:
- attach_workspace:
at: <<parameters.workspace_root>>
- setup_macos_executor
- setup_macos_executor:
node_version: <<parameters.node_version>>
- ios_simulator_start:
device: <<parameters.device>>
- yarn_install
Expand Down

0 comments on commit 073689c

Please sign in to comment.