Skip to content

Commit 1c8342b

Browse files
committed
cicd
1 parent 98a4f5c commit 1c8342b

File tree

4 files changed

+150
-1
lines changed

4 files changed

+150
-1
lines changed

β€ŽREADME.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ cargo install mdbook
1515
```
1616

1717
```
18-
mdbook buiild
18+
mdbook build
1919
```

β€ŽSUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
- [v2](./container-101/cgroup/cgroup_v2.md)
99
- [kubernetes](./kubernetes/README.md)
1010
- [helm](./kubernetes/helm/helm.md)
11+
- [cicd](./cicd/cicd.md)

β€Žcicd/cicd.md

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# CI/CD
2+
3+
## Software Development Life Cycle (SDLC) [Waterfall vs agile]
4+
5+
- Analysis
6+
- Design
7+
- Implementation
8+
- Quality Assurance
9+
- Deployment
10+
- Support & Maintenance
11+
12+
## CI/CD
13+
14+
![cicd](https://blog.mergify.com/content/images/2022/03/CI-CD-infinity-copy-1.jpg)
15+
16+
- Plan - doc / issue
17+
- [git] Code
18+
- [ci] * Build
19+
- [ci] * Test
20+
- [ci] * Release [github release]
21+
- [cd] Deploy [IaC / apps store]
22+
- [cd] Operate [controller / gitops / chatops]
23+
- [cd] Monitor [health check]
24+
25+
## Continuous integration
26+
27+
- version control
28+
- commit message [check]
29+
- build
30+
- automated testing
31+
- lint
32+
- unittest
33+
- integration test
34+
- end-to-end test
35+
36+
## Continuous delivery / deployment
37+
38+
- Deploy
39+
- Infrastructure as Code (IaC) / gitops
40+
- ansible (netdb) https://gitlab.com/19gale.ai/netdb-playbook
41+
- Operate
42+
- k8s controller / operator
43+
- chatops
44+
- OTA
45+
- A/B Testing
46+
- Monitor
47+
- dashboard / health check
48+
- gatus
49+
50+
![Day 0/Day 1/Day 2 ](https://codilime.com/static/434aed9e5736a625a9057f0b8fe6c325/701e9/day0-day1-day2-blogpost-new.png)
51+
52+
## tools
53+
54+
### version control
55+
56+
- git
57+
58+
- github pull request (PR) / gitlab merge request (MR)
59+
- merge commit
60+
- squash
61+
- relation with issue tracker
62+
- gitflow https://nvie.com/posts/a-successful-git-branching-model/
63+
- develop / feature / main / release / hotfixes
64+
65+
![gitflow](https://nvie.com/img/git-model@2x.png)
66+
67+
### CI tools
68+
69+
- git trigger (webhook)
70+
- worker
71+
- pipeline
72+
73+
#### ci tools type
74+
##### job base (jenkins)
75+
- agent (java based) / worker setup
76+
- Groovy script
77+
- https://www.jenkins.io/doc/pipeline/examples/
78+
- plugins
79+
80+
##### code pipeline base (gitlab ci/circle ci)
81+
- .gitlab-ci.yml
82+
- rules - Use the rules keyword to specify when to run or skip jobs.
83+
- 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.
84+
85+
![gitlab pipeline](https://docs.gitlab.com/ee/ci/quick_start/img/pipeline_graph_v13_6.png)
86+
87+
```
88+
build-job:
89+
stage: build
90+
script:
91+
- echo "Hello, $GITLAB_USER_LOGIN!"
92+
93+
test-job1:
94+
stage: test
95+
script:
96+
- echo "This job tests something"
97+
98+
test-job2:
99+
stage: test
100+
script:
101+
- echo "This job tests something, but takes more time than test-job1."
102+
- echo "After the echo commands complete, it runs the sleep command for 20 seconds"
103+
- echo "which simulates a test that runs 20 seconds longer than test-job1"
104+
- sleep 20
105+
106+
deploy-prod:
107+
stage: deploy
108+
script:
109+
- echo "This job deploys something from the $CI_COMMIT_BRANCH branch."
110+
environment: production
111+
```
112+
113+
##### ci market (github action)
114+
115+
- .github/workflows/xx.yml
116+
117+
```
118+
name: GitHub Actions Demo
119+
run-name: ${{ github.actor }} is testing out GitHub Actions πŸš€
120+
on: [push]
121+
jobs:
122+
Explore-GitHub-Actions:
123+
runs-on: ubuntu-latest
124+
steps:
125+
- run: echo "πŸŽ‰ The job was automatically triggered by a ${{ github.event_name }} event."
126+
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
127+
- run: echo "πŸ”Ž The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
128+
- name: Check out repository code
129+
uses: actions/checkout@v4
130+
- run: echo "πŸ’‘ The ${{ github.repository }} repository has been cloned to the runner."
131+
- run: echo "πŸ–₯️ The workflow is now ready to test your code on the runner."
132+
- name: List files in the repository
133+
run: |
134+
ls ${{ github.workspace }}
135+
- run: echo "🍏 This job's status is ${{ job.status }}."
136+
```
137+
138+
- local github action - act https://github.com/nektos/act
139+
140+
### k8s and gitops
141+
![GitOps](https://dz2cdn1.dzone.com/storage/temp/16239206-picture4.png)
142+
143+
- tilt https://docs.tilt.dev/controlloop
144+
- prod
145+
- argocd
146+
- fluxcd
147+
148+

β€Žcicd/gitlab.md

Whitespace-only changes.

0 commit comments

Comments
Β (0)