الفلاتر
طريقة البحث
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • "كلمتان" تجد العبارة بالضبط.
  • --name أو -x تجد خيارًا.
  • #كلمة تبحث داخل الأوامر فقط.
  • @grep تجد الدروس والمعامل التي تستخدم grep.
  • الفلاتر: cat:network · in:labs · level:rhcsa · ch:8 · root:yes. ضع ! قبل كلمة لاستبعادها. OR بين الكلمات تعني إحداها.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث

الفصل 4الاسم في الدورة: Git, CI/CD and GitOps

Ship changes with Git, CI/CD and GitOps

In DevSecOps every change — app code, Dockerfile, Terraform, Kubernetes YAML — goes through Git, a pull request and a pipeline. CI builds, tests and scans; CD (often GitOps) deploys. These 6 tools run that flow.

  • 6 الدروس
  • 7 الأوامر

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

$ مستخدم عادي# بصلاحية root (أو مع sudo)

المهارات في هذا الفصل

  • Git و CI/CD و GitOps — 6

4.1

Git — the source of truth

git keeps the full history of code and config; branches and pull requests let a team review every change.

  • Used for: everything as code; GitOps; rollback with git revert.
git switch -c feat/health-check
git add -p && git commit -m "Add /health endpoint"
git push -u origin feat/health-check
git log --oneline --graph -10

Security checklist:

  • Protect main: required reviews and checks, no force push.
  • Sign commits (SSH or GPG) so GitHub shows Verified.
  • A committed secret is leaked: rotate it, then clean history.

الأوامر في هذا الدرس

4.2

GitHub CLI — pull requests and Actions from the terminal

gh opens and reviews PRs, watches Actions runs, sets secrets and calls the GitHub API.

gh pr create --fill
gh run watch
gh run view --log-failed
gh secret set AZURE_CLIENT_ID --body "00000000-0000-0000-0000-000000000000"
gh api repos/OWNER/REPO/dependabot/alerts --jq '.[].security_advisory.severity'

Security checklist:

  • Smallest permissions: for GITHUB_TOKEN in workflows.
  • OIDC to clouds instead of long-lived secrets.

الأوامر في هذا الدرس

4.3

GitLab Runner — run GitLab CI jobs

gitlab-runner takes jobs from .gitlab-ci.yml and runs them with the shell, Docker or Kubernetes executor.

gitlab-runner register --url https://gitlab.com --token glrt-xxxx --executor docker --docker-image alpine:3.20 --non-interactive
gitlab-runner verify
journalctl -u gitlab-runner -f

Security checklist:

  • No privileged = true (docker-in-docker) — build with kaniko or buildah.
  • Masked, protected CI variables; runners for untrusted projects separate.

4.4

Jenkins — the classic automation server

jenkins runs pipelines from a Jenkinsfile; still used in many companies, so you will meet it.

systemctl status jenkins
java -jar jenkins-cli.jar -s http://localhost:8080 -auth admin:API_TOKEN build shop/main -s

Security checklist:

  • 0 executors on the controller; builds only on agents.
  • Update plugins often; SSO; never open it to the internet.
  • withCredentials + single quotes in sh so secrets do not leak into logs.

الأوامر في هذا الدرس

4.5

Argo CD — GitOps with a UI

argocd keeps clusters in sync with Git: an Application points to a path in a repo; drift shows as OutOfSync and can self-heal.

argocd app list
argocd app diff shop
argocd app sync shop
argocd app history shop

Security checklist:

  • SSO, delete the initial admin secret, projects to limit teams.
  • Read-only deploy keys for Git; no public argocd-server.

الأوامر في هذا الدرس

4.6

Flux — GitOps as controllers

flux installs controllers that pull Git, Helm and OCI sources and apply them; it can decrypt SOPS secrets.

flux bootstrap github --owner s0sta --repository fleet --path clusters/home --personal
flux get kustomizations
flux reconcile kustomization shop --with-source

Security checklist:

  • Encrypt secrets with SOPS (age or Key Vault) before commit.
  • Check --prune paths carefully.

تذكّر

CI = build, test, scan, sign, push the image. CD (GitOps) = change a tag in Git; Argo CD or Flux deploys it. The pipeline never needs cluster-admin credentials.

الأوامر في هذا الدرس

كل الأوامر في هذا الفصل