JIRA plugin on jenkins not set the JIRA_ISSUES variable - jenkins

I have jenkins job for with GitHub Pull Request Builder.
In build, I added first step to set the JIRA_ISSUE variable.
JIRA: Add related environment variables to build
Extracts JIRA information for the build to environment variables.
Available variables:
JIRA_ISSUES - A comma separated list of issues which are referenced in the version control system changelog
JIRA_URL - Primary URL for the JIRA server
Typical usage:
Add this build step
Use the "Progress JIRA issues by workflow action" or "Move issues matching JQL to the specified version" with JQL like:
issue in (${JIRA_ISSUES})
Second step is to update these jira issues.
<builders>
<hudson.plugins.jira.JiraEnvironmentVariableBuilder plugin="jira#3.0.0"/>
<hudson.plugins.jira.JiraIssueUpdateBuilder plugin="jira#3.0.0">
<jqlSearch>issue in (${JIRA_ISSUES})</jqlSearch>
<workflowActionName>Ready for Review</workflowActionName>
<comment>add comment</comment>
</hudson.plugins.jira.JiraIssueUpdateBuilder>
</builders>
When I create PR, and it trigger the job, it not set JIRA_ISSUES
GitHub pull request #356 of commit 2e2b92d107a5460c4cc593fcab78c63f800d6472, no merge conflicts.
Setting status of 2e2b92d107a5460c4cc593fcab78c63f800d6472 to PENDING with url https://myjenkins.com/job/cicd-myjob-prtest-unittest/69/ and message: 'running tox...'
Using context: tox testing
[EnvInject] - Loading node environment variables.
Building remotely on myslave.node.box.com (linux) in workspace /var/lib/jenkins/workspace/cicd-myjob-prtest-unittest
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://mygithub.com/myuser/myproject.git # timeout=10
Fetching upstream changes from https://mygithub.com/myuser/myproject.git
> git --version # timeout=10
using GIT_ASKPASS to set credentials Github Service Account Username with token
> git fetch --tags --progress https://mygithub.com/myuser/myproject.git +refs/pull/*:refs/remotes/origin/pr/*
> git rev-parse refs/remotes/origin/pr/356/merge^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/pr/356/merge^{commit} # timeout=10
Checking out Revision 0ff9e43bbc1385303429f7bcf93fea36e8c455d3 (refs/remotes/origin/pr/356/merge)
> git config core.sparsecheckout # timeout=10
> git checkout -f 0ff9e43bbc1385303429f7bcf93fea36e8c455d3
Commit message: "Merge 2e2b92d107a5460c4cc593fcab78c63f800d6472 into 731994024e723b1257374f521b4784060df9e5b5"
First time build. Skipping changelog.
[JIRA] Setting JIRA_ISSUES to .
[JIRA] Updating issues using workflow action Ready for Review.
[JIRA] JQL: issue in ()
[JIRA] Updating issue MYPROJECT-1234
Setting status of 2e2b92d107a5460c4cc593fcab78c63f800d6472 to SUCCESS with url https://myjenkins.com/job/cicd-myjob-prtest-unittest/69/ and message: 'All is well.
'
Using context: tox testing
Finished: SUCCESS
The [JIRA] Updating issue MYPROJECT-1234 is from publisher
<publishers>
<hudson.plugins.jira.JiraIssueUpdater plugin="jira#3.0.0">
<issueSelector class="hudson.plugins.jira.selector.JqlIssueSelector">
<jql>issue=MYPROJECT-1234</jql>
</issueSelector>
<labels/>
</hudson.plugins.jira.JiraIssueUpdater>
</publishers>
If I look for change log for commit 2e2b92d107a5460c4cc593fcab78c63f800d6472 it has the jira issue in comment and title.
commit 2e2b92d107a5460c4cc593fcab78c63f800d6472 (HEAD -> MYPROJECT-1234, origin/MYPROJECT-1234)
Author: myuser <myuser#mygithub.com>
Date: Tue Aug 21 15:55:41 2018 -0500
MYPROJECT-1234: Tox testing
MYPROJECT-1234 change the data.
Why JiraEnvironmentVariableBuilder is not able to set JIRA_ISSUES to MYPROJECT-1234? while same exists in changelog.

Related

What's causing my Multibranch Pipeline to fail its scan?

