{"id":10602,"date":"2015-12-15T11:46:03","date_gmt":"2015-12-15T11:46:03","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2015\/12\/15\/php-build-task-from-cory-fowlers-devops-phpworld-presentation\/"},"modified":"2022-08-02T06:03:07","modified_gmt":"2022-08-02T14:03:07","slug":"php-build-task-from-cory-fowlers-devops-phpworld-presentation","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/php-build-task-from-cory-fowlers-devops-phpworld-presentation\/","title":{"rendered":"PHP Build Task from   Cory Fowler\u2019s DevOps PHPWorld Presentation"},"content":{"rendered":"<p>As you may have seen from the <a href=\"https:\/\/channel9.msdn.com\/Series\/Test-Tools-in-Visual-Studio\/Performance-Testing-in-DevOps-workflows\">DevOps presentation<\/a> I have been hanging out with Cory lately\u2026<\/p>\n<p>For his PHPWorld Presentation we teamed up to see how hard it would be to get our DevOps demo working with PHP.\u00a0 Specifically creating a CI build for PHP and as part of that pipeline run a load test\u2026turns out it was a piece of cake and it took longer to write this post than get it set up!!<\/p>\n<p>Below are the steps to create a release pipeline with PHP using Composer and Visual Studio Online<\/p>\n<h4><font style=\"font-weight: bold\">Step 1. <\/font>Check in your PHP Project<\/h4>\n<p><img decoding=\"async\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/2021.image_thumb_488636B3.png\" width=\"711\" height=\"475\" \/><\/p>\n<p>In this case we used Cory\u2019s super simple Composer Sample\u00a0 <a href=\"https:\/\/github.com\/SyntaxC4-MSFT\/WAWS-Composer\">https:\/\/github.com\/SyntaxC4-MSFT\/WAWS-Composer<\/a><\/p>\n<h4><font style=\"font-weight: bold\">Step 2. <\/font>Add a Custom Build Task in VSO to Package your PHP Application<\/h4>\n<p>Creating a custom build task is pretty straightforward and requires these steps<\/p>\n<ol>\n<li>Download the Build Task sample: Composer.Zip from <u><strong><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/02\/ComposerTask.zip\">here<\/a><\/strong><\/u><\/li>\n<li>Install Npm <a href=\"https:\/\/nodejs.org\/dist\/v4.2.2\/node-v4.2.2-x86.msi\">https:\/\/nodejs.org\/dist\/v4.2.2\/node-v4.2.2-x86.msi<\/a><\/li>\n<li>Install the <a href=\"https:\/\/www.npmjs.com\/package\/tfx-cli\">TFX-CLI<\/a> by running: <strong>npm install -g tfx-cli<\/strong><\/li>\n<li>Run <strong>tfx login<\/strong>. (requires PAT which can be created using these directions <a href=\"http:\/\/roadtoalm.com\/2015\/07\/22\/using-personal-access-tokens-to-access-visual-studio-online\/\">http:\/\/roadtoalm.com\/2015\/07\/22\/using-personal-access-tokens-to-access-visual-studio-online\/<\/a>) <\/li>\n<li><strong>tfx build tasks upload .\/ComposerTask<\/strong><\/li>\n<\/ol>\n<p>(<a href=\"http:\/\/blog.devmatter.com\/custom-build-tasks-in-vso\/\">Jeff Bramwell<\/a> did a great post on creating a Build task\u2026If you go through his walk through just be aware the **tfx build tasks create **is currently broken so I have uploaded my sample here)<\/p>\n<h4><font style=\"font-weight: bold\">Step 3. <\/font>Create a Build that Uses the Composer Task created above<\/h4>\n<p>1&#46; One the Build Task hit the green action button and select the \u201cEmpty\u201d Template<\/p>\n<p><img decoding=\"async\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/3531.image_thumb_2ECA42ED.png\" width=\"438\" height=\"378\" \/><\/p>\n<p>2&#46; As this build will require PHP and Composer to installed on the Build agent please Press Next and select the on premises agent as described in Cory\u2019s blog<strong><link><\/strong> and then press Create<\/p>\n<p><img decoding=\"async\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/0576.image_thumb_51EF7818.png\" width=\"585\" height=\"578\" \/><\/p>\n<p>3&#46; Adding a task to your Build you will see in the Package category the Composer Task created in Step 2.\u00a0 While there are options you send to composer the default will package your PHP application.<\/p>\n<p><img decoding=\"async\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/8306.image_thumb_309A98B4.png\" width=\"657\" height=\"439\" \/><\/p>\n<p>4&#46; Verify the deployment was successful<\/p>\n<p>Adding a quick web performance test will easily tell you whether your deployment was successful (Oft times that packaging and deploying will \u201csucceed\u201d but the application has run time issues)<\/p>\n<p><img decoding=\"async\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/5187.image_thumb_730D3AEA.png\" width=\"536\" height=\"494\" \/><\/p>\n<p>Set up the parameters for your quick performance test:<\/p>\n<p><img decoding=\"async\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/8053.image_thumb_72A107F5.png\" width=\"619\" height=\"352\" \/><\/p>\n<p>To create a registered Connection you must go to control panel add a generic service\u2026<\/p>\n<p>**REMEMBER THIS REQUIRES A PAT OR ALTERNATE CREDENTIALS. **<\/p>\n<p>I always seem to forget this!\u00a0 Directions for setting that are here:<\/p>\n<p><a href=\"http:\/\/roadtoalm.com\/2015\/07\/22\/using-personal-access-tokens-to-access-visual-studio-online\/\">http:\/\/roadtoalm.com\/2015\/07\/22\/using-personal-access-tokens-to-access-visual-studio-online\/<\/a><\/p>\n<p><img decoding=\"async\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/12\/5153.image_thumb_00071AFC.png\" width=\"604\" height=\"429\" \/><\/p>\n<p>At this time you are ready to save and QUEUE NEW BUILD BABY!<\/p>\n<p>Attachment: <img decoding=\"async\" border=\"0\" alt=\"\" src=\"\" \/> ComposerTask.zip<\/p>\n<pre><code>&lt;p&gt;&lt;a&gt;&lt;\/a&gt;&lt;\/p&gt;\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>As you may have seen from the DevOps presentation I have been hanging out with Cory lately\u2026 For his PHPWorld Presentation we teamed up to see how hard it would be to get our DevOps demo working with PHP.\u00a0 Specifically creating a CI build for PHP and as part of that pipeline run a load [&hellip;]<\/p>\n","protected":false},"author":77,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[226,1],"tags":[],"class_list":["post-10602","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ci","category-devops"],"acf":[],"blog_post_summary":"<p>As you may have seen from the DevOps presentation I have been hanging out with Cory lately\u2026 For his PHPWorld Presentation we teamed up to see how hard it would be to get our DevOps demo working with PHP.\u00a0 Specifically creating a CI build for PHP and as part of that pipeline run a load [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/10602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=10602"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/10602\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=10602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=10602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=10602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}