What is headless build

What is headless build

恩,恕我无知,跟老美交流的时候突然看到一个headless build,话说还真不明白,但又不好意思问,所以先google了一把,算是了解个一知半解。

什么是headless build:

workbench (IDE or UI) is referred to as 'head'. Headless build essentially means running the builds from command line in non-UI mode.

简单的说就是build不是通过IDE或者UI来跑的,而是通过一些命令行等非UI的模式来跑。如果通过java jar的命令,ant文件等。


例子:

java -jar <eclipse-installation-path>pluginsorg.eclipse.equinox.launcher_<version><qualifier>.jar -application org.eclipse.ant.core.antRunner -buildfile <eclipse-workspace-path><project-name><build-xml-path>


The benefit of headless build:

1. Headless builds do not require the IDE

Why is this important? It's probably more an architectural/soft advantage. I mean why would you spend time replicating offline what you can do in an IDE. The primary advantage here is that it means that it allows a whole slew of other tweaks, so this is not valuable in and of itself but it is what allows other advantages.

2. Headless builds are repeatable - this is the no brainer reason why you want headless build - so that you can have repeatable builds. The problem with building from the IDE is that you never actually know what code the developer had in his workspace when he made the build. If you don't know what code is in a build you don't know where to go to fix the problems. Maybe the problem stems from that random code the developer was working on when he made the build. I would go so far as to say that a build made from a developers workstation is about as much use as old chewing gum.
3. Headless builds do not require a developer - the last thing I want as a developer is to be keep getting queries saying, please come and do a build for us. I don't think the downstream entities (testers, deployment people) want to do this, but in a context with no headless build they are forced into doing this. What is more is these people cannot do more than click a "build" link to make a build. They certainly cannot start the IDE, check the code out, select the project, select build all, then do an export etc. They certainly, since they are not developers, cannot use an IDE to make their own build.
4. Headless builds are automated - once you have headless build infrastructure in place, be it ant, msbuild or shell scripting, you can build on that basis by adding things like tagging of the code, tagging of the generated artifact. Maybe even include in the built artifact some mechanism to show the tester the version tag. No uncertainty as far as which version of the code you're running. workbench (IDE or UI) is referred to as 'head'. Headless build essentially means running the builds from command line in non-UI mode. This can be achieved by various means, however, we will start with java command line and org.eclipse.equinox.launcher jar. workbench (IDE or UI) is referred to as 'head'. Headless build essentially means running the builds from command line in non-UI mode. This can be achieved by various means, however, we will start with java command line and org.eclipse.equinox.launcher jar.

推荐阅读