Deployer
class Deployer
This class implements a service that performs the deployment of files from a new simulator or modified simulator to all front-end servers described in the entry 'deployment of parameters.yml.
Properties
private KernelInterface | $kernel | ||
private TranslatorInterface | $translator | ||
private LockHandler | $lockHandler | ||
private array | $deployed | ||
private array | $output | ||
private array | $importedCSS |
Methods
Constructor of class Deployer
Realizes the deployment
Transforms a Windows path in a Unix path for a 'rsync' command
Loads the list of already deployed data sources
Adds a datasource to the list of deployed data sources
Saves the list of deployed data sources
Saves DataSources.xml for a server
Retrieves imported css in a css file.
Details
at line 103
void
__construct(KernelInterface $kernel, TranslatorInterface $translator)
Constructor of class Deployer
at line 119
private void
doDeploy(string $localRootDir, string $localFile, string $remoteFile, string $command)
Realizes the deployment
at line 146
private string
unixify($rootDir)
Transforms a Windows path in a Unix path for a 'rsync' command
at line 165
private void
loadDeployed(string $deployedFile)
Loads the list of already deployed data sources
at line 196
private void
addDeployedDatasource(string $datasource, string $server)
Adds a datasource to the list of deployed data sources
at line 227
private void
saveDeployed(string $deployedFile)
Saves the list of deployed data sources
at line 249
private void
saveDataSources(string $server, string $databasesDir)
Saves DataSources.xml for a server
at line 304
private array
getImportedCSS(string $cssFileName)
Retrieves imported css in a css file.
at line 351
array
deploy(Simulator $simu)
Entry point of the service
Reads the 'deployment' parameter from the parameters.yml file and starts the deployment on all the servers listed under this parameter?
The 'deployment' parameter contains one child parameter by server with the following syntax:
The deployment command must contain the placeholder variables:
- {local.rootdir}
- {local.file}
- {remote.dir} or {remote.file}
{local.rootdir} is the directory where this instance of G6K is installed
{local.file} is the path relative to {local.rootdir} and the file name of a file to be deployed
{remote.dir} is the path (without the file name) relative to the install directory of G6K in remote server of a file to be deployed
{remote.file} is the path relative to the install directory of G6K in remote server of a file to be deployed
Some examples :
- front1: rsync -utlgo {local.rootdir}/{local.file} foo@bar:/var/www/html/simulator/{remote.file}
- front2: rcp {local.rootdir}/{local.file} foo@bar:/var/www/html/simulator/{remote.dir}/
- localhost: cp -f {local.rootdir}/{local.file} /var/www/html/simulator/{remote.dir}/