0

For example I have this command

generate-and-deploy-new-version ./site-directory

and I want to run it only if content of the ./site-directory was changed.

if checkchanges "./site-directory" ; then
  generate-and-deploy-new-version ./site-directory
fi

checkchanges could generate some hash of the directory content, save it in file and check it next time it will run.

ais
  • 101
  • 1
  • Do you want to run it every time it's updated, or periodic? – vidarlo Aug 25 '23 at 08:16
  • Integrity checking is relatively expensive and becomes more expensive that larger your deployment becomes so the common approach is to assume that the current version was deployed correctly and hasn't been modified/damaged since deployment ==> then checking for a version string should enough. You then apply some logic `installed_version != latest ; install latest` and `if force-reinstalll == yes ; install latest` – HBruijn Aug 25 '23 at 09:33
  • @vidarlo I want to run it periodically. – ais Aug 25 '23 at 09:39

0 Answers0