Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Update README to follow Circle CI 2.0 configuration #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 17 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,19 @@ You should now be able to create a new branch, make changes, and open a pull req

#### Add circle.yml to your project

Add the following to your `circle.yml`:
Add the following to your `.circleci/config.yml`:

```yml
dependencies:
override:
- yarn
machine:
node:
version: 6.9
deployment:
appr:
branch: /.*/
commands:
- 'if [ "$CI_PULL_REQUEST" != "" ]; then yarn appr; fi'
version: 2
jobs:
build:
docker:
- image: circleci/node:8

steps:
- checkout
- run: yarn install

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about caching the yarn and maybe add names for the steps?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added minimal steps like it currently is.

- run: 'if [ "$CIRCLE_PULL_REQUEST" != "" ]; then yarn appr; fi'
```

This will configure your Circle build to use the latest Node.js and Yarn (optional), and ensure that the **appr** build only runs on Pull Request builds.
Expand All @@ -174,22 +173,18 @@ This will configure your Circle build to use the latest Node.js and Yarn (option
You may also want to automatically push some target branches, e.g. your `develop` or `master` branches to a release channel to test your integrated code. In that case, you can whitelist the branches to release in your `circle.yml`:

```yml
deployment:
appr:
branch: /.*/
commands:
- 'if [ "$CI_PULL_REQUEST" != "" ] || [ "$CIRCLE_BRANCH" == "master" ]; then yarn appr; fi'
steps:
- checkout
- run: yarn install
- run: 'if [ "$CI_PULL_REQUEST" != "" ] || [ "$CIRCLE_BRANCH" == "master" ]; then yarn appr; fi'
```

#### (Optional) Running tests

Circle CI will automatically run your tests before the deployment. Note that the default `test` command in `create-react-native-app` runs Jest in `--watch` mode, which will hang forever. You can either change the
`test` script in your package.json, or, or override the test command in circle.yml:
Add the followiong line to your `steps` in `.circleci/config.yml`(default `test` command in `create-react-native-app` runs jest).

```yml
test:
override:
- yarn ci-test-command
- run: yarn test
```

#### Enable Circle CI
Expand Down