4

I apologise in advance if this question seems obvious to some or whether this question should not even be asked.

I have done research about the build process and I do understand the purpose of building for Java, C++, and others because of compiling and generating an executable code. I also understand that build isn't just compiling as it build the dependencies and artefacts. When we develop PHP on Eclipse project, it builds the code when changes are done.

Howevever, I do not understand why it is recommended to build PHP project on release. Most of the time, releases of PHP releases are done via FTP transfer onto the production server.

Why do software companies need to do continuous build of PHP code for different releases?

Once again, I apologise if this question is not relevant.

  • Besides the points Doc mentioned, also do not forget the vendor directory. You're not supposed to be versioning that, so composer install is usually part of PHP build process, too. – Andy Nov 27 '17 at 18:47
7

It depends on what you actually call "Build", especially when you say "Continuous Build".

If one defines "Build" in the narrow sense of compiling some source code into a binary executable, then you are right, such a "Build" step does not make sense for an interpreted language like PHP. However, for some people a "Build" step is defined by everything which happens between editing of the final line of code before a version gets release, and the actual deployment. This could include, for example

  • execution of all automatic tests

  • running code or documentation generators

  • packaging for potential distribution/deployment

  • versioning / tagging in the SCCS

  • (... whatever is necessary as a pre-deployment step for a software system of a particular size)

When there is a Continuous Integration Server, these steps may be executed every night during the "nightly build step", even for a pure PHP-based system.

releases of PHP releases are done via FTP transfer onto the production server

That is a way of deployment, not "build", and it should happen after all pre-deployment steps are executed. I hope I don't have to explain why the named examples of pre-deployment above steps make sense for almost any professional software company.

  • From what I understand, the term 'Build' has changed over the past year to include the steps which can be automated as you have mentioned in the pre-deployment process. This makes sense as we would want to automate how much as possible and hence continuous integration gets in the picture. I'll research more on continuous integration. Thanks @Doc Brown, this helps a lot. – mokko211 Nov 27 '17 at 16:48
  • 2
    @mokko211: I checked the history of the Wikipedia article on Software Builds, the sentence "[Compilation] is only a small feature of managing the build process" was introduced in 2014. However, I am pretty sure this "wisdom" is much older, at least a decade. – Doc Brown Nov 27 '17 at 17:11
  • 1
    At least on the parts of Brazil that I worked at, this process would be called Deployment Cycle, not "build". The "Build" was a step among several others in the deployment cycle. Building certainly isn't an end-to-end process as wikipedia claims, too! – T. Sar Nov 27 '17 at 18:49
  • @T.Sar:sure, different people and organizations define the precise lines between development, build and deployment differently, exactly what I wrote in my answer. – Doc Brown Nov 28 '17 at 9:02
  • Yep. I'm in agreement with you - just adding my two cents that what you're talking about happens on my country, too. – T. Sar Nov 28 '17 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.