We are currently using phing on deployment from jenkins to our different environments. We use it to do some cleanup. We would like to remove phing from our source/vendor folder after the build is completed.
Can phing remove itself as a final build step?
Or should i just be doing an rm -rf phing/?
There are two parts to this answer:
Solution for Question
Your Phing installation should be done with composer. Do
composer require phing/phing- and then you can usevendor/bin/phingto run yourbuild.xmlfile (instead of say using a global install).Then, when you're done, your last step to run could be
composer remove phing/phingSuggested Workflow
So, the idea with something like Jenkins is that you should be using it to do all of your build and processing on a build system. Then, it (Jenkins) is the tool that can do anything else on the remote systems for you. So, instead of having phing on the deployed server and then have it doing tasks, you'd tell Jenkins to do those tasks remotely. (This might be accomplished by each step having to re-ssh into that server to execute a new step). As these steps are part of the deploy process too, if any of them fail, the build will be considered failed and you'll have that insight. So, that being said, the solution I suggest is above, but I'd recommend changing everything else up.