Git – Diff file between last and last commit

This line checks the change of the “configmap.yml” file between the last and the last but one commit, if there was a change in it, then the configmap update in Kubernetes is performed.

if git diff HEAD^ HEAD .jenkins/configmap.yml | grep -q configmap; then ${KUBECTL} apply -f .jenkins/configmap.yml; fi

Tagged: Tags

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments