Hey Guys, I am running a Jenkins job that deploys to aws beanstalk, I want in the description to have the the commit message and I am using ${GIT_COMMIT} env variable. What I am getting is the commit hash and not the message. I've installed the Git

13 views
Skip to first unread message

amit shohat

unread,
Jan 18, 2018, 6:43:38 AM1/18/18
to Jenkins Users
Hey Guys,

I am running a Jenkins job that deploys to aws beanstalk, I want in the description to have the the commit message and I am using ${GIT_COMMIT} env variable.
What I am getting is the commit hash and not the message.
I've installed the Git Tag Message plugin and enabled it in Additional Behaviours in source code management.
I am using the ${GIT_TAG_MESSAGE} in the aws deploy stage and it's not recognized.
I am using a freestyle project.
I've tried to capture the following commands:
git log -1 --oneline $GIT_COMMIT
git log -1 --pretty='%s' $GIT_COMMIT

But can't seem to capture it.
This is what I am getting:
[wp-az] $ /bin/sh -xe /tmp/jenkins6734038198136655184.sh
++ git log -1 --pretty=%s cdb858f3b84328184c6f83a2e79e8571a63d814c
+ Update README.md

I don't think we are taging our commits in github.

Would appreciate any assistance on how to deliever the commit message.
Thanks.

Baptiste Mathus

unread,
Feb 6, 2018, 4:46:28 PM2/6/18
to jenkins...@googlegroups.com
Just use that Sha to and pass it using sh to a call to the right git command. It should be fairly easy to find it by searching internet. And if you don't find it or it doesn't work please come ask again.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/58433224-c405-4906-a523-3b1a8e289c22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages