February 14, 2024

CI/CD and Delivery with GitLab

What is a good engineer?
How good is your team?
How does the environment affect the team?

Collaborating and Teamwork:

I believe the environment can affect the development and delivery process. And code env can effect on efficiency.

Why is CI/CD Like the Culture of Your Code?

CI/CD (Continuous Integration/Continuous Deployment) is often compared to the culture of your code because it represents a set of practices and values that shape how code is developed, tested, and deployed.
Just as culture influences behavior and attitudes, CI/CD influences the workflow and quality of software development. It encourages frequent integration, automated testing, and consistent deployment, fostering a culture of collaboration, efficiency, and quality.

CI/CD workflow

The Journey of CI/CD:

From Development to User

  1. Write the Code:

    • Developers write new code or modify existing code to add features, fix bugs, or improve performance.
  2. Test It:

    • Linting: Automated tools check the code for syntax errors and adherence to coding standards.
    • Unit Tests: Automated tests verify the functionality of individual components or units of the code.
    • Code Review: Peers review the code for quality, readability, and adherence to best practices.
  3. Build:

    • The code is compiled or packaged into a build that can be deployed to a testing or production environment.
  4. Review:

    • End-to-End (E2E) Tests: Automated tests simulate user scenarios to ensure the application works as expected from start to finish.
  5. Deploy:

    • The build is deployed to a production environment, making the new features or fixes available to users.
  6. Manual Test:

    • Manual testing may be performed as a final check to ensure that the application behaves as expected in the live environment.

CI/CD Pipeline in Detail by Features

1. Source Stage: Compilation, Dependency Management
   - Code standards evolution
   - Pipelines run on commit/PR
   - Code version control

2. Build Stage:
   - Compiling source code
   - Running unit tests

3. Test Stage: Unit Testing, Integration Testing, Static Code Analysis
   - Performance and security testing
   - End-to-end (e2e) testing
   - Integration testing

4. Deploy Stage:
   - Deployment to production server
   - Fully automated
   - Smoke testing

and more as :
   Staging Deployment
   Production Deployment
   Post-Deployment Stage

   Monitoring
   Feedback Loop

1. Stages

example: stages

stages:
  - source
  - build
  - test
  - quality-assurance
  - package
  - deploy
  - post-deploy
# and runners

2. Runner “lint”

example: runners

lint:
  stage: source
  image: node:latest
  before_script:
    - npm install
  script:
    - npm run lint

Benefits:

Logger for error and performers CI:

1. Cache

2. Artifactory

CI/CD Components

CI/CD Tools:

Great articles and blogs about CI/CD

What is CI/CD and CI/CD Pipeline? – Processes, Stages, Benefits