<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>deploy | Nerdpress.org</title>
	<atom:link href="https://nerdpress.org/tag/deploy/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Mon, 17 Nov 2014 10:55:06 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>git deploy with composer install hook</title>
		<link>https://nerdpress.org/2014/11/14/git-deploy-composer-install-hook/</link>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Fri, 14 Nov 2014 07:51:00 +0000</pubDate>
				<category><![CDATA[Composer]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[composer]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[Git]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2572</guid>

					<description><![CDATA[<p>I usually would not recommend deployment via git and running composer on your prod server for several reasons like f.e. the network. I rather believe in builds. But sometimes its just too convenient :) So i have this uncritical smaller API app where the hosting has git, ssh access and i am in full control &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2014/11/14/git-deploy-composer-install-hook/" class="more-link">Continue reading<span class="screen-reader-text"> "git deploy with composer install hook"</span></a></p>
The post <a href="https://nerdpress.org/2014/11/14/git-deploy-composer-install-hook/">git deploy with composer install hook</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>I usually would not recommend deployment via git and running <a href="https://getcomposer.org/">composer</a> on your prod server for several reasons like f.e. the network. I rather believe in builds.<br />
But sometimes its just too convenient :)</p>
<p>So i have this uncritical smaller API app where the hosting has git, ssh access and i am in full control and i decided too keep it simple.<br />
<span id="more-2572"></span></p>
<p>For deploy i login via ssh and make a <strong>git pull</strong> too fetch the code.<br />
Now we need to make a <strong>composer install</strong>, if the composer.lock has changes to fetch all php dependencies.<br />
Therefor i found a handy bash script, tweaked it a bit and installed it as post-merge git hook.</p>
<p>Install the hook:</p>
<pre class="brush: bash; title: ; notranslate">
cd project
nano .git/hooks/post-merge #paste &amp; edit the script
chmod 775 .git/hooks/post-merge 
</pre>
<p>What it does?<br />
After all code from the <strong>git pull</strong> is merged into the working tree, the hook checks if the composer.lock has changed. If so it will run a <strong>composer install</strong>.<br />
Note that it runs with <strong>&#8211;no-dev</strong> since we are on production and dont need f.e. phpunit there.</p>
<p>I know you know, but let it be said again: run <strong>composer install</strong> not <strong>composer update</strong>, as you never should run composer update on production, read why <a href="http://adamcod.es/2013/03/07/composer-install-vs-composer-update.html">here</a>.</p>
<p>So here is the bash:</p>
<pre class="brush: bash; title: ; notranslate">
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# forked by Gianluca Guarini
# phponly by Ivo Bathke ;)
 
changed_files=&quot;$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)&quot;
 
check_run() {
  echo &quot;$changed_files&quot; | grep --quiet &quot;$1&quot; &amp;&amp; eval &quot;$2&quot;
}
 
