[JIRA] (JENKINS-57572) how to use pipeline sh git add tag?

1 view
Skip to first unread message

329247072@qq.com (JIRA)

unread,
May 21, 2019, 12:08:03 AM5/21/19
to jenkinsc...@googlegroups.com
chongjing zhao created an issue
 
Jenkins / Patch JENKINS-57572
how to use pipeline sh git add tag?
Issue Type: Patch Patch
Assignee: Unassigned
Components: pipeline
Created: 2019-05-21 04:07
Priority: Minor Minor
Reporter: chongjing zhao

my jenkins in running k8s

i want use pipeline script

sh 'git tag'

 it can't work, error  code 127

Here's my pipeline code

 

podTemplate(label: 'docker-pod-git', containers: [
containerTemplate(
name: 'docker',
image: 'docker:stable',
ttyEnabled: true,
command: 'cat'
),

containerTemplate(
name: 'jnlp',
image: 'registry.cn-hangzhou.aliyuncs.com/google-containers/jnlp-slave:alpine',
args: '${computer.jnlpmac} ${computer.name}',
command: ''
)],
volumes: [
/persistentVolumeClaim(mountPath: '/home/jenkins', claimName: 'jenkins', readOnly: false),/
hostPathVolume(hostPath: '/root/work/jenkins', mountPath: '/home/jenkins'),
hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock'),
hostPathVolume(hostPath: '/tmp/', mountPath: '/tmp/'),
])
{
node ('docker-pod-git') {
container('docker')

{ git url: 'http://*****/git/saasvshop.git' , branch: 'release',credentialsId:'**' sh'git tag' }

}
}

 

here is console log

 
Fetching changes from the remote Git repository
> git rev-parse --is-inside-work-tree # timeout=10
> git config remote.origin.url ***# timeout=10
Fetching upstream changes from *** > git --version # timeout=10
using GIT_ASKPASS to set credentials
> git fetch --tags --progress *** +refs/heads/:refs/remotes/origin/
Checking out Revision b0381fb26733eaa594ee6f38beb50d94915b31cb (refs/remotes/origin/release)
> git rev-parse refs/remotes/origin/release^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/release^{commit} # timeout=10
> git config core.sparsecheckout # timeout=10
> git checkout -f b0381fb26733eaa594ee6f38beb50d94915b31cb
> git branch -a -v --no-abbrev # timeout=10
> git branch -D release # timeout=10
> git checkout -b release b0381fb26733eaa594ee6f38beb50d94915b31cb
Commit message: "修改"
> git rev-list --no-walk b0381fb26733eaa594ee6f38beb50d94915b31cb # timeout=10[Pipeline] sh[Pipeline] }[Pipeline] // container[Pipeline] }[Pipeline] // node[Pipeline] }[Pipeline] // podTemplate[Pipeline] End of PipelineERROR: script returned exit code 127
Finished: FAILURE
 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
Reply all
Reply to author
Forward
0 new messages