CI/CD
Continuous Integration and Continuous Delivery/Deployment is an important part of DevOps, where a standard mode of operations are automated in a pipeline frequently, and reliably.
This process is usually integrated with a version control platform like Github and Gitlab. Both popular platforms provide in-built CI/CD automation called Github Actions and Gitlab-CI. They are largely free, with some paid add-on tools. Other popular ones include CircleCI and TravisCI.
Gitlab-CI
Basics
Gitlab CI is run by "runners", which are essentially google servers spun up when a job is activated. A series of jobs make up a pipeline, while certain jobs of a specific attribute are assigned to a stage. By default, all jobs in a stage needs to finish before the next stage's jobs starts.
A typical pipeline workflow consists of the various stages.
- Test: security scans, unit-tests, integration tests
- Build: building a docker image
- Deploy: deployment of image to dev/staging/production
Yaml File
Gitlab-CI will auto run if a file called .gitlab-ci.yml
is stored in the root of the repository. Inside the ymal file, containing mostly shell commands that tells runner what to execute. It can also refer to scripts stored in the repo so as to keep the ymal file short and concise.
Github Actions
Yaml File
Github Actions will auto run if one or more ymal file is located in the folder .github/workflows/
.