# `composer install` if the `composer.lock` file gets changed
# to update all the php dependencies
check_run composer.lock &quot;composer install --no-dev&quot;
</pre>
<p>I <a href="https://gist.github.com/ivoba/6dcdff1d8eaed7e53ec6">forked</a> it from <a href="https://gist.github.com/GianlucaGuarini/8001627">here</a>, that forked from <a href="https://gist.github.com/sindresorhus/7996717">there</a>.</p>The post <a href="https://nerdpress.org/2014/11/14/git-deploy-composer-install-hook/">git deploy with composer install hook</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Boilerplate Build mit FTP deploy</title>
		<link>https://nerdpress.org/2011/09/13/boilerplate-build-mit-ftp-deploy/</link>
					<comments>https://nerdpress.org/2011/09/13/boilerplate-build-mit-ftp-deploy/#comments</comments>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Tue, 13 Sep 2011 09:12:02 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Project Setup]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[boilerplate]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[yui-compressor]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1652</guid>

					<description><![CDATA[<p>Da habe ich mir letztens die html5 boilerplate angeschaut und musste feststellen, dass die einen ziemlich guten build mitbringt. Dieser optimiert Bilder, konkateniert und komprimiert alles was so geht, mit Hilfe von u.a. dem YUI Kompressor. Was es noch nicht kann ist der Deploy, aber das kann man ihm ja beibringen ;) Nun denn, direkt &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2011/09/13/boilerplate-build-mit-ftp-deploy/" class="more-link">Continue reading<span class="screen-reader-text"> "Boilerplate Build mit FTP deploy"</span></a></p>
The post <a href="https://nerdpress.org/2011/09/13/boilerplate-build-mit-ftp-deploy/">Boilerplate Build mit FTP deploy</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Da habe ich mir letztens die <a href="http://html5boilerplate.com/">html5 boilerplate</a> angeschaut und musste feststellen, dass die einen ziemlich guten build mitbringt.<br />
Dieser optimiert Bilder, konkateniert und komprimiert alles was so geht, mit Hilfe von u.a. dem YUI Kompressor.<br />
Was es noch nicht kann ist der Deploy, aber das kann man ihm ja beibringen ;)</p>
<p><span id="more-1652"></span>Nun denn, direkt mal probieren, der Post <a href="http://net.tutsplus.com/tutorials/html-css-techniques/automated-optimization-with-html5-boilerplate-build/">hier</a> beschreibt schon ziemlich gut was und wie man da was machen kann.</p>
<p>Ich benutze noch ant 1.8.0, also machen wir was uns vorgeschlagen wird:</p>
<blockquote><p>All features of the build script require Ant version 1.8.2. Please upgrade to 1.8.2 or remove all instances of &#8216;overwrite=no&#8217; (and this fail task) from the build script to continue</p></blockquote>
<p>Also alle overwrite Attribute raus und den Test Task rausnehmen:<br />
Den Testtask rausnehmen:</p>
<pre class="brush: xml; title: ; notranslate">
 &lt;fail message=&quot;All features of the build script require Ant version 1.8.2. Please upgrade to 1.8.2 or remove all instances of 'overwrite=no' (and this fail task) from the build script to continue&quot;&gt;
        &lt;condition&gt;
            &lt;not&gt;
                &lt;contains string=&quot;${ant.version}&quot; substring=&quot;1.8.2&quot;/&gt;
            &lt;/not&gt;
        &lt;/condition&gt;
 &lt;/fail&gt;
</pre>
<p>Dann probieren:</p>
<pre class="brush: bash; title: ; notranslate">
cd build
ant
</pre>
<p>Und funktioniert: in publish liegt jetzt das optimierte Web Projekt.</p>
<p>Danach noch die buffer folder leeren, ist nicht unbedingt nötig aber macht Spaß :)</p>
<pre class="brush: bash; title: ; notranslate">ant clean</pre>
<p>Um die Bilder Optimierung anzuschalten, muss ich noch die libs dafür nach installieren:</p>
<pre class="brush: bash; title: ; notranslate">sudo apt-get install libjpeg-progs optipng</pre>
<p>Kleiner Tip noch:<br />
Nutzt man zusätzliche javascript libs, die nicht konkateniert werden sollen, sollte man die nicht zwischen die comments schreiben.<br />
Diese hier:</p>
<pre class="brush: xml; title: ; notranslate">
 &lt;!-- scripts concatenated and minified via ant build script--&gt;
 &lt;!-- end scripts--&gt;
</pre>
<p>Und um es auf die Spitze zu treiben lassen wir mal den vollen minify laufen:</p>
<pre class="brush: bash; title: ; notranslate">ant minify</pre>
<p>Der komprimiert zusätzlich noch das Markup.</p>
<p>Aufräumen:</p>
<pre class="brush: bash; title: ; notranslate">ant clean</pre>
<p>Nun noch den publish folder uploaden:<br />
Ich will ja FTP via ant benutzen also vorher die Abhängigkeiten davon installieren, siehe hier in einem alten <a href="https://nerdpress.org/2011/07/29/install-ant-ftp-task-on-ubuntu/">Post</a> von mir.<br />
Außerdem muss man noch die FTP properties angeben, das passiert in config/project.properties:</p>
<pre class="brush: bash; title: ; notranslate">
 #FTP deploy
 tool.ftp.host = host
 tool.ftp.user = user
 tool.ftp.password = password
 tool.ftp.remotedir = httpdocs