I'm trying to set up a Multibranch pipeline in Jenkins with Bitbucket as the SCM. When I try to "Scan Multibranch Pipeline Now" this is the resulting console log.
> git --version # 'git version 2.36.0.windows.1'
using GIT_SSH to set credentials
> C:/Program Files/Git/cmd/git.exe ls-remote -h -- ssh://git(repo name here).git # timeout=10
Fetching upstream changes from origin
> C:/Program Files/Git/cmd/git.exe config --get remote.origin.url # timeout=10
using GIT_SSH to set credentials
> C:/Program Files/Git/cmd/git.exe fetch --tags --force --progress --prune -- origin +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: [Mon Jun 27 11:02:32 PDT 2022] Could not fetch branches from source 3387233e-6185-46fa-a65c-0d4072f28149
[Mon Jun 27 11:02:32 PDT 2022] Finished branch indexing. Indexing took 7.8 sec
FATAL: Failed to recompute children of MultiBranch Test
hudson.plugins.git.GitException: Command "C:/Program Files/Git/cmd/git.exe fetch --tags --force --progress --prune -- origin +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: Repository not found
The requested repository does not exist, or you do not have permission to access it.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2671)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2096)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:618)
at jenkins.plugins.git.AbstractGitSCMSource$8.run(AbstractGitSCMSource.java:602)
at jenkins.plugins.git.AbstractGitSCMSource$8.run(AbstractGitSCMSource.java:588)
at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:394)
at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:350)
at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:588)
at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283)
at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:641)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278)
at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:166)
at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1032)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)
Finished: FAILURE
Originally, the multibranch was able to scan the repo and find the branches with Jenkinsfiles, but now that no longer works. In the first multibranch test which scanned and created pipelines for branches, when I try to build those branches it fails the build with the same error as above "repository not found".
I have a successful single Pipeline working for the same repository, specifically the develop branch. It is able to build on commits and pull the jenkinsfile from the repo, so it doesnt seem there is an access issue, but that is what the Multibranch pipeline is running into.
--------UPDATE-----------
Randomly, the scan worked. We are not sure what/if any changes prompted the sudden correct performance.

Why does this "complicated" git clone/checkout cause gitversion to fail?

