CI / CD
CIS 1912
Housekeeping
final project proposal & example
HW3: Kube Config
Developer Experience
What steps are required to deploy a new version of our code?
Deploy Steps
Idea: Build automation for these so we can focus on writing code not deploying it.
CI vs CD vs CD
Continuous Integration
Practice of merging in changes as frequently as possible, leveraging automated testing to ensure merges don't break functionality
Continuous Delivery
Practice of extending CI to also deploy to a staging environment
Continuous Deployment
Practice of automatically deploying if CI stages all pass
Git[lab] Flow
How does CI/CD Work?
GitHub Actions
CI/CD Demo
https://github.com/cis1912/ci-demo
(fork this repo don’t clone it)
GitHub Actions Example
name: Lint and Publish
on: push
jobs:
lint:
name: Run lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
yarn install
yarn lint
publish:
name: Publish to github package registry
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- uses: JS-DevTools/npm-publish@v1
with:
registry: https://npm.pkg.github.com
token: ${{ secrets.GITHUB_TOKEN }}
GitHub Actions Example
name: Lint and Publish
on: push
jobs:
lint:
name: Run lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
yarn install
yarn lint
publish:
name: Publish to github package registry
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v2
- uses: JS-DevTools/npm-publish@v1
with:
registry: https://npm.pkg.github.com
token: ${{ secrets.GITHUB_TOKEN }}
Steps: run or uses(with)
Secrets: GitHub Actions secrets
Debugging CI
State Management
If my cluster was wiped to the ground, what steps would be required to get me back to this state?
GitOps
Instead of storing state in clusters after CI runs, what if we stored the state in another git repo? With GitOps, we can serialize our desired state into Git.
Now we get our favorite properties of Git:
GitOps with Argo
Where we've been
The DevOps Pipeline
Final Projects!
Fin
Credits
Gitlab flow:
https://about.gitlab.com/solutions/gitlab-flow/
Gitops with argo:
https://nortal.com/blog/gitops-argocd/