GitLab CI

Winnie Hellmann

2019-04-14

Was ist CI?

  • ein InterCity rückwärts
  • manchmal auch Corporate Identity
  • hier aber: Continuous Integration

Wie sieht CI aus?

many small characters running around busy with different tasks
many small characters running around busy with different tasks

Was macht CI?

  • automatisierte Tests
  • statische Code-Analyse
  • potentielle Bugs
  • Sicherheitslücken
  • Lizenzprobleme
  • Code-Style prüfen

Wie geht CI?

  • in GitLab per Konfiguration in .gitlab-ci.yml
  • üblicherweise eine pro Projekt
  • prinzipiell eine pro Branch bzw. Commit möglich

Wie geht CI?

  • im einfachsten Fall:
mein job:
  script:
    - echo "Nichts tun."
screenshot of pipeline with one job
screenshot of pipeline with one job

Wie geht CI?

screenshot of job log
screenshot of job log

Wie geht Parallelität?

mein job:
  script:
    - echo "Nichts tun."

dein job:
  script:
    - echo "Viel tun."
screenshot of parallel pipeline jobs
screenshot of parallel pipeline jobs

Wie geht Parallelität?

dein job:
  parallel: 5
  script:
    - echo "Aufgabe ${CI_NODE_INDEX} von ${CI_NODE_TOTAL}"
screenshot of parallel pipeline jobs
screenshot of parallel pipeline jobs

Wie geht Unparallelität?

mein job:
  stage: test
  script:
    - echo "Nichts tun."

dein job:
  stage: deploy
  script:
    - echo "Viel tun."
screenshot of pipeline with two stages
screenshot of pipeline with two stages

Wie geht Unparallelität?

stages:
  - zuerst
  - zuzweit

mein job:
  stage: zuerst
  script:
    - echo "Nichts tun."

dein job:
  stage: zuzweit
  script:
    - echo "Viel tun."

Wie entstehen neue Pipelines?

Trödeln

moment:
  when: delayed
  start_in: 30 minutes
  script:
    - echo "Wer hat an der Uhr gedreht?"

https://docs.gitlab.com/ee/ci/yaml/#whendelayed

Handarbeit

galvanize:
  when: manual
  script:
    - echo "Push the button!"
screenshot of manual pipeline job
screenshot of manual pipeline job

https://docs.gitlab.com/ee/ci/yaml/#whenmanual

Inklusion und Exklusion

harte Arbeit:
  script:
    - echo "Schaffe, schaffe, Häusle baue"
  except:
    - master
  only:
    - apprentice

https://docs.gitlab.com/ee/ci/yaml/#onlyexcept-basic

Advanced Awesomeness

CI mit CI vom CI IC

pipeline with white and red stripe
pipeline with white and red stripe