דלגו לתוכן

GitLab בסיס

צריךדף
ליצור token / service account / deploy token ולבחור ביניהםidentities
להבין למה 403 למרות שה-token "תקין" (role מול scope)permissions
CI/CD variables, Mask מול Protectvariables
runner שמריץ jobsrunners
נתיבי image, deploy token למשיכהregistry

איפה ב-UI: הכול במקום אחד

Section titled “איפה ב-UI: הכול במקום אחד”

כל הנתיבים מתחילים ב-Project → (או Group → כשכתוב). ניסוח התפריט משתנה קצת בין גרסאות.

מהנתיב
Members (role)Manage → Members
Access tokens (Premium)Settings → Access tokens
Deploy tokensSettings → Repository → Deploy tokens
CI/CD variablesSettings → CI/CD → Variables
RunnersSettings → CI/CD → Runners
Protected branchesSettings → Repository → Protected branches
Container registryDeploy → Container registry
Pipelines / JobsBuild → Pipelines / Build → Jobs
Pipeline editor (Validate)Build → Pipeline editor
EnvironmentsOperate → Environments
PAT (אישי)Avatar ← Edit profile → Access tokens
SSH keys (אישי)Avatar ← Edit profile → SSH Keys

ל-group יש שני שמות. ה-URL, ה-clone וה-repoURL משתמשים תמיד ב-path, לא ב-display name.

GitLab UI
Group → Settings → General → Naming, visibility
Group name = display name (can contain spaces, free text) TRIDENT: trident-lab
Group URL = path (what goes in every URL and variable) TRIDENT: trident-lab00

איך מוודאים: git ls-remote git@<GITLAB_HOST>:<GROUP>/<REPO>.git מדפיס רשימת refs ולא not found.

GitLab UI
Create group:
left sidebar → Groups → View all groups → New group → Create group
fill: Group name, Group URL (this is the path), Visibility = Private → Create group
Create project inside the group:
open the group → New project/repository → Create blank project
fill: Project name, Project URL (pick the group in the dropdown),
Project slug (= the repo path), Visibility = Private
untick "Initialize repository with a README" if you will push an existing repo, otherwise tick it
→ Create project

ניסוחי התפריט משתנים קצת בין גרסאות (Groups מול Your work, "New project/repository" מול "New project"). המבנה הקבוע: group → New project → Create blank project.

איך מוודאים: כפתור Code בדף ה-project מציג את כתובות ה-clone עם ה-path הנכון.

GitLab UI
Project → Code → Branches → New branch
Branch name: <BRANCH> Create from: main

או מה-clone: git switch -c <BRANCH> ואז git push -u origin <BRANCH> (ראה git/branches). ה-default branch משתנה ב-Project → Settings → Repository → Branch defaults.

סט ה-repos של פרויקט בסגנון TRIDENT

Section titled “סט ה-repos של פרויקט בסגנון TRIDENT”

הפרויקט מחולק למספר repos כי לכל אחד יש כותב וקורא אחרים. חשוב לדעת מי כותב (זה קובע role ו-scope).

repoתוכןמי כותבמי קורא
trident-sourceקוד, Dockerfile, .gitlab-ci.yml דק, ה-registry של ה-imagesאתהה-runner (CI), kubelet (registry)
trident-cipipelines/source.yml, scripts/promote.shאתהה-pipeline של source (include + clone)
trident-gitopsvalues לכל environment, versions/<ENV>.yaml, argocd/אתה + CI (רק versions/)Argo CD
trident-templatesה-charts (pinned ב-tag)אתהArgo CD
  • ה-images נדחפים ל-registry של source, לא של gitops. ל-gitops מגיעה רק מחרוזת ה-tag.
  • Argo קורא רק את gitops ו-templates. הוא לא קורא את source.
  • ה-CI לא נוגע ב-cluster; הוא כותב ל-Git ו-Argo מסנכרן. פירוט ב-architecture/overview.