Skip to content

Gitlab CI - Option to omit "git checkout" on test and deploy stages

Hi there

Background

I've debugged what the Gitlab Runner was doing on my machine the other day and I found out that the runner checks out code from the repository even though the stage is i.e. "test" or "deploy"

I imagine myself building a workflow where code is being built in 'build' stage and binaries created is uploaded as an artifact. In 'test' and 'deploy' stages I would retrieve the artifact and use the caching feature to get a hold of any testing and deployment scripts that I need to test and deploy my artifact without the overhead of checking out the repository once again

Proposal

It should be possible to define in YML in scope of a job (or stage) that the runner should omit Git checking out code

Example

If you want to check out the repository during 'deploy' you should be explicit about it - something similar to this:

deploy_website:
  stage: deploy
  script:
    - powershell .\deploy_website.ps1
  git_checkout: true

Default for stage 'build' should be 'true' Defaults for stages 'test' and 'deploy' should be 'false' Default for userdefined stages should be 'false'

Advantages of this feature

  • Minimize I/O intensive operations on buildserver for non-building activities
  • Shortening the build time