<?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>Deployment | Nerdpress.org</title>
	<atom:link href="https://nerdpress.org/category/project-setup/deployment/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Fri, 08 Nov 2024 12:38:47 +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>Deploy local build with Deployer7</title>
		<link>https://nerdpress.org/2024/11/08/deploy-local-build-with-deployer7/</link>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Fri, 08 Nov 2024 12:38:46 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Deployer]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=3347</guid>

					<description><![CDATA[<p>Deployer is a great tool to deploy your PHP Project. Deployer executes a set of commands on the target server to build your project and enable the newly built version. A typical deployment process with Deployer involves SSHing into the target machine, where it performs a Git checkout of the project, installs dependencies via Composer, &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2024/11/08/deploy-local-build-with-deployer7/" class="more-link">Continue reading<span class="screen-reader-text"> "Deploy local build with Deployer7"</span></a></p>
The post <a href="https://nerdpress.org/2024/11/08/deploy-local-build-with-deployer7/">Deploy local build with Deployer7</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p><br /><a href="https://deployer.org/" target="_blank" rel="noopener" title="">Deployer</a> is a great tool to deploy your PHP Project.</p>



<p>Deployer executes a set of commands on the target server to build your project and enable the newly built version. A typical deployment process with Deployer involves SSHing into the target machine, where it performs a Git checkout of the project, installs dependencies via Composer, runs build commands, and possibly triggers some database migrations. When everything is successful, it will symlink the webroot to the new release.</p>



<p>On some servers, however, there are limitations that make this process unfeasible. For instance, you can&#8217;t install Composer, Git isn&#8217;t available, the CLI PHP version is different and can&#8217;t be changed, or certain asset-building processes aren&#8217;t possible because Node.js isn&#8217;t installed. This is often the case with shared hosting.</p>



<span id="more-3347"></span>



<p>The strategy, therefore, is to build the project locally and upload it to the target machine. <br />In Deployer 6 there was a buildIn mechanism for building your project on the local host.<br />However with Deployer version 7 this has been removed and building your project locally has become a bit more fiddly. <br /><br />With Deployer 6 you could just use the <code>local</code>() method on a task and set the <code>deploy_path</code> to a local dir.</p>


<pre class="wp-block-code"><span><code class="hljs language-php">task(<span class="hljs-string">'build'</span>, <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">()</span> </span>{
    set(<span class="hljs-string">'deploy_path'</span>, <span class="hljs-keyword">__DIR__</span> . <span class="hljs-string">'/.build'</span>);
    invoke(<span class="hljs-string">'deploy:prepare'</span>);
    invoke(<span class="hljs-string">'deploy:release'</span>);
    invoke(<span class="hljs-string">'deploy:update_code'</span>);
    invoke(<span class="hljs-string">'deploy:vendors'</span>);
    invoke(<span class="hljs-string">'deploy:clear_paths'</span>);
    invoke(<span class="hljs-string">'deploy:symlink'</span>);
})-&gt;local();</code></span></pre>


<p>Then you could combine this with an upload task in a deploy task an you are done.</p>


<pre class="wp-block-code"><span><code class="hljs language-php">task(<span class="hljs-string">'upload'</span>, <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">()</span> </span>{
     upload(<span class="hljs-keyword">__DIR__</span> . <span class="hljs-string">"/.build/current/"</span>, <span class="hljs-string">'{{release_path}}'</span>, &#91;<span class="hljs-string">'--links'</span>]);
 });

 task(<span class="hljs-string">'deploy'</span>, &#91;
     <span class="hljs-string">'build'</span>,
     <span class="hljs-string">'upload'</span>,
     <span class="hljs-string">'cleanup'</span>,
     <span class="hljs-string">'success'</span>
 ]);</code></span></pre>


<p>See here for the docs of Deployer 6: <br /><a href="https://deployer.org/docs/6.x/advanced/deploy-strategies#build-server" target="_blank" rel="noopener" title="">https://deployer.org/docs/6.x/advanced/deploy-strategies#build-server</a></p>



