jenkins 配置

1.

ssh-keygen -t rsa

2.  

配置 GitLab 用户

创建一个用户或选择一个已有用户,用来让 Jenkins 和 GitLab API 交互。这个用户将需要是全局的管理员或添加进每个组/工程,并作为成员。需要开发者权限来报告构建状态。这是由于,当使用了 ‘Merge when pipeline succeeds’ 功能时,成功的构建状态可以触发合并。GitLab Plugin 的一些功能可能需要其它的一些权限。比如,有一个选项用于在构建成功时,接受 merge request。使用这一功能需要 developer,master 或 owner 级的权限。

增加:Active Personal Access Tokens (1)

 GitLab API token

3. 

env
cd /home/master
rm -fr *
git clone $gitlabSourceRepoSshUrl

cd  $WORKSPACE 
rm -fr *
git clone $gitlabSourceRepoSshUrl
cd RobotTest/
git checkout $gitlabBranch
git diff master $gitlabBranch > $WORKSPACE/../$BUILD_ID
cat $WORKSPACE/../$BUILD_ID
python /home/master/RobotTest/tools/pickup_mr_releated_suites.py  $WORKSPACE/../$BUILD_ID   $WORKSPACE/results $WORKSPACE/RobotTest/suites
rm -f $WORKSPACE/../$BUILD_ID

4.

com.dabsquared.gitlabjenkins.connection.GitLabConnectionConfig.xml

<?xml version='1.1' encoding='UTF-8'?>
<com.dabsquared.gitlabjenkins.connection.GitLabConnectionConfig plugin="gitlab-plugin@1.5.9">
  <useAuthenticatedEndpoint>true</useAuthenticatedEndpoint>
  <connections>
    <com.dabsquared.gitlabjenkins.connection.GitLabConnection>
      <name>RobotTest</name>
      <url>https://gitlabe1.ext.net.nokia.com</url>
      <apiTokenId>37f8840e-4565-4a25-9275-7ef1ee5f527d</apiTokenId>
      <clientBuilder class="com.dabsquared.gitlabjenkins.gitlab.api.impl.AutodetectGitLabClientBuilder">
        <id>autodetect</id>
        <ordinal>0</ordinal>
      </clientBuilder>
      <ignoreCertificateErrors>false</ignoreCertificateErrors>
      <connectionTimeout>10</connectionTimeout>
      <readTimeout>10</readTimeout>
    </com.dabsquared.gitlabjenkins.connection.GitLabConnection>
  </connections>
</com.dabsquared.gitlabjenkins.connection.GitLabConnectionConfig>
 

 

 

转载于:https://my.oschina.net/u/3055388/blog/3002847

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值