Closed phillipjohnston closed 2 years ago
Maybe we can put the smarts into the Makefile somehow.
Or a nightly_build.sh script.
Or a nightly_build.sh script.
I am not familiar with how to propagate the result of the script to the Jenkins system (to stop or not the build stage), but below are two options to check against the git log.
Based on the last tag name, similar to what we have in the Makefile to extract the last version:
(this will work assuming there is no -
in the tag names)
#!/bin/bash
last_tag=$(git describe --long --dirty --tags)
tokens=(${last_tag//-/ })
number_of_commits_from_last_tag=${tokens[1]}
#echo ${last_tag}
#echo ${number_of_commits_from_last_tag}
if [ ${number_of_commits_from_last_tag} -gt 0 ]
then
echo 'do work'
else
echo 'nothing to do...'
fi
Based on the last committer, if it is not Embedded Artistry Buildbot
:
(this will work assuming Buildbot does not commit "something" that needs to trigger a new nightly build)
#!/bin/bash
if ! (git log -1 --pretty=format:'%an' | grep -iq buildbot)
then
echo 'do work'
else
echo 'nothing to do...'
fi
I experimented a bit with Jenkins:
there are setting that you might use, which are not available for Multibranch Pipeline, like Polling ignores commits with certain messages
or Polling ignores commits from certain users
.
But I think that we don't really need to keep (push) the build results. They are uploaded to the release area anyway. If we go that direction:
stage('Commit Updated Images')
can stay out of the pipelinepollSCM
trigger should go back in.hex
filesthis way, the pipeline will just Tag & create a new release with the new changes. If someone decides to clone the code, I assume he will want to build it anyway.
I agree, and I think with the work on being able to use the board manager will also obviate the need to clone (whereas before that wasn't an option)
I still needed to resolve this to address auto-generating the JSON file for each set of generated files. But this is now fixed - builds will abort if there have been no commits since the previous tag was created. Tags are created by the nightly build configuration after the JSON is committed.
Because the nightly build starts with a new tag, the build step will always generate new images (version number has changed), causing nightly builds to continually run even when there are no other changes.
For now, this has been removed.