Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Gitlab CI 入門

Jerry
March 19, 2019

Gitlab CI 入門

Jerry

March 19, 2019
Tweet

More Decks by Jerry

Other Decks in Technology

Transcript

  1. GITLAB CI
    JERRY CHENG

    View Slide


  2. • Jerry Cheng
    • DevOps Engineer
    • Software Engineer
    Agile
    (?) DevOps


    View Slide

  3. AGENDA

    CI/CD
    • Why Gitlab CI
    • Gitlab CI
    • Gitlab

    View Slide

  4. CI/CD

    View Slide

  5. CI/CD
    Syntax
    Check
    Test Build Artifacts Deploy
    Syntax
    Check
    Test Build Artifacts Deploy
    Syntax
    Check
    Test Build Artifacts Deploy

    View Slide

  6. WHY GITLAB CI
    • !"Gitlab CI Gitlab
    • " .gitlab-ci.yml

    • job container "
    • Container Registry

    View Slide

  7. View Slide

  8. View Slide

  9. View Slide

  10. .GITLAB-CI.YML CI/CD
    https://docs.gitlab.com/ce/ci/yaml/

    View Slide

  11. SCRIPT
    https://gitlab.com/gitlab-ci-start/sayhi

    View Slide


  12. IMAGE
    https://gitlab.com/gitlab-ci-start/use-image
    • Image

    View Slide

  13. STAGES & JOB
    https://gitlab.com/gitlab-ci-start/stages-and-job

    View Slide

  14. ARTIFACTS & DEPENDENCIES
    • Artifacts
    • Job

    • Composer install >> ./vendor
    • Dependencies
    • job

    https://gitlab.com/gitlab-ci-start/artifacts

    View Slide

  15. DOCKER
    • Services
    • Link container
    • Docker in Docker
    https://gitlab.com/gitlab-ci-start/use-docker

    View Slide

  16. BUILD & DEPLOY
    composer
    install
    docker
    build
    (nginx/php)
    deploy (qa)
    tag (deploy
    to staging)
    deploy to
    production
    https://gitlab.com/gitlab-ci-start/build-and-deploy

    View Slide

  17. GITLAB
    • Docker
    • Kubernetes

    View Slide

  18. DOCKER GITLAB
    • docker-compose
    • docker-compose pull && docker-compose up –d
    ()
    • host
    22port
    • https://docs.gitlab.com/omnibus/do
    cker/#install-gitlab-using-docker-
    compose

    View Slide

  19. K8S ! GITLAB
    • Helm chart (K8S Package Manager)

    • Gitlab
    • Gitlab CI Runner (unprivileged)
    • Storage (PostgreSQL/Redis/Minio/Container Registry)
    • Nginx Ingress Controller (
    #
    tcp22 gitlab shell service)
    • Cert Manager
    • "! domain
    • gitlab.yourdomain
    • registry.yourdomain
    • minio.yourdomain

    • https://docs.gitlab.com/ce/install/kubernetes/gitlab
    _chart.html
    • Chart
    • https://gitlab.com/charts/gitlab/tree/master
    • https://gitlab.com/gitlab-ci-start/gitlab-chart-values

    View Slide

  20. GITLAB CI RUNNER

    Gitlab
    • ..
    • https://docs.gitlab.com/runner/

    View Slide





  21. • CI/CD

    View Slide

  22. THANKS FOR LISTEN

    View Slide