</pre>
<p>Holt man sich die boilerplate direkt von <a href="https://github.com/paulirish/html5-boilerplate">github</a>, ist da eine Neuerung drin, welche erlaubt den Build zu erweitern, indem man eine project.xml anlegt und darin seine eigenen targets anlegen kann.<br />
Benutzt man die letzte stable version muss man den task direkt in die build.xml schreiben.</p>
<p>Der FTP task ist ganz simpel ohne Spirenzien:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;target name=&quot;ftpupload&quot; description=&quot;uploads the publish folder to your web space via ftp&quot;&gt;
	&lt;ftp server=&quot;${tool.ftp.host}&quot; userid=&quot;${tool.ftp.user}&quot; password=&quot;${tool.ftp.password}&quot; timediffauto=&quot;false&quot; remotedir=&quot;${tool.ftp.remotedir}&quot; action=&quot;send&quot; verbose=&quot;yes&quot; passive=&quot;yes&quot; depends=&quot;yes&quot;&gt;
            &lt;fileset dir=&quot;${dir.publish}&quot;&gt;
            &lt;/fileset&gt;
        &lt;/ftp&gt;
&lt;/target&gt;
</pre>
<p>Dann mal uploaden:</p>
<pre class="brush: bash; title: ; notranslate">ant ftpupload</pre>
<p>Komplett ist das dann so:</p>
<pre class="brush: bash; title: ; notranslate">
 ant minify
 ant ftpupload
 ant clean
</pre>The post <a href="https://nerdpress.org/2011/09/13/boilerplate-build-mit-ftp-deploy/">Boilerplate Build mit FTP deploy</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2011/09/13/boilerplate-build-mit-ftp-deploy/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>install ant ftp task on ubuntu</title>
		<link>https://nerdpress.org/2011/07/29/install-ant-ftp-task-on-ubuntu/</link>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Fri, 29 Jul 2011 15:17:18 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1551</guid>

					<description><![CDATA[<p>Tired of manually uploading your changes via FTP? And no shell because your client cant/wont buy a hosting package for real men? Then go for ant and its ftp task! Install it on ubuntu like so (given you have ant and java already): cd ~ wget http://apache.openmirror.de//commons/net/binaries/commons-net-1.4.1.tar.gz tar -zxvf commons-net-1.4.1.tar.gz sudo cp commons-net-1.4.1/commons-net-1.4.1.jar /usr/share/ant/lib rm &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2011/07/29/install-ant-ftp-task-on-ubuntu/" class="more-link">Continue reading<span class="screen-reader-text"> "install ant ftp task on ubuntu"</span></a></p>
The post <a href="https://nerdpress.org/2011/07/29/install-ant-ftp-task-on-ubuntu/">install ant ftp task on ubuntu</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Tired of manually uploading your changes via FTP?<br />
And no shell because your client cant/wont buy a hosting package for real men?</p>
<p>Then go for <strong>ant</strong> and its <strong>ftp task</strong>!</p>
<p>Install it on ubuntu like so (given you have ant and java already):</p>
<p><span id="more-1551"></span></p>
<pre class="brush: bash; title: ; notranslate">
cd ~
wget http://apache.openmirror.de//commons/net/binaries/commons-net-1.4.1.tar.gz
tar -zxvf commons-net-1.4.1.tar.gz
sudo cp commons-net-1.4.1/commons-net-1.4.1.jar /usr/share/ant/lib
rm -rf commons-net-1.4.1
rm -rf commons-net-1.4.1.tar.gz

wget http://archive.apache.org/dist/jakarta/oro/jakarta-oro-current.tar.gz
tar -zxvf jakarta-oro-current.tar.gz
sudo cp jakarta-oro-2.0.8/jakarta-oro-2.0.8.jar /usr/share/ant/lib
rm -rf jakarta-oro-2.0.8
rm -rf jakarta-oro-current.tar.gz
</pre>
<p>Butz!<br />
Now make your self an build.xml file in your projects root and do:</p>
<pre class="brush: bash; title: ; notranslate">
cd myproject
ant
</pre>
<p>Wahnsinn!</p>The post <a href="https://nerdpress.org/2011/07/29/install-ant-ftp-task-on-ubuntu/">install ant ftp task on ubuntu</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
