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

Introduction to CI with GitLab

GitLab
April 14, 2016

Introduction to CI with GitLab

From this deck, used in the webcast, you'll learn about Continuous Integration in GitLab. GitLab is more than a repository manager. Our goal is to help you get from idea to production smoothly. Therefore, we built Continuous Integration to help you build, test, and deploy your code together.

GitLab

April 14, 2016
Tweet

More Decks by GitLab

Other Decks in Programming

Transcript

  1. about.gitlab.com Monthly release New features Open Development Direction Strategy Collaborate

    on code. Issues, Merge Requests, Code Review Continuous Integration Deploy! Community Edition Open Source (MIT License) On premises or GitHost.io Enterprise Edition +Options On premises or GitHost.io GitLab.com Free and unlimited Public and private! SaaS Enterprise Edition
  2. In this webcast • GitLab CI overview • How GitLab

    CI works • Live demos: • Configuring CI for testing • Configuring a Specific Runner • Reviewing your work; builds and artifacts • The roadmap • Resources to get started Heather Developer Marketing
  3. Tip: Watching us on GNU/Linux? Try Chromium. • Recording and

    Slides will be available! • Keep an eye on our blog and newsletter about.gitlab. com/contact
  4. Group What is GitLab? Project Issue Tracker Discuss, plan, assign,

    organize. Merge Requests Same as above, plus line by line code review, testing and merging. Git Repository Work from the command line or the UI GitLab CI Test your builds before you merge.
  5. Continuous Integration is a software development practice where members of

    a team integrate their work frequently... verified by an automated build (including test) to detect integration errors -- Martin Fowler on Continuous Integration
  6. What’s next? Your Development Team Push to Central Repository Build

    and test (CI) Production (Deployment) Staging (Delivery) ➔ Continuous Delivery ➔ Continuous Deployment
  7. Configuration as Code • Versioned tests: a .gitlab-ci.yml file that

    contains your tests, allowing everyone to contribute changes and ensuring every branch gets the tests it needs • We are developers, we prefer to write, focus on content, because this is natural for us :)
  8. .gitlab-ci.yml image: ruby before_script: - bundle install test:rspec: script: -

    bundle exec rspec test:rubocop: script: - bundle exec rubocop
  9. What can you do with CI on GitLab? ➔ Build

    packages ➔ Run test suites ➔ Deploy new code once tests pass ➔ Use for any language and framework ➔ Use on any platform ➔ Use for mobile and embedded development ➔ Use on ARM and Raspberry PI
  10. Other CI tools? ➔ Jenkins integration? ◆ Status display on

    the dashboard, such as project list, project landing page, status of commits, merge request but not the build log. ➔ With other CI services some of this won’t work. ➔ (Link to documentation describing other services)?
  11. Which services work with CI? ➔ Atlassian Bamboo CI ➔

    Drone CI ➔ Jenkins CI ➔ JetBrains Team City CI doc.gitlab.com/ce/project_services/project_services.html
  12. Any questions about configuring GitLab CI so far? Demos coming

    next! We’ll answer what we can and follow up via email after! Watching the recording? about.gitlab.com/getting-help
  13. What we will do in this demo ➔ Create an

    example Ruby project using TDD ➔ Use RSpec test harness ➔ Configure CI environment for it on gitlab.com ➔ Prepare very basic `gitlab-ci.yml` file ➔ See what happens after a Git push
  14. What we just saw How to configure your project with

    Continuous Integration on GitLab. com. You can apply the same workflow on your on-premises of GitLab Community Edition installation, using your own compute nodes to install GitLab Runners on!
  15. Any questions about the demo configuring CI? We’ll answer what

    we can and follow up via email after! Watching the recording? about.gitlab.com/getting-help
  16. What we did in this demo ➔ Installed GitLab Runner

    on a fresh virtual machine with Debian ➔ Registered the Runner in a project created earlier ➔ Disabled shared Runners for the project ➔ Re-executed last build so it was run on our new Runner ➔ Started our Runner to process the build
  17. Why would I need my own Runner? On GitLab.com, for

    example, you can use shared runners. But sometimes shared runners aren’t good solution, for example: ➔ you need to compile the software for Windows or OS X, not for linux ➔ you are creating some confidential data during the build so you need to have them on your infrastructure Happily with GitLab CI you can do it!
  18. Which Operating Systems? Supported platforms: i386, amd64, arm Supported OS:

    ➔ GNU/Linux ➔ Windows ➔ OS X ➔ FreeBSD DEB/RPM packages
  19. Compare Docker vs Shell? Shell • Easiest to install and

    use • Uses host environment • Less secure - different projects can access each other working directories Docker • More powerful • Separates build environment • Use predefined images with required software, libraries etc. (or build your own) • Works only for GNU/Linux (as for now)
  20. Autoscaling • Introduced in GitLab Runner 1.1 • Uses Docker

    Machine (so it’s limited to GNU/Linux right now) • It’s integrated with most popular cloud providers and you can always provide your own driver • Made to speed up your builds and utilize your build infrastructure (and costs)
  21. Any questions about configuring Specific Runners? We’ll answer what we

    can and follow up via email after! Watching the recording? about.gitlab.com/getting-help
  22. Pipeline stages: - build - test build: stage: build script:

    make build test: stage: test script: make test
  23. Pages ➔ Create websites for your GitLab projects, groups, or

    user account ➔ Use any static website generator ➔ Use GitLab CI to generate your Pages ➔ Use own domain and SSL http://pages.gitlab.io/ image: publysher/hugo pages: script: - hugo artifacts: paths: - public only: - master
  24. Roadmap • Integrated Container Registry: push and pull directly from

    GitLab • Deployments to Kubernetes and Docker Swarm • Plugins for GitLab Runner: ◦ Easy building of Docker images ◦ Easy use of docker-compose workflow • Artifacts for failed builds • Dependent projects about.gitlab.com/direction
  25. Any questions? We’ll answer what we can and follow up

    via email after! Watching the recording? about.gitlab.com/getting-help