Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What artifacts to save for a nightly build?

Assume that I set up an automatic nightly build. What artifacts of the build should I save?

For example:

  • Input source code
  • output binaries

Also, how long should I save them, and where?

Do your answers change if I do Continuous Integration?

like image 691
Jay Bazuzi Avatar asked Oct 23 '08 17:10

Jay Bazuzi


2 Answers

You shouldn't save anything for the sake of saving it. you should save it because you need it (i.e., QA uses nightly builds to test). At which point, "how long to save it" becomes however long QA wants them.

i wouldn't "save" source code so much as tag/label it. I don't know what source control you're using, but tagging is trivial (performance & disk space) for any quality source control system. Once your build is tagged, unless you need binaries, there really isn't any benefit to just having them around because you can simply re-compile when necessary from source.

Most CI tools let you tag on each successful build. This can become problematic for some systems as you can easily have 100+ tags a day. For such cases I recommend still running a nightly build and only tagging that.

like image 148
Karl Seguin Avatar answered Nov 15 '22 12:11

Karl Seguin


Here are some artifacts/information that I'm used to keep at each build:

  • The tag name of the snapshot you are building (tag and do a clean checkout before you build)
  • The build scripts themselfs or their version number (if you treat them as a separate project with its own version control)
  • The output of the build script: logs and final product
  • A snapshot of your environment:
    • compiler version
    • build tool version
    • libraries and dll/libs versions
    • database version (client & server)
    • ide version
    • script interpreter version
    • OS version
    • source control version (client and server)
    • versions of other tools used in the process and everything else that might influence the content of your build products. I usually do this with a script that queries all this information and logs it to a text file that should be stored with the other build artifacts.

Ask yourself this question: "if something destroys entirely my build/development environment what information would I need to create a new one so I can redo my build #6547 and end up with the exact same result I got the first time?"

Your answer is what you should keep at each build and it will be a subset or superset of the things I already mentioned.

You can store everything in your SCM (I'd recommend a separate repository), but in this case your question on how long you should keep the items looses sense. Or you should store it to zipped folders or burn a cd/dvd with the build result and artifacts. Whatever you choose, have a backup copy.

You should store them as long as you might need them. How long, will depend on your development team pace and your release cycle.

And no, I don't think it changes if you do continous integration.

like image 36
user16120 Avatar answered Nov 15 '22 11:11

user16120