<p>Since Deployer 7, however, the <code>local()</code> method was removed. Instead, there is now a <code>localhost()</code> method, which defines a host for local builds. Additionally, you still need to define the remote host as the target destination for the upload. <br />However, you cannot specify a single task to run on a specific host, and therefore you cannot combine tasks for <code>localhost</code> and the remote host within a single task.</p>



<p>To build the project, we now need two separate tasks. <br />I managed to make it work with two tasks and two hosts: one for local build and one that takes the fresh local build and uploads it to the remote host.</p>


<pre class="wp-block-code"><span><code class="hljs language-php">localhost(<span class="hljs-string">'local'</span>)-&gt;set(<span class="hljs-string">'deploy_path'</span>, <span class="hljs-keyword">__DIR__</span> . <span class="hljs-string">'/.build'</span>);

host(<span class="hljs-string">'remote'</span>)
    -&gt;setHostname(<span class="hljs-string">'server-host.com'</span>)
    -&gt;set(<span class="hljs-string">'remote_user'</span>, <span class="hljs-string">'user'</span>)
    -&gt;set(<span class="hljs-string">'deploy_path'</span>, <span class="hljs-string">'/www/blog'</span>)
    -&gt;set(<span class="hljs-string">'http_user'</span>, <span class="hljs-string">'user'</span>);
....

task(<span class="hljs-string">'build'</span>, <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">()</span> </span>{
    <span class="hljs-comment">// build it</span>
})-&gt;once();

task(<span class="hljs-string">'upload'</span>, <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-params">()</span> </span>{
    upload(<span class="hljs-keyword">__DIR__</span> . <span class="hljs-string">"/.build/current/"</span>, <span class="hljs-string">'{{deploy_path}}'</span>, &#91;<span class="hljs-string">'--links'</span>]);
});</code></span></pre>


<p>Then I simply run two separate commands: one for building on the local host and one for uploading to the remote host.</p>


<pre class="wp-block-code"><span><code class="hljs">vendor/bin/dep build local
vendor/bin/dep upload remote</code></span></pre>


<p>Not as convenient as previously but it works. :)</p>



<p>See this issue for context:  <a href="https://github.com/deployphp/deployer/issues/2838" target="_blank" rel="noopener" title="">https://github.com/deployphp/deployer/issues/2838</a></p>The post <a href="https://nerdpress.org/2024/11/08/deploy-local-build-with-deployer7/">Deploy local build with Deployer7</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<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>[Symfony 2][Twig] &#8211; Enabling (native) Twig Extensions</title>
		<link>https://nerdpress.org/2011/10/19/symfony-2-twig-enabling-native-twig-extensions/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 19 Oct 2011 11:39:46 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Project Setup]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Dependency Injection]]></category>
		<category><![CDATA[DIC]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[symfony 2]]></category>
		<category><![CDATA[Twig]]></category>
		<category><![CDATA[Twig Extension]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1899</guid>

					<description><![CDATA[<p>Twig Extensions is a tiny official repository for extensions to the Twig templating markup language, the default templating engine in each Symfony 2 (Standard Ed.) project. This short article shows how to purposeful enable them per-environment for your projects. The twig-extension repository is usually fetched by calling $ bin/vendor install into your project´s ./vendor directory &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2011/10/19/symfony-2-twig-enabling-native-twig-extensions/" class="more-link">Continue reading<span class="screen-reader-text"> "[Symfony 2][Twig] &#8211; Enabling (native) Twig Extensions"</span></a></p>
The post <a href="https://nerdpress.org/2011/10/19/symfony-2-twig-enabling-native-twig-extensions/">[Symfony 2][Twig] – Enabling (native) Twig Extensions</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p><a href="https://github.com/fabpot/Twig-extensions">Twig Extensions</a> is a tiny official repository for extensions to the <a href="http://twig.sensiolabs.org/">Twig templating markup language</a>, the default templating engine in each Symfony 2 (Standard Ed.) project. This short article shows how to purposeful enable them per-environment for your projects.</p>
<p><span id="more-1899"></span></p>
<p>The twig-extension repository is usually fetched by calling</p>
<pre class="brush: bash; title: ; notranslate">
$ bin/vendor install
</pre>
<p>into your project´s ./vendor directory (because it is part of the ./deps file of each symfony 2 standard edition).</p>
<p>After installing the required vendor files, register the namespace fallback in your autoload.php (if you use the one delivered with Symfony 2 Standard, this should already have been done for you):</p>
<pre class="brush: php; title: ; notranslate">
use Symfony\Component\ClassLoader\UniversalClassLoader;
use Doctrine\Common\Annotations\AnnotationRegistry;

$loader = new UniversalClassLoader();
$loader-&gt;registerNamespaces(array(
    'Symfony'          =&gt; array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
    // ...
));

$loader-&gt;registerPrefixes(array(
    'Twig_Extensions_' =&gt; __DIR__.'/../vendor/twig-extensions/lib',
    'Twig_'            =&gt; __DIR__.'/../vendor/twig/lib',
));
</pre>
<p>Remember that twig extensions are always registered as <a href="http://symfony.com/doc/2.0/book/service_container.html#tags-tags">tagged services</a>, but it is not always desirable to register a twig extension like e.g. the Debug-Extension as a regular service globally. We could do so by adding the service definition to the services.xml-file in one of our bundles. But due to the special purpose of the debug extension, we will choose a different, more &#8220;project-wide-configuration&#8221;-way.</p>
<p>Luckily, Symfony provides means to dynamically load services &#8220;on demand&#8221; and depending on the current <a href="http://symfony.com/doc/2.0/cookbook/configuration/environments.html">environment</a>.</p>
<p>Add the following lines to your app/config/config_dev.yml:</p>
<pre class="brush: python; title: ; notranslate">
services:
    debug.twig.extension:
        class: Twig_Extensions_Extension_Debug
        tags: &#x5B;{ name: 'twig.extension' }]
</pre>
<p>The &#8220;services&#8221;-configuration option may be utilized to register any class as a <a href="http://symfony.com/doc/2.0/book/service_container.html">DIC</a> managed <a href="http://symfony.com/doc/2.0/book/service_container.html#what-is-a-service">service</a>, for each project and independent from your bundle configuration (But remember that &#8220;regular&#8221; service definition configuration should usually happen in your bundle´s configuration files, otherwise you will not able to distribute your bundles because of missing or broken dependencies).</p>
<p>For twig extensions that should only be loaded for special purposes (like our DEBUG-function which is only needed in development environments), config_dev.yml is the perfect place to register them.</p>
<p>Note the &#8220;tags&#8221;-configuration which marks the service as a twig extension. Now, let´s create a demo twig-template and try the {% debug %} function:</p>
<pre class="brush: xml; title: ; notranslate">
{% extends &quot;NerdpressDemoBundle::layout.html.twig&quot; %}
{% debug %}
</pre>
<p>That will do. Open the page in your favorite webbrower (after defining a route, a controller and other stuff i won´t mention here) and admire the debug output. Note that the output will be much more nicer if you have had installed a native php debug extension like e.g. <a href="http://xdebug.org/">XDebug</a>.</p>The post <a href="https://nerdpress.org/2011/10/19/symfony-2-twig-enabling-native-twig-extensions/">[Symfony 2][Twig] – Enabling (native) Twig Extensions</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>set up magento in multiple environments</title>
		<link>https://nerdpress.org/2011/09/27/set-up-magento-in-multiple-environments/</link>
					<comments>https://nerdpress.org/2011/09/27/set-up-magento-in-multiple-environments/#comments</comments>
		
		<dc:creator><![CDATA[Max Girkens]]></dc:creator>
		<pubDate>Tue, 27 Sep 2011 03:29:47 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[eCommerce]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[environments]]></category>
		<category><![CDATA[Git]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1667</guid>

					<description><![CDATA[<p>I just started digging in the shop software magento for a project and set up the following development environment. In this scenario development is done on two local machines while products and pages beeing already edited on the &#8220;Live&#8221;-Web-Server. Git is used for version control and deployment. Also FTP SSH. Magento is quite nice when &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2011/09/27/set-up-magento-in-multiple-environments/" class="more-link">Continue reading<span class="screen-reader-text"> "set up magento in multiple environments"</span></a></p>
The post <a href="https://nerdpress.org/2011/09/27/set-up-magento-in-multiple-environments/">set up magento in multiple environments</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>I just started digging in the shop software <a href="http://www.magentocommerce.com">magento</a> for a project and set up the following development environment.</p>
<p>In this scenario development is done on two local machines while products and pages beeing already edited on the &#8220;Live&#8221;-Web-Server.<br />
Git is used for version control and deployment. Also <del>FTP</del> SSH.<span id="more-1667"></span></p>
<p><a href="https://nerdpress.org/wp-content/uploads/2011/09/magento_sync_multiple_environments.png"><img decoding="async" class="alignnone size-medium wp-image-1761" title="magento_sync_multiple_environments" src="https://nerdpress.org/wp-content/uploads/2011/09/magento_sync_multiple_environments-300x147.png" alt="sync multiple Magento environments" width="300" height="147" srcset="https://nerdpress.org/wp-content/uploads/2011/09/magento_sync_multiple_environments-300x147.png 300w, https://nerdpress.org/wp-content/uploads/2011/09/magento_sync_multiple_environments.png 732w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Magento is quite nice when it comes to deployment, as most config stuff is stored in XML files.<br />
Those files are kept locally and ignored from version control.</p>
<p>So this is what my <a href="http://stackoverflow.com/questions/4564622/best-practices-for-using-git-with-magento">.gitignore</a> looks like:</p>
<pre class="brush: bash; title: ; notranslate">
#cache, sessions, logs
/var/cache/*
/var/session/*
/var/locks/*
/var/report/*
/var/log/*
#media folder - images etc...
/media/*

#local config files
/app/etc/local.xml
.htaccess

#database dump
/database.sql

</pre>
<p>So i got a copy of the repository in each environment with a local .htaccess and local.xml file.</p>
<p>Theres a few things stored in DB by magento, though.<br />
The most obvious is the &#8220;web/secure/base_url&#8221; and &#8220;web/unsecure/base_url&#8221; which both reside in the &#8220;core_config_data&#8221; table.<br />
Those have to be set to the name of the host you&#8217;re working on.</p>
<p>This can be done with a shell script like this:</p>
<pre class="brush: bash; title: ; notranslate">

#create a dupm of the live DB on the server
ssh user@server.com 'mysqldump -u&#x5B;username] -p&#x5B;password] &gt; ~/db_dump.sql'

#copy DB dump to local machine
scp user@server.com:~/db_dump.sql ./database.sql

#import SQL
mysql -u&#x5B;local_mysql_user] -p&#x5B;local_mysql_pw] &#x5B;local_db_name] &lt; ./database.sql

#update config settings in the DB
mysql -u&#x5B;local_mysql_user] -p&#x5B;local_mysql_pw] &#x5B;local_db_name]&lt;UPDATE
core_config_data
SET value='http://local.server.com/'
WHERE value ='http://server.com';
EOFMYSQL

</pre>
<p>This way all CMS and products  can be edited on the server, while the local machines can be easily synched.<br />
For me this works fine, as we are working only in the file system in the local environment.<br />
In case you can&#8217;t use the online Server as &#8220;database master&#8221; this might be not that simple.</p>
<p>As we most likely don&#8217;t want the whole /media folder under version control we might want to have another shell script to copy the media files to the local machine (via SCP in this case):</p>
<pre class="brush: bash; title: ; notranslate">

#remove local media folder
rm -rf ./media/*
#fetch media files
scp -r ssh_user@server.com:~/magento_folder/media/* ./media

</pre>
<p>I guess this could be done more efficiently with maybe ant or something.<br />
But for the moment this works fine for me.</p>
<p>So now i can update my local environment with one line on the console:</p>
<pre class="brush: bash; title: ; notranslate">

git pull; sh sync_db.sh; sh sync_media.sh

</pre>The post <a href="https://nerdpress.org/2011/09/27/set-up-magento-in-multiple-environments/">set up magento in multiple environments</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2011/09/27/set-up-magento-in-multiple-environments/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</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 silverstripe with some modules from GIT</title>
		<link>https://nerdpress.org/2011/09/11/install-silverstripe-with-some-modules-from-git/</link>
		
		<dc:creator><![CDATA[Max Girkens]]></dc:creator>
		<pubDate>Sun, 11 Sep 2011 12:53:22 +0000</pubDate>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Silverstripe]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[installer]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1634</guid>

					<description><![CDATA[<p>This is a small shell script to set up silverstripe CMS along with some modules i often use (as seen in ivo&#8217;s post) The script has two parameters: &#8211; the folder to clone the whole thing into &#8211; the branch/tag to checkout afterwards # install silverstripe + common modules from github # usage sh install_silverstripe.sh &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2011/09/11/install-silverstripe-with-some-modules-from-git/" class="more-link">Continue reading<span class="screen-reader-text"> "install silverstripe with some modules from GIT"</span></a></p>
The post <a href="https://nerdpress.org/2011/09/11/install-silverstripe-with-some-modules-from-git/">install silverstripe with some modules from GIT</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>This is a small shell script to set up <a href="http://www.silverstripe.org/">silverstripe CMS</a><br />
along with some modules i often use (as seen in <a href="https://nerdpress.org/2011/06/06/silverstripe-image-gallery-installation/">ivo&#8217;s post</a>)</p>
<p>The script has two parameters:<br />
&#8211; the folder to clone the whole thing into<br />
&#8211; the branch/tag to checkout afterwards</p>
<pre class="brush: bash; title: ; notranslate">
# install silverstripe + common modules from github
# usage sh install_silverstripe.sh &lt;folder_name&gt; &lt;tag/branch&gt;
# examples:
# sh install_silverstripe.sh some_folder tags/2.4.5
# sh install_silverstripe.sh some_folder master
</pre>
<p><span id="more-1634"></span></p>
<p>As Silverstripe itself is split up in 3 repositories<br />
(the installer/base folder, the cms and the sapphire framework itself)<br />
we fetch the base folder first:</p>
<pre class="brush: bash; title: ; notranslate">
#set up project base folder
git clone git@github.com:silverstripe/silverstripe-installer.git $1
cd $1
git checkout $2
</pre>
<p>Get the cms</p>
<pre class="brush: bash; title: ; notranslate">
#setup cms
git clone git@github.com:silverstripe/silverstripe-cms.git cms
cd cms
git checkout $2
cd ..
</pre>
<p>Get sapphire &#8230;</p>
<pre class="brush: bash; title: ; notranslate">
#setup framework
git clone git@github.com:silverstripe/sapphire.git sapphire
cd sapphire
git checkout $2
cd ..
</pre>
<p>Setup some permissions for the web installer.</p>
<pre class="brush: bash; title: ; notranslate">
#set permissions for install
chmod 0777 assets assets/*
chmod 0666 .htaccess mysite/_config.php assets/*/*
</pre>
<p>Fetch the blackcandy theme from a fourth repository.<br />
Backup the tutorial theme in case we need it.</p>
<pre class="brush: bash; title: ; notranslate">
#install blackcandy theme
mv themes/tutorial ./
rm -rf themes
git clone https://github.com/silverstripe-themes/silverstripe-blackcandy.git themes
cd themes
git checkout $2
cd ..
mv tutorial themes
</pre>
<p>Install some modules</p>
<pre class="brush: bash; title: ; notranslate">
# install common modules
git clone https://github.com/unclecheese/Uploadify.git uploadify
git clone https://github.com/unclecheese/DataObjectManager.git dataobject_manager
git clone https://github.com/silverstripe/silverstripe-userforms.git userforms
</pre>
<p><strong>iIput the script <a href="https://gist.github.com/1209496">on github</a></strong><br />
&#8230;in case you might wanna use it or add something i&#8217;ve missed.</p>The post <a href="https://nerdpress.org/2011/09/11/install-silverstripe-with-some-modules-from-git/">install silverstripe with some modules from GIT</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</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>
		<item>
		<title>Unfuddle: Repository read access denied</title>
		<link>https://nerdpress.org/2011/03/21/unfuddle-repository-read-access-denied/</link>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Mon, 21 Mar 2011 13:11:18 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Project Setup]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[unfuddle]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1427</guid>

					<description><![CDATA[<p>Unfuddle: Repository read access denied Ich benutze ja ganz gerne unfuddle für Projekte mit closed source. Dort kann man nämlich mit dem free Account, anders wie bei github, private repositories erstellen. Nun hatte ich aber neulich plötzlich einen Auth Fehler und konnte mich mit meinem key nicht mehr connecten: ERROR:gitosis.serve.main:Repository read access denied fatal: The &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2011/03/21/unfuddle-repository-read-access-denied/" class="more-link">Continue reading<span class="screen-reader-text"> "Unfuddle: Repository read access denied"</span></a></p>
The post <a href="https://nerdpress.org/2011/03/21/unfuddle-repository-read-access-denied/">Unfuddle: Repository read access denied</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Unfuddle: Repository read access denied</p>
<p>Ich benutze ja ganz gerne <a href="http://www.unfuddle.com">unfuddle</a> für Projekte mit closed source.<br />
Dort kann man nämlich mit dem free Account, anders wie bei <a href="http://github.com">github</a>, private repositories erstellen.</p>
<p>Nun hatte ich aber neulich plötzlich einen Auth Fehler und konnte mich mit meinem key nicht mehr connecten:</p>
<pre class="brush: bash; title: ; notranslate">
ERROR:gitosis.serve.main:Repository read access denied
fatal: The remote end hung up unexpectedly
</pre>
<p>Ich war mir keiner schuld bewußt.</p>
<p>Nachdem ich meinen key gelöscht bei unfuddle hatte und neu anlegen wollte, kam dann die Fehlermeldung:</p>
<pre class="brush: bash; title: ; notranslate">
This public key has already been taken by another user.
If you have multiple accounts, you must use a different public key for each account.
</pre>
<p><span id="more-1427"></span></p>
<p>Des Rätsels Löung war dann <a href="http://unfuddle.com/community/forums/4/topics/362">hier</a> zu finden.</p>
<p>Kurz: ich hatte meinen key noch einem anderen Projekt zugeteilt, wo ich contribute, allerdings mit einem anderen Account.<br />
Also zweiten key angelegt, bei unfuddle eingetragen, über ssh config einen switch eingetragen und schon klappts</p>The post <a href="https://nerdpress.org/2011/03/21/unfuddle-repository-read-access-denied/">Unfuddle: Repository read access denied</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[Symfony 2] Sandbox/Standard Edition &#8211; bootstrap.php</title>
		<link>https://nerdpress.org/2011/03/06/symfony-2-sandboxstandard-edition-bootstrap-php/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 06 Mar 2011 08:03:12 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Bootstrap]]></category>
		<category><![CDATA[symfony 2]]></category>
		<category><![CDATA[Symfony 2 Sandbox]]></category>
		<category><![CDATA[Symfony Standard Edition]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1394</guid>

					<description><![CDATA[<p>Wer sich wundert, woher die beiden Dateien &#8220;app/bootstrap.php&#8221; respektive &#8220;app/bootstrap_cache.php&#8221; im Standard-app-Verzeichnis der Sandbox kommen: Das Script unter bin/build_bootstrap.php generiert eben diese aus existierenden Sourcen. Das Script sollte im Projekt-Rootverzeichnis aufgerufen werden, also etwa so:$ php bin/build_bootstrap.php Das ganze dient schlicht dazu, den PHP-Autoloader zu entlasten (und ersetzt somit die core_compile.yml-Konfiguration aus der Symfony 1.x-Welt). &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2011/03/06/symfony-2-sandboxstandard-edition-bootstrap-php/" class="more-link">Continue reading<span class="screen-reader-text"> "[Symfony 2] Sandbox/Standard Edition &#8211; bootstrap.php"</span></a></p>
The post <a href="https://nerdpress.org/2011/03/06/symfony-2-sandboxstandard-edition-bootstrap-php/">[Symfony 2] Sandbox/Standard Edition – bootstrap.php</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Wer sich wundert, woher die beiden Dateien &#8220;app/bootstrap.php&#8221; respektive &#8220;app/bootstrap_cache.php&#8221; im Standard-app-Verzeichnis der Sandbox kommen: Das Script unter bin/build_bootstrap.php generiert eben diese aus existierenden Sourcen.<br />
<span id="more-1394"></span><br />
Das Script sollte im Projekt-Rootverzeichnis aufgerufen werden, also etwa so:<sourcecode lang="sh">$ php bin/build_bootstrap.php</sourcecode><br />
Das ganze dient schlicht dazu, den PHP-Autoloader zu entlasten (und ersetzt somit die core_compile.yml-Konfiguration aus der Symfony 1.x-Welt).</p>
<p>Natürlich spricht nichts dagegen, das Script als Vorlage für seinen eigenen genererate-bootstrap-code zu modifizieren.</p>The post <a href="https://nerdpress.org/2011/03/06/symfony-2-sandboxstandard-edition-bootstrap-php/">[Symfony 2] Sandbox/Standard Edition – bootstrap.php</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>3 x YuiCompressor im Deploy</title>
		<link>https://nerdpress.org/2011/02/11/3-x-yuicompressor-im-deploy/</link>
					<comments>https://nerdpress.org/2011/02/11/3-x-yuicompressor-im-deploy/#comments</comments>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Fri, 11 Feb 2011 15:06:26 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[yuicompressor]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1357</guid>

					<description><![CDATA[<p>6 million ways to deploy, choose one Die Aufgabe ist mit dem yuicompressor alle css files einzeln zu komprimieren. Concatenation lasse ich weg. Wir haben zur Auswahl 2 x mal als ant deploy und einmal die gute alte shell. Das yuicompressor jar ist “installiert” und liegt hier: /usr/share/ant/lib/yuicompressor.jar Und es kann losgehen: 1. ant via &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2011/02/11/3-x-yuicompressor-im-deploy/" class="more-link">Continue reading<span class="screen-reader-text"> "3 x YuiCompressor im Deploy"</span></a></p>
The post <a href="https://nerdpress.org/2011/02/11/3-x-yuicompressor-im-deploy/">3 x YuiCompressor im Deploy</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p><em>6 million ways to deploy, choose one</em></p>
<p>Die Aufgabe ist mit dem <a href="http://developer.yahoo.com/yui/compressor/">yuicompressor</a> alle css files einzeln zu komprimieren.<br />
Concatenation lasse ich weg.<br />
Wir haben zur Auswahl 2 x mal als <strong>ant</strong> deploy und einmal die gute alte <strong>shell</strong>.</p>
<p>Das yuicompressor jar ist “installiert” und liegt hier:</p>
<pre class="brush: bash; title: ; notranslate">
/usr/share/ant/lib/yuicompressor.jar
</pre>
<p>Und es kann losgehen:</p>
<p><span id="more-1357"></span></p>
<p><strong>1. ant via apply task</strong></p>
<p>Ein Property (im externen property file) für das jar:</p>
<pre class="brush: bash; title: ; notranslate">
yuicompressor=/usr/share/ant/lib/yuicompressor.jar
</pre>
<p>Und nun der task:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;target name=&quot;minifyCSS&quot;&gt;
		&lt;apply executable=&quot;java&quot; parallel=&quot;false&quot; verbose=&quot;true&quot; dest=&quot;${buildir}/project/${updateChannelTemp}/&quot;&gt;
			&lt;fileset dir=&quot;${updateChannelTemp}/${SvnExportDir}/scripts/&quot; includes=&quot;*.css&quot; excludes=&quot;*.min.css&quot;/&gt;
			&lt;arg line=&quot;-jar&quot;/&gt;
			&lt;arg path=&quot;${yuicompressor}&quot;/&gt;
			&lt;arg line=&quot;-v&quot;/&gt;
			&lt;arg line=&quot;--charset latin1&quot;/&gt;
			&lt;srcfile /&gt;
			&lt;arg line=&quot;-o&quot;/&gt;
			&lt;mapper type=&quot;glob&quot; from=&quot;*.css&quot; to=&quot;*.css&quot;/&gt;
			&lt;targetfile/&gt;
		&lt;/apply&gt;
		&lt;move todir=&quot;${buildir}/project/${updateChannelTemp}/${SvnExportDir}/scripts/&quot; overwrite=&quot;true&quot;&gt;
			&lt;fileset dir=&quot;${buildir}/project/${updateChannelTemp}/&quot; includes=&quot;*.css&quot; /&gt;
		&lt;/move&gt;
&lt;/target&gt;
</pre>
<p><strong>2. ant via yui-compressor task</strong></p>
<p>Dazu brauch es noch ein paar Vorbereitungen:</p>
<p>Hierzu muss das Task noch “<a href="http://javaflight.blogspot.com/2008/01/introducing-yui-compressor-ant-task.html">installiert</a>” werden, ich packs mal zu den anderen jars und dazu ein Property:</p>
<pre class="brush: bash; title: ; notranslate">
yuicompressortask=/usr/share/ant/lib/yui-compressor-task.jar
</pre>
<p>Weiterhin den Ant ClassPath:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;path id=&quot;project.classpath&quot;&gt;
		&#x5B;...]
&lt;pathelement location=&quot;${yuicompressortask}&quot; /&gt;
		&lt;pathelement location=&quot;${yuicompressor}&quot; /&gt;
&lt;/path&gt;
</pre>
<p>Den Task definieren:</p>
<pre class="brush: bash; title: ; notranslate">
&lt;taskdef name=&quot;yui-compressor&quot; classname=&quot;net.noha.tools.ant.yuicompressor.tasks.YuiCompressorTask&quot;&gt;
</pre>
<p>und das eigentliche Target:</p>
<pre class="brush: bash; title: ; notranslate">
&lt;target name=&quot;minifyCSS2&quot;&gt;
&lt;mkdir dir=&quot;${updateChannelTemp}/${SvnExportDir}/scripts/css/&quot;/&gt;
&lt;yui-compressor 
    warn=&quot;false&quot; 
    munge=&quot;true&quot; 
    cssSuffix=&quot;.css&quot;
    jsSuffix=&quot;.js&quot; 
    preserveallsemicolons=&quot;false&quot; 
    fromdir=&quot;${updateChannelTemp}/${SvnExportDir}/scripts/&quot; 
    todir=&quot;${updateChannelTemp}/${SvnExportDir}/scripts/css/&quot;&gt;
  &lt;include name=&quot;*.css&quot; /&gt;
&lt;/yui-compressor&gt;
&lt;move todir=&quot;${updateChannelTemp}/${SvnExportDir}/scripts/&quot; overwrite=&quot;true&quot;&gt;
		&lt;fileset dir=&quot;${updateChannelTemp}/${SvnExportDir}/scripts/css/&quot; includes=&quot;*.css&quot; /&gt;
&lt;/move&gt;
&lt;delete dir=&quot;${updateChannelTemp}/${SvnExportDir}/scripts/css/&quot; /&gt;
&lt;/target&gt;
</pre>
<p><strong>3. via shell</strong></p>
<pre class="brush: bash; title: ; notranslate">
java -jar /usr/share/ant/lib/yuicompressor.jar --type -v css &lt; /home/builds/project/css/*.css &gt; /home/builds/project/css/*.css
</pre>
<p>Fazit:<br />
Ich <del>hasse</del> liebe <strong>ant</strong>.<br />
<em>Achtung: keine Gewähr, dass das die snippets funktionieren, weil ziemlich aus dem Kontext gerissen.</em><br />
Ich wollte nur mal verdeutlichen was für ein overhead <strong>ant</strong> manchmal erzeugt.<br />
Ich benutze es trotzdem ;)</p>The post <a href="https://nerdpress.org/2011/02/11/3-x-yuicompressor-im-deploy/">3 x YuiCompressor im Deploy</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2011/02/11/3-x-yuicompressor-im-deploy/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
