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

Set up Commitizen, CircleCI, and semantic-release #50

Merged
merged 18 commits into from
Dec 4, 2018
Merged

Set up Commitizen, CircleCI, and semantic-release #50

merged 18 commits into from
Dec 4, 2018

Conversation

trezy
Copy link
Member

@trezy trezy commented Dec 1, 2018

Summary

I've added several bits of infrastructure to make maintaining the project easier. These improvements include:

  • Commitizen for ensuring useful commit messages
  • CircleCI for automating builds, testing (eventually), and deployments
  • semantic-release for ensuring unromantic, unsentimental version changes with releases

Other requirements

For all of this to work, @BcRikko will need to cover several steps to get everything working.

Required accounts

Setup

  1. Create a new branch called develop
  2. Make sure the repo is set up to be built in CircleCI
  3. Allow the semantic-release-cli to connect to your Github, npm, and CircleCI accounts to set up all of the necessary tokens and environment variables:
    npm install -g semantic-release-cli
    semantic-release-cli setup
    
  4. Merge this branch into develop, push it to the repo, and verify that it causes the build to run in CircleCI
  • It should run the checkout, install-dependencies, lint, and build steps successfully
  1. ???
  2. Profit!

Final notes

If the Setup tasks all worked without issue, then we're good! Everything should be ready to rock. The next step will be to change the destination of this PR from master to develop.

Finally, to create our first release to npm after we've merged this PR, we'll want to perform the following steps:

  1. Change the version in package.json to 1.0.0
  2. Make another commit to develop with a feature type commit
  3. Merge develop into master

This should cause the CI to run through the full gamut of steps, ultimately creating our first release to npm.

This adds a CircleCI config file based on the same config I use for my own website. It makes it easy
to have multiple steps running in parallel, such as running tests and coverage reports.
Forcing contributors to use Commitizen to format their commit messages will make our lives much
simpler, especially once we've added `semantic-release`.
Add `semantic-release` to the repo and the build pipeline. This will handle automatically publishing
to npm based on commit messages.

#13
The Roll For Guild Node container doesn't include `git`, which is required by semantic-release.

#13
I got a bunch of permission errors last time I tried to build in ~/app. I'm pretty sure building in
the default directory should work just as well.
I've removed containers from tthe config entirely because I don't think we need them. Hopefully this
will fix the build. 🤷🏻‍♂️
Switching back to container because I have no idea how to fix the errors that came up without them.
Additionally, I'm changing the working directory to `~/tmp` to see if that works better than the
`~/app` folder.
I think the issue was that the app was being built into the root user's home directory rather than
the `circleci` user's home directory. 🤞
I finally figured it out. Restoring the cache was trying to restore the cache from an older build
that used a different image in which the root user was the one doing all the tasks. I'm pushing a
build that doesn't restore the cache, then I'll add those steps back in after the next build.
By removing strict host key checking for Github, we shouldn't run into the issue where host
authenticity verification stalls the deployment.
Repository cloning in the deploy step was 100% unnecessary.
@BcRikko BcRikko self-requested a review December 1, 2018 22:59
@BcRikko
Copy link
Member

BcRikko commented Dec 2, 2018

Thank you soooo much 🎉

I'll do it 👍

I already have an account of npm 😆
https://www.npmjs.com/package/nes.css

Next, I will sign up for CircleCI ✏️

I've updated the `package.json` so it points back at @BcRikko's repo instead of mine.

#13
@trezy trezy changed the base branch from master to develop December 3, 2018 14:21
@BcRikko BcRikko self-assigned this Dec 4, 2018
@BcRikko BcRikko merged commit 9bcc635 into nostalgic-css:develop Dec 4, 2018
@BcRikko
Copy link
Member

BcRikko commented Dec 4, 2018

Thanks 🙇
I'll start setup CI now 🏃

@BcRikko BcRikko mentioned this pull request Dec 5, 2018
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants