jenkins和gitlab结合的时候出错

Started by user zhaoliang
Building in workspace /var/lib/jenkins/workspace/ZuoYeah_Static_Production
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url [email protected]:tiplus_cn/zuoyeah_static.git # timeout=10
Fetching upstream changes from [email protected]:tiplus_cn/zuoyeah_static.git
 > git --version # timeout=10
using GIT_SSH to set credentials
 > git -c core.askpass=true fetch --tags --progress [email protected]:tiplus_cn/zuoyeah_static.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo ‘origin‘
hudson.plugins.git.GitException: Failed to fetch from [email protected]:tiplus_cn/zuoyeah_static.git
	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:763)
	at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1012)
	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1043)
	at hudson.scm.SCM.checkout(SCM.java:485)
	at hudson.model.AbstractProject.checkout(AbstractProject.java:1277)
	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
	at hudson.model.Run.execute(Run.java:1741)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:408)
Caused by: hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress [email protected]:tiplus_cn/zuoyeah_static.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: remote: Counting objects: 18, done.[K
remote: Compressing objects:   5% (1/18)   [K
remote: Compressing objects:  11% (2/18)   [K
remote: Compressing objects:  16% (3/18)   [K
remote: Compressing objects:  22% (4/18)   [K
remote: Compressing objects:  27% (5/18)   [K
remote: Compressing objects:  33% (6/18)   [K
remote: Compressing objects:  38% (7/18)   [K
remote: Compressing objects:  44% (8/18)   [K
remote: Compressing objects:  50% (9/18)   [K
remote: Compressing objects:  55% (10/18)   [K
remote: Compressing objects:  61% (11/18)   [K
remote: Compressing objects:  66% (12/18)   [K
remote: Compressing objects:  72% (13/18)   [K
remote: Compressing objects:  77% (14/18)   [K
remote: Compressing objects:  83% (15/18)   [K
remote: Compressing objects:  88% (16/18)   [K
remote: Compressing objects:  94% (17/18)   [K
remote: Compressing objects: 100% (18/18)   [K
remote: Compressing objects: 100% (18/18), done.[K
remote: Total 18 (delta 12), reused 0 (delta 0)[K
error: insufficient permission for adding an object to repository database .git/objects
fatal: failed to write object
fatal: unpack-objects failed

	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1640)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1388)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:62)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:313)
	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:761)
	... 11 more
ERROR: null
Finished: FAILURE

原因是我在服务器进行了操作,然后在/var/lib/jenkins/workspace/ZuoYeah_Static_Production/.git/objects目录中 无意中增加了root账号权限的文件夹,原来是jenkins账号的文件权限是jenkins,所以需要将objects目录下的文件夹权限组修改为jenkins

时间: 2024-08-12 02:15:13

jenkins和gitlab结合的时候出错的相关文章

持续集成+自动化部署[代码流水线管理及Jenkins和gitlab集成]

持续集成+自动化部署[代码流水线管理及Jenkins和gitlab集成] 标签(空格分隔): Jenkins 一.代码流水线管理 Pipeline名词顾名思义就是流水线的意思,因为公司可能会有很多项目.如果使用jenkins构建完成后,开发构建项目需要一项一项点击,比较麻烦.所以出现pipeline名词. 代码质量检查完毕之后,我们需要将代码部署到测试环境上去,进行自动化测试 新建部署代码项目 点击新建 这里只需要写一下描述 执行Shell脚本 温馨提示:执行命令主要涉及的是权限问题,我们要搞明

搭建Jenkins从gitlab获取maven项目持续集成

环境 : centos7 安装Jenkins,这里选择使用service方式安装Jenkins,也可以下载Jenkins.war自己部署到tomcat下. #添加Jenkins源: $ sudo wget -O /etc/yum.repos.d/jenkins.repo http://jenkins-ci.org/redhat/jenkins.repo $ sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key

jenkins 设置 gitlab web hooks

背景 接口自动化期望代码push后触发实现持续集成,代码push后,自动化执行jenkins的job. 步骤 准备工作 工具:jenkins,gitlab jenkins需要安装插件:git plugin,gitlab hook plugin , gitlab plugin(有的插件是自带的,缺什么安装什么) gitlab:确保有web hook权限,这个跟公司的gitlab有关,入口settings下的web hooks如下: 确保gitlab跟jenkins的连通性 hook的大概原理其实很

jenkins对接gitlab和git

1 需要的插件 jenkins的git插件和jenkins的gitlab插件. 2 对接gitlab 在系统配置中,随便起一个连接的名字,设置url,可以直接用ip地址,端口号默认是80,不需要写明. 证书为gitlab api token,即gitlab的private token. 配置好之后,test connection. 3 对接git 第一,要在jenkins服务器的jenkins用户下,生成ssh的公钥和私钥.必须是在jenkins用户下. 第二,ssh公钥放在gitlab的ssh

Jenkins+Ansible+Gitlab自动化部署三剑客

最近一直在学习Ansible的一些playbook的写法, 所以一直没有怎么更新, 想到目前大家对诸如saltstack, docker, Ansible等自动化部署相关的工具很感兴趣, 但又苦于没有可学习的中文实例, 这里我就把我这几个月所接触到目前国外比较流行的部署经验给大家分享一下. 首先给大家介绍的是Ansible, 恩, 重要的问题说三遍, 不是Saltstack, Ansible作为一个python写的自动化部署工具, 确实较之前我所接触的Chef, saltstack, puppe

jenkins结合gitlab实现提交代码自动构建

jenkins可以说是现在非常流行的一个继续集成工具,几乎所有的公司都在用,并且它也基本是devops的连接者,是一个比较核心的工具. 主要记录以下两个: 利用jenkins和gitlab的webhook结合,实现提交代码之后,自动触发jenkins的构建. 顺带介绍一下通过触发器构建,比如直接通过url去触发的方式. 一.jenkins结合webhook 1.jenkins配置 a.首先jenkins得需要安装两个gitlab的插件:Gitlab Hook Plugin和gitlab,插件的安

Jenkins+Git+Gitlab+Ansible实现持续集成自动化部署动态网站(二)--技术流ken

项目前言 在上一篇博客<Jenkins+Git+Gitlab+Ansible实现持续化集成一键部署静态网站(一)--技术流ken>中已经详细讲解了如何使用这四个工具来持续集成自动化部署一个静态的网站. 如果大家可以熟练掌握以上内容,势必会在工作中减轻不小的工作量. 本篇博客将再次使用这四个工具结合freestyle和pipeline来完成动态网站的部署. 为了拓宽知识点,本篇博客将使用jenkins的两种常用方法来进行部署,如果你对pipeline还不熟悉,请参考我之前的博客<Jenki

Jenkins 配合 GitLab 实现分支的自动合并、自动创建 Tag

Jenkins 配合 GitLab 实现分支的自动合并.自动创建 Tag 背景 GitFlow工作流简介 Gitflow工作流定义了一个围绕项目发布的严格分支模型,它会相对复杂一点,但提供了用于一个健壮的用于管理大型项目的框架,非常适合用来管理大型项目的发布和维护. 贯穿整个开发周期,master和develop分支是一直存在的,master分支可以被视为稳定的分支, 而develop分支是相对稳定的分支,特性开发会在feature分支上进行,发布会在release分支上进行,而bug修复则会在

Jenkins - JIRA - GitLab 集成技巧(流程自动化概念)

应用场景: 公司已经开始大规模推行持续集成的概念,我们也在采用敏捷方式进行测试与开发.所以我们在工具选型时选择了jenkins + gitlab + jira. 那么怎么才能让三者有机结合,让提交代码来触发jira上ticket的状态转换呢? 下面介绍一个jenkins 上的插件JIRA Plugin 1.先於JIRA新增一個user: jenkins(实际使用中,可以使用已存在的jira用户用来当做操作账号),並於專案設定中將此帳號設為Developers的一員. 2.并于JIRA的设定中将A