Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Warning

You have tried to access an archived page. Please go to the new https://root360.atlassian.net/wiki/spaces/KB to find more documents.

...

In the following common preparations for the software project and the deployment are described.

Table of Contents

Project Preparation

We expect the customer to:


  • use git or any comparable versioning control system for their code development 

  • define a branch the productive code could be cloned from e.g. master or a release branch

  • provide access method for git repository and credentials

    • currently supported and recommended is SSH using a private-public-keypair

    • HTTPS with http_user and http_password

    • HTTP with username and password (not recommended) 

Composer

Composer is a dependency management system.

To give a brief overview, Composer is utilizing run time variables to replace configuration items of your application on run time.

A variety of projects are using Composer to prepare their application during a release process. 

It's a powerful tool with a very large user and development community.

We recommend the usage of Composer over the use of shell-scripts or make.

In case of usage we recommend to:

  • configure your project using composer with shell environment variables, e.g. by using .dist config files (an example is shown below)

  • configure an env-map in composer.json is needed (an example is shown below)

  • specify a list of required symlinks for your project

Requisition

As parameter injection is done by incenteev bundleby incenteev bundle, it is needed to be included and triggert in composer.json

composer.json

HTML

Code Block
languagexmllinenumberstrue
    "require": {
        ...
        "incenteev/composer-parameter-handler": "~2.0" 
    ...
    "scripts": {
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
           ...


Further Reading

.dist example example 


Code Block
languagephplinenumberstrue
# This file is a "template" of what your parameters.yml file should look like
# Set parameters here that may be different on each deployment target of the app, e.g. development, staging, production.
# http://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
parameters:
database_host: ~
database_port: 3306
database_name: ~
database_user: ~
database_password: ~
mailer_transport: smtp
mailer_host: ~
mailer_user: ~
mailer_password: ~
mailer_default_dev_address: noreply@teamshirts.de    


composer.json example    example    


Code Block
languagephplinenumberstrue
"extra": {
	"symfony-app-dir": "app",
	"symfony-web-dir": "web",
	"symfony-assets-install": "relative",
	"incenteev-parameters": {
		"file": "app/config/parameters.yml",
		"keep-outdated": true,
		"env-map": {
			"database_host": "SYMFONY__ENV__DATABASE__SERVER",
			"database_name": "SYMFONY__ENV__DATABASE__DATABASE",
			"database_user": "SYMFONY__ENV__DATABASE__USERNAME",
			"database_password": "SYMFONY__ENV__DATABASE__PASSWORD",
			"mailer_host": "SYMFONY__ENV__MAILER__HOST",
			"mailer_user": "SYMFONY__ENV__MAILER__USER",
			"mailer_password": "SYMFONY__ENV__MAILER__PASSWORD"
		}
	}
}
Code Block