User Tools

Site Tools


инструмент_gitlab

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
инструмент_gitlab [2026/03/19 20:38]
val
инструмент_gitlab [2026/09/01 13:25] (current)
val [Пример CI/CD с использованием ИИ]
Line 150: Line 150:
  
 <​code>​ <​code>​
-### docker exec -it root_web_1 ​bash +### docker exec -it root-gitlab-1 ​bash 
-### kubectl -n my-gitlab-ns exec -ti pods/gitlab-<​TAB> ​-- bash+### kubectl -n my-gitlab-ns exec -ti deployment/gitlab -- bash
  
 # ###​gitlab-ctl status # ###​gitlab-ctl status
Line 163: Line 163:
 real    2m34.726s real    2m34.726s
 ... ...
 +</​code>​
 +
 +==== 500: We're sorry, something went wrong on our end ====
 +<​code>​
 +# gitlab-rails console
 +
 +irb(main):​001>​ ApplicationSetting.delete_all
 +
 +irb(main):​001>​ ActiveRecord::​Base.connection.execute("​UPDATE application_settings SET runners_registration_token_encrypted = NULL, error_tracking_access_token_encrypted = NULL, encrypted_ci_jwt_signing_key = NULL")
 +
 +irb(main):​002>​ Project.update_all(runners_token:​ nil, runners_token_encrypted:​ nil)
 +irb(main):​003>​ Group.update_all(runners_token:​ nil, runners_token_encrypted:​ nil)
 +
 +irb(main):​004>​ Ci::​RunnerProject.delete_all
 +irb(main):​005>​ Ci::​Runner.delete_all
 +irb(main):​006>​ Rails.cache.clear
 </​code>​ </​code>​
 ==== Настройка отправки почты ==== ==== Настройка отправки почты ====
Line 169: Line 185:
 <​code>​ <​code>​
 root@gitlab:/#​ gitlab-rails console root@gitlab:/#​ gitlab-rails console
-irb(main):​001>​ Notify.test_email('​student@corp15.un', '​Message Subject',​ '​Message Body'​).deliver_now+irb(main):​001>​ Notify.test_email('​student@corpX.un', '​Message Subject',​ '​Message Body'​).deliver_now
 </​code>​ </​code>​
 ==== GitLab Docker Registry ==== ==== GitLab Docker Registry ====
Line 298: Line 314:
  
   * [[https://​docs.gitlab.com/​runner/​install/​linux-manually.html|Install GitLab Runner manually on GNU/Linux]]   * [[https://​docs.gitlab.com/​runner/​install/​linux-manually.html|Install GitLab Runner manually on GNU/Linux]]
-  * [[https://​val.bmstu.ru/​unix/​Git/​gitlab-runner_amd64.deb]] (16.10.0+  * [[https://​val.bmstu.ru/​unix/​Git/​gitlab-runner_amd64.deb]] (17.3.1-1
  
 <​code>​ <​code>​
Line 416: Line 432:
   * [[https://​medium.com/​@ryzmen/​gitlab-fast-pipelines-stages-jobs-c51c829b9aa1|GitLab:​ understanding pipelines, stages, jobs and organising them efficiently for speed and feedback loop]]   * [[https://​medium.com/​@ryzmen/​gitlab-fast-pipelines-stages-jobs-c51c829b9aa1|GitLab:​ understanding pipelines, stages, jobs and organising them efficiently for speed and feedback loop]]
   * [[https://​stackoverflow.com/​questions/​64725914/​how-to-disable-auto-pipelines-in-gitlab|How to disable auto pipelines in gitlab]]   * [[https://​stackoverflow.com/​questions/​64725914/​how-to-disable-auto-pipelines-in-gitlab|How to disable auto pipelines in gitlab]]
 +  * [[Самый простой пример CI/CD]]
  
 ==== Пример shell make ==== ==== Пример shell make ====
Line 813: Line 830:
 #  stage: scan #  stage: scan
 #  image: #  image:
-#    name: aquasec/trivy:latest+#    name: ghcr.io/​aquasecurity/trivy
 #    entrypoint: [""​] ​ #    entrypoint: [""​] ​
 #  variables: #  variables:
Line 821: Line 838:
 #    TRIVY_CACHE_DIR:​ "​.trivycache/"​ #    TRIVY_CACHE_DIR:​ "​.trivycache/"​
 #  script: #  script:
-#    - trivy image --exit-code 1 --insecure $CI_REGISTRY_IMAGE:​$CI_COMMIT_SHA+#    - trivy image --exit-code 1 --severity HIGH --insecure $CI_REGISTRY_IMAGE:​$CI_COMMIT_SHA
 #  cache: #  cache:
 #    paths: #    paths:
 #      - "​.trivycache/"​ #      - "​.trivycache/"​
 +#  except:
 +#    - tags
 +#  tags:
 +#    - build
  
 #Deploy: #Deploy:
Line 834: Line 855:
 #  trigger: #  trigger:
 #    project: student/​gowebd-k8s #    project: student/​gowebd-k8s
 +</​code>​
 +
 +==== Пример CI/CD с использованием ИИ ====
 +
 +  * [[Самый простой пример CI/CD]]
 +  * [[OpenCode]]
 +
 +<​code>​
 +gitlab-runner@gate:​~$ cat ~/​.config/​opencode/​opencode.jsonc
 +</​code><​code>​
 +stages:
 +  - test
 +  - test-ai
 +  - deploy
 +...
 +test1-ai-job:​
 +  stage: test-ai
 +  script:
 +    - >
 +      ~/​.opencode/​bin/​opencode run --agent plan 
 +      "
 +      проверь синтаксис файла permit_domains.txt в текущем каталоге,​
 +      используется для acl dstdomain squid 6,
 +      объясни если есть ошибки,​ не задавай вопросы,​ не запускай,​ не исправляй,​
 +      заверши ответ новой строкой строго со слова FAIL или SUCCESS
 +      "
 +      | tee opencode_log.txt
 +    - tail -n2 opencode_log.txt|grep SUCCESS
 +  tags:
 +    - squid-tag
 +...
 </​code>​ </​code>​
 ===== Сервер OpenID ===== ===== Сервер OpenID =====
инструмент_gitlab.1773941910.txt.gz · Last modified: 2026/03/19 20:38 by val