“This is the 16th day of my participation in the Gwen Challenge in November. Check out the details: The Last Gwen Challenge in 2021.”
CI
Continuous Integration.CD
A Continuous Deployment B Continuous Deployment
CICD is generally referred to collectively, and there is no need to make a distinction between the two. In the process of development, testing and launching, CICD is used for some automatic processing to ensure project quality.
CICD is integrated with Git as server-side Git hooks: Automatically build, test, deploy, etc., on the build server (CI server, also known as Runner) using WebHooks when code is pushed to a remote repository.
It has several benefits:
- After the functional branch is submitted, automatic test and grammar check will be carried out through CICD. If it fails to pass CICD, CodeReview will not be able to be merged into the production environment branch for online
- After the functional branch is submitted, check the risk of the NPM library through CICD, check the risk of building the mirror container, etc
- After the functional branch is submitted, CICD builds an independent mirror of the current branch code and generates an independent branch environment address for testing, such as
.dev.shanyue
- After passing the functional branch test, it is merged into the main branch, and the image is automatically built and deployed to the build environment (generally, the build environment requires manual triggering and automatic deployment).
Due to the extensive involvement of CICD in recent years, the Workflow of project development is CICD Workflow. See a more complete CICD Workflow.
CICD tools
CICD integrates with CICD tools and code hosting services. CICD can also sometimes be understood as a build server for CICD, and services that provide CICD, such as the following products, will provide build services integrated with Github/GitLab.
jenkins
Travis CI
If your company doesn’t have the CICD infrastructure, you can try Github’s free CICD service, Github Actions.
Companies generally use GitLab CI as CICD tool, and at this time, they need to build gitLab Runner as the build server.
A simple CICD configuration
Each CICD product has its own configuration, but overall usage is similar. The following CI scripts refer to automatic deployment when there is a code change at master.
deploy:
stage: deploy
only:
- master
script:
- docker build -t harbor.shanyue.tech/fe/devtools-app
- docker push harbor.shanyue.tech/fe/devtools-app
- helm upgrade -install devtools-app-chart .
Copy the code