Configure the CI

At Renuo we always use a CI (Continuous Integration) system to test our applications. It's essential to guarantee that all the tests pass before building and releasing a new version through our CD system. Our projects use SemaphoreCI 2.0.

Before configuring the CI, you should already have a Git Repository with the code, a bin/check command to execute, and the main branches already pushed and ready to be tested.

  1. Proceed to https://renuo.semaphoreci.com/ and login through GitHub with [email protected] (1Password)
  2. Follow these instructions to install semaphore CLI https://docs.semaphoreci.com/reference/sem-command-line-tool/
  3. Create a project here: https://renuo.semaphoreci.com/new_project
  4. Go to the project's artifact settings: Settings > Artifacts
  5. Set the retention policy for project, workflow and job artifacts to /**/* and 2 weeks

Rails specific configuration

renuo configure-semaphore

The command will copy the necessary templates to .semaphore folder using the renuo-cli. These files need to be maintained on the renuo-cli repository.

  1. Add a file called .nvmrc to the project root, where you specify the latest node version
  2. Commit the files to both branches, push and watch the CI run.

When all builds are green, then you have properly configured your CI and CD.

semaphoreci_2

You should now see a third block where your deployment runs to Heroku. Make sure it is green and deploys correctly:

semaphoreci_2

Conclusion

You have now your application running on all the environments. From now on, all the changes you will push on develop or main branches in GitHub will be automatically deployed to the related server.

It's time to create some first Pull Requests with some improvements.

Don't forget to go back to the GitHub settings and add the CI to the required checks!