инструмент_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
Next revision Both sides next revision
инструмент_gitlab [2022/06/20 09:00]
val [GitLab CI/CD]
инструмент_gitlab [2022/06/20 12:51]
val [GitLab CI/CD]
Line 41: Line 41:
  
   * [[https://​docs.gitlab.com/​ee/​ci/​examples/#​cicd-templates|CI/​CD templates]]   * [[https://​docs.gitlab.com/​ee/​ci/​examples/#​cicd-templates|CI/​CD templates]]
 +
 +=== Пример 1 ===
  
 <​code>​ <​code>​
Line 61: Line 63:
     - dhcpdeploy     - dhcpdeploy
  
 +</​code>​
 +
 +=== Пример 2 ===
 +
 +<​code>​
 +root@server:​~/​openvpn1#​ cat .gitlab-ci.yml
 </​code><​code>​ </​code><​code>​
 +deploy_test:​
 +  stage: deploy
 +  script:
 +    - echo $(date) "​Deploy TEST openvpn1"​ >> /​tmp/​Bash.gitlab-ci.log
 +    - ansible-playbook openvpn1.yaml -i inventory.yaml -e "​variable_host=test_nodes"​
 +  tags:
 +    - openvpn1deploy
 +  rules:
 +    - if: ($CI_COMMIT_BRANCH == "​test"​ && $CI_COMMIT_REF_NAME == "​test"​)
 +
 +deploy_prod:​
 +  stage: deploy
 +  script:
 +    - echo $(date) "​Deploy PROD openvpn1"​ >> /​tmp/​Bash.gitlab-ci.log
 +    - ansible-playbook openvpn1.yaml -i inventory.yaml
 +  tags:
 +    - openvpn1deploy
 +  rules:
 +    - if: ($CI_COMMIT_BRANCH == "​main"​ && $CI_COMMIT_REF_NAME == "​main"​)
 +</​code>​
 +
 +=== Пример 3 ===
 +
 +<​code>​
 vagrant@node1:​~/​project1$ cat .gitlab-ci.yml vagrant@node1:​~/​project1$ cat .gitlab-ci.yml
 </​code><​code>​ </​code><​code>​
инструмент_gitlab.txt · Last modified: 2024/05/08 10:38 by val