Using Jenkins to build versioned Mender artifacts

Just my 2 cents:

I would try to change this line following:

sh 'source lora-gateway-os/oe-init-build-env build lora-gateway-os && bitbake -e lora-gateway-os-base | grep MENDER_ARTIFACT_NAME'

to really see if variable is set properly in console. My guess is that Jenkins somehow filter this variable (or it’s not properly exported → BTW how do you export MENDER_ARTIFACT_NAME variable) and then default will be used.