自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

GitLab13.8版本CI/CD部分功能更新

開發(fā) 開發(fā)工具
GitLab13.8版本CI/CD部分功能更新,本篇帶大家一起體驗一下。

基于GitLabCI/CD流水線實踐

 Gitlab版本升級GitLab12.9 >12.10.14 > 13.0.0 >13.8.4

https://docs.gitlab.com/omnibus/update/gitlab_13_changes.html

https://forum.gitlab.com/t/omnibus-upgrade-from-12-10-6-to-13-0-6/38737/3

https://forum.gitlab.com/t/packaged-postgresql-error-after-update-from-12-7-to-13/39451

  1. unning handlers: 
  2. Running handlers complete 
  3. Chef Infra Client finished, 441/1538 resources updated in 03 minutes 19 seconds 
  4. gitlab Reconfigured! 
  5. Checking for an omnibus managed postgresql: OK 
  6. Checking if postgresql['version'is set: OK 
  7. Checking if we already upgraded: NOT OK 
  8. Checking for a newer version of PostgreSQL to install 
  9. Upgrading PostgreSQL to 12.5 
  10. Checking if PostgreSQL bin files are symlinked to the expected location: OK 
  11. cp /opt/gitlab/embedded/service/gitlab-rails/public/deploy.html /opt/gitlab/embedded/service/gitlab-rails/public/index.html 
  12. Toggling deploy page: OK 
  13. Toggling services:ok: down: alertmanager: 1s, normally up 
  14. ok: down: gitaly: 1s, normally up 
  15. ok: down: gitlab-exporter: 0s, normally up 
  16. ok: down: gitlab-pages: 1s, normally up 
  17. ok: down: grafana: 0s, normally up 
  18. ok: down: logrotate: 0s, normally up 
  19. ok: down: postgres-exporter: 1s, normally up 
  20. ok: down: prometheus: 0s, normally up 
  21. ok: down: redis-exporter: 1s, normally up 
  22. ok: down: sidekiq: 1s, normally up 
  23. ok: down: sshd: 0s, normally up 
  24. Toggling services: OK 
  25. Running stop on postgresql:ok: down: postgresql: 0s, normally up 
  26. Running stop on postgresql: OK 
  27. Symlink correct version of binaries: OK 
  28. Creating temporary data directory: OK 
  29. Initializing the new database: OK 

13.8新特性(CI/CD)

使用退出碼控制作業(yè)的狀態(tài)

語句:allow_failure:exit_codes

使用allow_failure:exit_codes動態(tài)控制作業(yè)是否應(yīng)該允許失敗。您可以列出哪些退出代碼不被視為失敗。該作業(yè)因任何其他退出代碼而失敗。

  1. test_job_1: 
  2.   script: 
  3.     - echo "Run a script that results in exit code 1. This job fails." 
  4.     - exit 1 
  5.   allow_failure: 
  6.     exit_codes: 137 
  7.  
  8. test_job_2: 
  9.   script: 
  10.     - echo "Run a script that results in exit code 137. This job is allowed to fail." 
  11.     - exit 137 
  12.   allow_failure: 
  13.     exit_codes: 
  14.       - 137 
  15.       - 255 

參考鏈接:https://docs.gitlab.com/ee/ci/yaml/README.html#allow_failureexit_codes

管道規(guī)則支持定義變量

語句:rules:variables, (13.7引入, 13.8默認啟用)

可以在rules:使用variables定義特定條件的變量。

  1. job: 
  2.   variables: 
  3.     DEPLOY_VARIABLE: "default-deploy" 
  4.   rules: 
  5.     - if: $CI_COMMIT_REF_NAME =~ /master/ 
  6.       variables:                              # Override DEPLOY_VARIABLE defined 
  7.         DEPLOY_VARIABLE: "deploy-production"  # at the job level
  8.     - if: $CI_COMMIT_REF_NAME =~ /feature/ 
  9.       variables: 
  10.         IS_A_FEATURE: "true"                  # Define a new variable. 
  11.   script: 
  12.     - echo "Run script with $DEPLOY_VARIABLE as an argument" 
  13.     - echo "Run another script if $IS_A_FEATURE exists" 

參考鏈接:https://docs.gitlab.com/ee/ci/yaml/README.html#allow_failureexit_codes

Docker類型的執(zhí)行器配置多個鏡像拉取策略

該pull_policy參數(shù)允許您指定拉取策略列表。將按照從左到右的順序嘗試列表中的策略,直到成功進行拉取或列表用盡為止。

什么時候使用多個拉策略?

當Docker注冊表不可用并且您需要提高作業(yè)彈性時,此功能很有用。如果您使用該always策略并且注冊表不可用,則即使所需的鏡像在本地緩存,該作業(yè)也會失敗。

為了克服該問題,您可以添加在故障情況下執(zhí)行的其他后備拉取策略。通過添加第二個拉取策略值if-not-present,Runner可以找到任何本地緩存的Docker鏡像層。

  1. [runners.docker] 
  2.   pull_policy = ["always""if-not-present"

項目配置是否存儲最新工件

默認情況下,永遠不會刪除來自最近成功作業(yè)的最新工件。如果使用expire_in來配置作業(yè),則其工件僅在存在較新的工件時才過期。

保留最新的工件會在具有大量工作或較大工件的項目中使用大量存儲空間。如果項目中不需要最新的工件,則可以禁用此行為以節(jié)省空間:

導(dǎo)航到設(shè)置> CI/CD>Artifact。

取消選中“將工件保留在最近成功完成的工作中”。

您可以在實例的CI/CD設(shè)置中對自管理實例上的所有項目禁用此行為 。

禁用該功能時,最新的工件不會立即過期。必須運行新的管道,最新的工件才能到期并刪除。


不重復(fù)使用分支和合并

13.8 新增了兩個預(yù)定義變量,可以通過變量來控制CI管道。

CI_PROJECT_CONFIG_PATH 指定項目的CI配置文件路徑。

CI_OPEN_MERGE_REQUESTS 在分支和合并請求管道中可用。一個逗號分隔的列表,該列表包含最多四個使用當前分支和項目作為合并請求源的合并請求。例如: gitlab-org/gitlab!333,gitlab-org/gitlab-foss!11。

管道配置可視化

要查看gitlab-ci.yml配置的可視化,請在項目中轉(zhuǎn)到CI / CD>編輯器,然后選擇“**可視化”**選項卡??梢暬@示了所有階段和作業(yè)。任何needs 關(guān)系都顯示為將作業(yè)連接在一起的線,顯示了執(zhí)行的層次結(jié)構(gòu):


將鼠標懸停在工作上以突出其needs關(guān)系:


如果配置沒有任何needs關(guān)系,則不會畫線,因為每個作業(yè)僅取決于成功完成的前一階段。

啟用或禁用管道編輯器:

  1. Feature.disable(:ci_pipeline_editor_page) 
  2. Feature.enable(:ci_pipeline_editor_page) 

 

責任編輯:姜華 來源: DevOps云學(xué)堂
相關(guān)推薦

2020-10-21 14:10:28

工具測試開發(fā)

2023-04-18 08:17:11

GitLab持續(xù)集成

2023-04-27 08:18:25

GitLab開源

2020-10-12 07:00:00

JenkinsDevOps測試工具

2020-12-31 11:28:09

GitLabCICD

2020-11-06 16:50:43

工具GitLab CICD

2023-03-13 14:46:32

CI/CD工具軟件開發(fā)

2024-10-12 14:36:34

2022-02-22 09:00:00

軟件開發(fā)CI/CD 管道工具

2012-03-08 09:07:16

iOS 5.1iOS

2024-08-07 10:14:35

2010-08-24 17:13:12

傲游3.0廣告過濾

2021-07-02 16:30:01

CICDDevOps

2023-05-04 16:03:50

KubernetesCI/CD集成

2020-12-15 16:13:21

DevSecOpsCICD

2010-07-30 08:30:38

VisualVMVisualVM 1.VisualVM 1.

2012-09-28 09:58:35

Outlook 201Office 2013

2012-11-16 09:50:32

Windbg

2015-11-03 14:03:25

WPS辦公軟件
點贊
收藏

51CTO技術(shù)棧公眾號