I have the following pipeline syntax code in a Jenkinsfile to clone a git repo:
checkout([$class: 'GitSCM',
branches: [[name: "${branch}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'SubmoduleOption',
disableSubmodules: false,
parentCredentials: false,
recursiveSubmodules: true,
reference: '',
trackingSubmodules: false],
[$class: 'LocalBranch',
localBranch: ""],
[$class: 'RelativeTargetDirectory',
relativeTargetDir: relative_dir]],
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: cred_id,
url: git_url]]])
Following is the output of one instance of this Jenkins job, which reveals the git commands used to clone a repo:
> git init /home/user/workspace/CICD/PRJ/repo/PRJ/repo/121/src # timeout=10
Fetching upstream changes from ssh://git#bitbucket.company.com:7999/PRJ/repo.git
> git --version # timeout=10
using GIT_SSH to set credentials user - ssh username with private key.
> git fetch --tags --progress -- ssh://git#bitbucket.company.com:7999/PRJ/repo.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git config remote.origin.url ssh://git#bitbucket.company.com:7999/PRJ/repo.git # timeout=10
> git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
> git config remote.origin.url ssh://git#bitbucket.company.com:7999/PRJ/repo.git # timeout=10
Fetching upstream changes from ssh://git#bitbucket.company.com:7999/PRJ/repo.git
using GIT_SSH to set credentials user - ssh username with private key.
> git fetch --tags --progress -- ssh://git#bitbucket.company.com:7999/PRJ/repo.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git rev-parse refs/remotes/origin/feature/hcf^{commit} # timeout=10
> git rev-parse refs/remotes/origin/refs/heads/feature/hcf^{commit} # timeout=10
Checking out Revision 37b9492373951ab0b4c70fa64a3320be58133e0e (refs/remotes/origin/feature/hcf)
> git config core.sparsecheckout # timeout=10
> git checkout -f 37b9492373951ab0b4c70fa64a3320be58133e0e # timeout=10
> git branch -a -v --no-abbrev # timeout=10
> git checkout -b feature/hcf 37b9492373951ab0b4c70fa64a3320be58133e0e # timeout=10
Commit message: "Uncomment set_fault"
> git rev-list --no-walk 59ce67929be6c901975596db509de7a72b3c557a # timeout=10
This same Jenkinsfile automatically applies git tags using gitversion like so:
docker run -u $(id -u ${USER}):$(id -g ${USER}) --rm -v "$(pwd):/repo" artifactory.company.com/gittools/gitversion:5.7.1 /repo
The above methods of git cloning and using gitversion to generate new git tags has been working fine for several months without incident.
Problem:
Today, gitversion failed unexpectedly when this Jenkins job was run to build a git branch that I cannot see anything unique about (versus the many successfully-built branches).
The error, below, seems to indicate an inability to identify development or release branches, which are dev and master, respectively, in our case.
+ docker run -u 1172002866:1172000513 --rm -v /home/user/workspace/CICD/PRJ/repo/PRJ/repo/121/src:/repo artifactory.company.com/gittools/gitversion:5.7.1 /repo
INFO [01/26/22 23:30:14:02] Working directory: /repo
INFO [01/26/22 23:30:14:26] Project root is: /repo/
INFO [01/26/22 23:30:14:26] DotGit directory is: /repo/.git
INFO [01/26/22 23:30:14:59] Begin: Loading version variables from disk cache
INFO [01/26/22 23:30:14:59] Cache file /repo/.git/gitversion_cache/AF7963E4F79300A465EFC56DBA14B2B679307C08.yml not found.
INFO [01/26/22 23:30:14:59] End: Loading version variables from disk cache (Took: 1.50ms)
INFO [01/26/22 23:30:14:61] Using latest commit on specified branch
INFO [01/26/22 23:30:14:62] Begin: Attempting to inherit branch configuration from parent branch
INFO [01/26/22 23:30:14:65] Begin: Finding branch source of 'feature/hcf'
INFO [01/26/22 23:30:14:66] End: Finding branch source of 'feature/hcf' (Took: 15.87ms)
INFO [01/26/22 23:30:14:67] Begin: Getting branches containing the commit '37b9492'.
INFO [01/26/22 23:30:14:67] Trying to find direct branches.
INFO [01/26/22 23:30:14:67] No direct branches found, searching through all branches.
INFO [01/26/22 23:30:14:67] Searching for commits reachable from 'origin/dev'.
INFO [01/26/22 23:30:14:69] The branch 'origin/dev' has no matching commits.
INFO [01/26/22 23:30:14:69] Searching for commits reachable from 'origin/master'.
INFO [01/26/22 23:30:14:70] The branch 'origin/master' has no matching commits.
INFO [01/26/22 23:30:14:70] Searching for commits reachable from 'origin/release-npm2'.
INFO [01/26/22 23:30:14:70] The branch 'origin/release-npm2' has no matching commits.
INFO [01/26/22 23:30:14:70] Searching for commits reachable from 'origin/release-npm3'.
INFO [01/26/22 23:30:14:71] The branch 'origin/release-npm3' has no matching commits.
INFO [01/26/22 23:30:14:71] Searching for commits reachable from 'origin/release-5944.0'.
INFO [01/26/22 23:30:14:72] The branch 'origin/release-5944.0' has no matching commits.
INFO [01/26/22 23:30:14:72] Searching for commits reachable from 'origin/release-5944.1'.
INFO [01/26/22 23:30:14:73] The branch 'origin/release-5944.1' has no matching commits.
INFO [01/26/22 23:30:14:73] End: Getting branches containing the commit '37b9492'. (Took: 63.52ms)
INFO [01/26/22 23:30:14:73] Found possible parent branches:
INFO [01/26/22 23:30:14:74] End: Attempting to inherit branch configuration from parent branch (Took: 116.47ms)
ERROR [01/26/22 23:30:14:82] An unexpected error occurred:
System.InvalidOperationException: Gitversion could not determine which branch to treat as the development branch (default is 'develop') nor releaseable branch (default is 'main' or 'master'), either locally or remotely. Ensure the local clone and checkout match the requirements or considering using 'GitVersion Dynamic Repositories'
at GitVersion.Configuration.BranchConfigurationCalculator.InheritBranchConfiguration(IBranch targetBranch, BranchConfig branchConfiguration, ICommit currentCommit, Config configuration, IList`1 excludedInheritBranches) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Configuration\BranchConfigurationCalculator.cs:line 137
at GitVersion.Configuration.BranchConfigurationCalculator.GetBranchConfiguration(IBranch targetBranch, ICommit currentCommit, Config configuration, IList`1 excludedInheritBranches) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Configuration\BranchConfigurationCalculator.cs:line 47
at GitVersion.GitVersionContextFactory.Create(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitVersionContextFactory.cs:line 40
at GitVersion.GitVersionCoreModule.<>c__DisplayClass0_0.<RegisterTypes>b__1() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\GitVersionCoreModule.cs:line 38
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at System.Lazy`1.get_Value()
at GitVersion.VersionCalculation.NextVersionCalculator.get_context() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\VersionCalculation\NextVersionCalculator.cs:line 17
at GitVersion.VersionCalculation.NextVersionCalculator.FindVersion() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\VersionCalculation\NextVersionCalculator.cs:line 32
at GitVersion.GitVersionCalculateTool.CalculateVersionVariables() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitVersionCalculateTool.cs:line 52
at GitVersion.GitVersionExecutor.RunGitVersionTool(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersion.App\GitVersionExecutor.cs:line 70
INFO [01/26/22 23:30:14:82] Attempting to show the current git graph (please include in issue):
INFO [01/26/22 23:30:14:82] Showing max of 100 commits
INFO [01/26/22 23:30:14:93] * 37b9492 3 minutes ago (HEAD -> feature/hcf, origin/feature/hcf)
What I have tried:
When I manually clone the repo and check out the branch using the above git commands, I can reproduce the gitversion failure.
When I "simplify" my git clone and branch checkout to just:
$ git clone ssh://git#bitbucket.company.com:7999/PRJ/repo.git
$ git checkout feature/hcf
$ docker run -u $(id -u ${USER}):$(id -g ${USER}) --rm -v "$(pwd):/repo" artifactory.company.com/gittools/gitversion:5.7.1 /repo
...then gitversion succeeds and returns an expected value.
Questions:
Can the Jenkinsfile checkout() statement be modified so that it is functionally identical to the "simple" git clone and git checkout statements? There is obviously some salient difference between the two "methods" of cloning from git and checking out branches that is relevant to gitversion.
If possible, I would prefer a solution that uses the Jenkins pipeline checkout() function over a shell script invocation like sh(script:"git clone...") -- but perhaps an experienced answerer can convince me that that preference isn't justified.
Can someone explain how I can determine what is "unique" about this particular git repo or branch? With other repos/branches, the above checkout() statement in our Jenkinsfile continues to work simpatico with the subsequent gitversion invocation. So it would seem there is something unique about this one failing case that I don't know how to determine.
I don't use Jenkins myself, but it looks like the develop branch is missing from its clone of the repository, which may indicate that Jenkins is doing a sparse or shallow clone. As stated in GitVersion's requirements, it needs a full clone of the repository in order to do its calculations.
The reason your git clone && git checkout statements work is because, by default, Git performs a full clone of the repository. What you need to do is instruct Jenkins to do an unshallow clone of the repository. GitVersion's Jenkins documentation lists a number of things you can and should do to have GitVersion work properly:
Advanced clone behaviors
Enable Fetch tags
Enable Honor refspec on intial clone
Check out to matching local branch
Prune stale remote-tracking branches
Specify ref specs
Ref Spec: +refs/heads/*:refs/remotes/#{remote}/*
With the above Jenkins settings tuned correctly, it should work.

Jenkins - Couldn't find any revision to build

I have been using Jenkins for a few days, and before: I used the GITEA plugin
Now that I have switched my projects to GitBucket, I would like to use the "Build by Webhook" Feature.
I followed many tutorials, and now : i'm stuck on a simple/big problem.
In advance, I'm sorry to have to blur the sensitive links, I know it can be annoying.
Here is the full error :
using credential 10
Wiping out workspace first.
Contributing variables:
Cloning the remote Git repository
Cloning repository https://MY_GITBUCKET/git/MY_USERNAME/MY_PROJECT
> git init /Jenkins/workspace/GitBUcket # timeout=10
Fetching upstream changes from https://MY_GITBUCKET/git/MY_USERNAME/MY_PROJECT
> git --version # timeout=10
> git --version # 'git version 2.20.1'
using GIT_ASKPASS to set credentials Utilisateur GitBucket Perso
> git fetch --tags --force --progress -- https://MY_GITBUCKET/git/MY_USERNAME/MY_PROJECT +refs/heads/*:refs/remotes/origin/* # timeout=10
> git config remote.origin.url https://MY_GITBUCKET/git/MY_USERNAME/MY_PROJECT # timeout=10
> git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
Avoid second fetch
Seen 0 remote branches
> git show-ref --tags -d # timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE
Here is my configuration on Jenkins : https://i.stack.imgur.com/jdlTt.png
Thank you very much in advance
EDIT : My only branche is master --> https://i.imgur.com/lXJ0xyN.png
This is what you can try:
Manage Jenkins -> Global Tool Configuration -> Git
Check if Path to Git executable is set: C:\PATH\git.exe
Dashboard -> select your job -> Configure -> Source Code Management -> select Git
Insert your Repository URL and Credentials(Optional) then under Branches to build change */master to */main.

Simple Jenkins application to show gcc version

I am after a simple Jenkin application to show gcc version after each push to bitbucket.
Here is the Jenkinsfile:
pipeline {
agent { docker { image 'kernelci/build-gcc-7_arm:3.3.3' } }
stages {
stage('build') {
steps {
sh 'gcc --version'
}
}
}
}
Bitbucket
Repository Settings/Post Webhooks:
http://jenkins.SOMEADDRESS:8080/bitbucket-scmsource-hook/notify
After each push, the build does not start automatically but not a problem. I starts the builds manually.
However, The Jenkin build output result looks like this
Started by user MY_USERNAME
[Office365connector] No webhooks to notify
Building on master in workspace c:\w\PROJECTNAME
> git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git.exe config remote.origin.url http://bb.MYWEBSITE.COM/scm/bbb/MYREPO.git # timeout=10
Fetching upstream changes from http://bb.MYWEBSITE.COM/scm/bbb/MYREPO.git
> git.exe --version # timeout=10
using GIT_ASKPASS to set credentials Credentials for Jenkins in Bitbucket
> git.exe fetch --tags --progress http://bb.MYWEBSITE.COM/scm/bbb/MYREPO.git +refs/heads/*:refs/remotes/origin/*
Seen branch in repository origin/feature/LAST_BRANCH
Seen branch in repository origin/feature/BRANCH_A
Seen branch in repository origin/feature/BRANCH_B
Seen branch in repository origin/feature/BRANCH_C
Seen branch in repository origin/feature/BRANCH_D
Seen branch in repository origin/feature/BRANCH_E
Seen branch in repository origin/feature/BRANCH_F
Seen branch in repository origin/feature/BRANCH_G
Seen 8 remote branches
> git.exe show-ref --tags -d # timeout=10
Checking out Revision e3152f566543dfb813c6e33ac0d1099da7ec26a6 (origin/LAST_BRANCH)
> git.exe config core.sparsecheckout # timeout=10
> git.exe checkout -f e3152f566543dfb813c6e33ac0d1099da7ec26a6
Commit message: "Merge branch 'feature/BRANCH_A' into LAST_BRANCH"
First time build. Skipping changelog.
[Office365connector] No webhooks to notify
Finished: SUCCESS
It does not look like loading a dock in 4 seconds. I do not see any gcc version on the screen either. Where is the problem from?
Is it from Jenkinsfile?

Jenkins Job Build Failure

After job build starts in jenkins my git-lab server's memory becomes full. Job is successful after restarting the Jenkins server.Jenkins has become too slow Sometimes Error comes with signal 9 also. Thank-you in advance. I have attached the log of the failed build.
started by user ME
Building in workspace /var/lib/jenkins/workspace/my_Project
using credential ABC
> /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /usr/bin/git config remote.origin.url git#myrepo:root/My_Project.git # timeout=10
Fetching upstream changes from git#myrepo:root/My_Project.git
> /usr/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials
> /usr/bin/git fetch --tags --progress git#myrepo:root/My_Project.git +refs/heads/*:refs/remotes/origin/*
> /usr/bin/git rev-parse refs/remotes/origin/My_Project_Develop^{commit} # timeout=10
> /usr/bin/git rev-parse refs/remotes/origin/origin/My_Project_Develop^{commit} # timeout=10
Checking out Revision fbd8fcef97895366d1d08bccb22615712d1f9ef0 (refs/remotes/origin/My_Project_Develop)
> /usr/bin/git config core.sparsecheckout # timeout=10
> /usr/bin/git checkout -f fbd8fcef97895366d1d08bccb22615712d1f9ef0
Commit message: "Update features of Software."
> /usr/bin/git rev-list --no-walk fbd8fcef97895366d1d08bccb22615712d1f9ef0 # timeout=10
Checking for pre-build
Executing pre-build step
Checking if email needs to be generated
No emails were triggered.
[My_Project] $ /bin/sh -xe /tmp/jenkins6218118938138193412.sh
+ id -un
root
+ SSH_OPTS='-o StrictHostKeyChecking=no -o ConnectTimeout=5'
+ sudo git checkout My_Project_Develop
Previous HEAD position was fbd8fce... Update features of Software.
Switched to branch 'My_Project_Develop'
Your branch is behind 'origin/My_Project_Develop' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
Build step 'Execute shell' marked build as failure
Discard old builds...
#1040 is removed because status FAILURE is not to be kept
Checking for post-build
Performing post-build step
Checking if email needs to be generated
No emails were triggered.
Finished: FAILURE
You need to pull the My_Project_Develop branch, checkout is only switching to this branch. Your branch is locally behind the server.
The message is clear:
Your branch is behind 'origin/My_Project_Develop' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
Usually this is done by Jenkins. I need more info how you run this job.

Resources