Circleci Checkout是否从master或特定提交的代码中提取最新代码 [英] Does circleci checkout pull the latest code from master or the code for the specific commit

查看:67
本文介绍了Circleci Checkout是否从master或特定提交的代码中提取最新代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好stackoverflow/circleci神.

Hello stackoverflow/circleci gods.

我已经使用CircleCI已有一段时间了,我对结帐"步骤有疑问,我将尽力解释.这是我的circleCI配置文件的片段(我有一个工作为"a-job",其第一步是结帐):

I have been using circleCI for a while now and I have a question about the 'checkout' step which I will do my best to explain. This is a snippet from my circleCI config file (I have a job 'a-job' whose first step is checkout):

a-job:
  docker:
    - image: docker-image-here
  steps:
    - checkout
    ...

我的问题是,circleci步骤签出"是从母版还是特定提交的代码中提取最新代码.

My question is, does the circleci step 'checkout' pull the latest code from master or the code for the specific commit.

即签出只是git clone master:latest还是git clone特定提交在这里

i.e. does checkout simply git clone master:latest or does it git clone SPECIFIC COMMIT HERE

推荐答案

免责声明:CircleCI的开发人员布道者

VonC的答案不正确.在CircleCI 2.0(即配置)中,特殊步骤" checkout 签出当前提交.当前的提交是首先启动CI的提交.

VonC's answer is incorrect. In CircleCI 2.0 (which is what that config is), the "special step" checkout checks out the current commit. The current commit is the commit that initiated the CI run in the first place.

因此,每当您 git push 到GitHub或Bitbucket时,都会构建该提交,这就是 checkout 步骤检索到的提交.如果您同时 git push 次提交,则最近一次提交是将开始进行构建的提交.

So whenever you git push to GitHub or Bitbucket, that commit gets built and that's the commit that the checkout step retrieves. In the case where you git push multiple commits at the same time, the most recent commit is the one a build will be started for.

这篇关于Circleci Checkout是否从master或特定提交的代码中提取最新代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