Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating documentation for CircleCI 2.0 #491

Merged
merged 2 commits into from
Mar 8, 2018

Conversation

ashleytqy
Copy link
Contributor

@ashleytqy ashleytqy commented Mar 8, 2018

Motivation

To fix issue #483 – updating documentation to use CircleCI 2.0.

Changes made:

  • Make it explicit that the example is for Circle CI 2.0
  • Add a sample YAML text for people to copy into their .circleci/config.yml. I find this useful as someone who isn't very familiar with CircleCI because the previous documentation wasn't very explicit as to how the whole file should look like, so it would be nice to be able to copy and paste a sample / default config file.

Let me know if this looks right!

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

N/A. No code changes, only documentation.

Related PRs

N/A

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Mar 8, 2018
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Contributor

@JoelMarcey JoelMarcey left a comment

Choose a reason for hiding this comment

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

Thanks @ashleytqy for writing this up. I have a few suggestions that I think will make things more clear. If you agree, do you mind making those changes?


If you're already using Circle CI for your project, all you need to do to enable automatic deployments is to configure Circle to run the `publish-gh-pages` script as part of the deployment step.

If not, here's how to setup Circle CI for your project:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we want people to run through these steps, even if they are already using CircleCI for their main open source project. I made a suggested change to the above text to make that clearer.

@@ -73,36 +73,42 @@ However, you can automate the publishing process with continuous integration (CI

Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the `publish-gh-pages` script whenever your docs get updated. In the following section we'll be covering how to do just that using [Circle CI](https://circleci.com/), a popular continuous integration service provider.

### Using Circle CI
### Using Circle CI 2.0

If you're already using Circle CI for your project, all you need to do to enable automatic deployments is to configure Circle to run the `publish-gh-pages` script as part of the deployment step.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we change this to:

"If you haven't done so already, you can setup CircleCI for your open source project. Afterwards, in order to enable automatic deployment of your site and documentation via CircleCI, just configure Circle to run the publish-gh-pages script as part of the deployment step. You can follow the steps below to get that setup."

1. Open your Circle CI dashboard, and navigate to the Settings page for your repository, then select "Environment variables". The URL looks like https://circleci.com/gh/ORG/REPO/edit#env-vars, where "ORG/REPO" should be replaced with your own GitHub org/repo.
1. Create a new environment variable named "GITHUB_TOKEN", using your newly generated access token as the value.
1. Open your `circle.yml` file and add the following under the `machine:` section to tell Circle to use relatively recent versions of node and npm, replacing npm with yarn if applicable:
2. Log into GitHub as the `GIT_USER`.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can keep the numbering for each line to 1. since markdown automatically increments the number depending on how many are in the list. That keeps us from having to manually renumber.

```yml
version: 2
jobs:
build:
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe build should be called deploy-website ?

version: 2
build_and_deploy:
jobs:
- build
Copy link
Contributor

Choose a reason for hiding this comment

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

If you make that change above, this would be deploy-website too.

version: 2
build_and_deploy:
jobs:
- build
```

Make sure to replace `<GIT_USER>` with the actual username of the GitHub account that will be used to publish the documentation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this sentence should be:

"Make sure to replace all <....> in the command: sequence with appropriate values. For <GIT_USER>, it should be a GitHub account that has access to push documentation to your GitHub repo. Many times <GIT_USER> and <GITHUB_USERNAME> will be the same."

@ashleytqy ashleytqy force-pushed the ash.circleci2-docs branch from e59a6b3 to bf5e7fd Compare March 8, 2018 20:36
Copy link
Contributor

@JoelMarcey JoelMarcey left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks @ashleytqy

@JoelMarcey JoelMarcey merged commit 7647ba3 into facebook:master Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants