CI/CD
Last updated
Was this helpful?
Last updated
Was this helpful?
The first thing we're going to do is automating the tests. The CI will run the backend
and frontend
tests for each commit pushed.
Later, we will also automate the deployment of the app when we push to the master
branch.
The end goal is to automate the pipeline from commit to deploy.
Create a folder named .circleci
and add a fileconfig.yml
.
Populate the config.yml
with the contents of the sample .yml
bellow.
Change "test": "echo \"Error: no test specified\" && exit 1"
to "test": "jest"
in packages/api
.
Commit and push up to GitHub
Go to CircleCI and watch your build.
When tests are broken, CircleCI will let you know:
We can also see the build status on the commits:
Locally, we are reading the .env
file. But this file is not committed to the repo. We have to setup the environment variables on CircleCI.
Go to the project's settings by clicking on the cog next to the project name:
Scroll down to BUILD SETTINGS
and click Environment Variables
then Add Variable
.
Add the variables from the .env
file:
The tests should now be passing:
is a popular platform offering CI in the cloud. You get one container for free. Let's get started: