TYPO3 UserGroup Cologne // October 23rd, 2014 // Pixelpark AG
“Software deployment is all of the activities that make a software system available for use.” http://en.wikipedia.org/wiki/Software_deployment
<?php
/**
* Order of stages that will be executed
*
* @var array
*/
protected $stages = array(
// Initialize directories etc. (first time deploy)
'initialize',
// Local preparation of and packaging of application assets (code and files)
'package',
// Transfer of application assets to the node
'transfer',
// Update the application assets on the node
'update',
// Migrate (Doctrine, custom)
'migrate',
// Prepare final release (e.g. warmup)
'finalize',
// Smoke test
'test',
// Do symlink to current release
'switch',
// Delete temporary files or previous releases
'cleanup'
);
<?php
/**
* Deployment configuration for TUGCGN.
*/
/**
* @var $deployment \TYPO3\Surf\Domain\Model\Deployment
*/
// setup the workflow
$workflow = new \TYPO3\Surf\Domain\Model\SimpleWorkflow();
$deployment->setWorkflow($workflow);
// setup the application
$application = new \TYPO3\Surf\Application\BaseApplication('tugcgnApplication');
// setup the target host
$node = new \TYPO3\Surf\Domain\Model\Node('tugcgn.de');
$node->setOptions(array(
'username' => 'deploy',
'port' => '22',
'hostname' => '185.15.192.112'
));
$application->addNode($node);
$application
->setOption('repositoryUrl', 'ssh://yourgitserver.com:29418/tugcgn.git')
->setDeploymentPath('/var/www/tugcgn/');
$deployment->addApplication($application);
<?php
// Some other stuff
$application
->setOption('repositoryUrl', 'ssh://yourgitserver.int:29418/tugcgn.git')
->setOption('packageMethod', 'git')
->setOption('transferMethod', 'rsync')
->setOption('updateMethod', NULL)
->setOption('keepReleases', 3)
->setDeploymentPath('/var/www/tugcgn/');
$deployment->addApplication($application);
<?php
/**
* set file permissions
*/
$setFilePermissions = array(
'command' => '{releasePath}/setFilePermissions.sh'
);
$workflow->defineTask(
'mw.tugcgn:setFilePermissions',
'typo3.surf:shell',
$setFilePermissions
);
$workflow->afterStage('migrate', 'mw.tugcgn:setFilePermissions');
$deployment->onInitialize(function() use ($workflow, $application) {
$workflow->removeTask('typo3.surf:flow:setfilepermissions');
});
<?php
namespace TYPO3\Surf\Application\TYPO3;
/* *
* This script belongs to the TYPO3 Flow package "TYPO3.Surf". *
* *
* */
/**
* A TYPO3 CMS application template
* @TYPO3\Flow\Annotations\Proxy(false)
*/
class CMS extends \TYPO3\Surf\Application\BaseApplication {
/**
* Constructor
*
* @param string $name
*/
public function __construct($name = 'TYPO3 CMS') {
parent::__construct($name);
}
}
/var/www/tugcgn.de/htdocs/releases/current/Data/
->
/var/www/tugcgn.de/htdocs/shared/Data/
/var/www/tugcgn.de/htdocs/shared/Data/Persistent/
Resources/107bed85ba5e9bae0edbae879bbc2c26d72033ab
http://tugcgn.de/_Resources/Persistent/
107bed85ba5e9bae0edbae879bbc2c26d72033ab.jpg
or
http://tugcgn.de/_Resources/Persistent/
107bed85ba5e9bae0edbae879bbc2c26d72033ab/filename.jpg
/var/www/tugcgn.de/htdocs/releases/current/Web/_Resources/
Persistent/107bed85ba5e9bae0edbae879bbc2c26d72033ab.jpg
->
/var/www/tugcgn.de/htdocs/releases/20141021113435/Data/
Persistent/Resources/107bed85ba5e9bae0edbae879bbc2c26d72033ab
Starting a basic website in 2014:
1. Install Node
2. Install Bower
3. Pick CSS framework
4. Pick responsive approach
...
47. Write some HTML
iamdevloper@twitter
Used images:
References: