Skip to content

Latest commit

 

History

History
149 lines (117 loc) · 3.82 KB

cicd.md

File metadata and controls

149 lines (117 loc) · 3.82 KB

CI/CD

Software Development Life Cycle (SDLC) [Waterfall vs agile]

  • Analysis
  • Design
  • Implementation
  • Quality Assurance
  • Deployment
  • Support & Maintenance

CI/CD

cicd

  • Plan - doc / issue
  • [git] Code
  • [ci] * Build
  • [ci] * Test
  • [ci] * Release [github release]
  • [cd] Deploy [IaC / apps store]
  • [cd] Operate [controller / gitops / chatops]
  • [cd] Monitor [health check]

Continuous integration

  • version control
    • commit message [check]
  • build
  • automated testing
    • lint
    • unittest
    • integration test
    • end-to-end test

Continuous delivery / deployment

Day 0/Day 1/Day 2

tools

version control

gitflow

CI tools

  • git trigger (webhook)
  • worker
    • pipeline

ci tools type

job base (jenkins)
code pipeline base (gitlab ci/circle ci)
  • .gitlab-ci.yml
  • rules - Use the rules keyword to specify when to run or skip jobs.
  • cache / artifacts - Keep information across jobs and stages persistent in a pipeline with cache and artifacts. These keywords are ways to store dependencies and job output, even when using ephemeral runners for each job.

gitlab pipeline

build-job:
  stage: build
  script:
    - echo "Hello, $GITLAB_USER_LOGIN!"

test-job1:
  stage: test
  script:
    - echo "This job tests something"

test-job2:
  stage: test
  script:
    - echo "This job tests something, but takes more time than test-job1."
    - echo "After the echo commands complete, it runs the sleep command for 20 seconds"
    - echo "which simulates a test that runs 20 seconds longer than test-job1"
    - sleep 20

deploy-prod:
  stage: deploy
  script:
    - echo "This job deploys something from the $CI_COMMIT_BRANCH branch."
  environment: production
ci market (github action)
  • .github/workflows/xx.yml
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
  Explore-GitHub-Actions:
    runs-on: ubuntu-latest
    steps:
      - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
      - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
      - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
      - name: Check out repository code
        uses: actions/checkout@v4
      - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
      - run: echo "🖥️ The workflow is now ready to test your code on the runner."
      - name: List files in the repository
        run: |
          ls ${{ github.workspace }}
      - run: echo "🍏 This job's status is ${{ job.status }}."

k8s and gitops

GitOps