SlideShare a Scribd company logo
1 of 13
Download to read offline
Development and
deployment with composer
and kite
Whatโ€™s composer?
โ— Tool for dependency management in PHP applications
โ— Command line app written in PHP
โ— Manages packages on a per-project basis (unlike Apt, Yum etc.)
โ— Strongly inspired by similar projects in other languages like npm or bundler
โ— Suppose:
โ—‹ You have a project that depends on a number of libraries.
โ—‹ Some of those libraries depend on other libraries.
โ— Composer:
โ—‹ Enables you to declare the libraries you depend on.
โ—‹ Finds out which versions of which packages can and need to be installed, and installs them
(meaning it downloads them into your project).
โ€œ
composer: Basic Usage
โ— Everything related to composer is a kept in a
composer.json at project or package root
โ— Package names:
โ—‹ vendor/package-name
โ— Versions:
โ—‹ Semantic versioning: x.y.z[-stability]
โ–  x: Major version (potentially breaking changes)
โ–  y: Minor version (new, compatible functionality)
โ–  z: Patch version (bug fixes)
โ–  stability flag: Flag stating the stability of a
pre-release (e.g. 2.0.0-alpha)
โ—‹ Branch names, prefixed by dev- (e.g. dev-master)
โ—‹ Specific revisions (e.g. dev-master#9823928)
{
"name": "netresearch/project",
"require": {
"typo3/cms": "6.2.*"
},
"require-dev": {
"phpunit/phpunit": "^4.2"
}
}
composer: Version constraints
โ— Exact: 1.2.7
โ— Range:
โ—‹ >=1.0
โ—‹ >=1.0 <2.0 (AND)
โ—‹ >=1.0 <1.1 || >=1.2
โ—‹ 1.0 - 2.0 โ‰™ >=1.0.0 <2.1
โ—‹ 1.0.0 - 2.1.0 โ‰™ >=1.0.0 <=2.1.0
โ— Next significant release (tilde vs. caret):
โ—‹ ~1.2 โ‰™ >=1.2 <2.0.0
โ—‹ ~1.2.3 โ‰™ >=1.2.3 <1.3.0
โ—‹ ^1.2 โ‰™ >=1.2.0 <2.0.0
โ—‹ ^1.2.3 โ‰™ >=1.2.3 <2.0.0
โ—‹ ^0.3 โ‰™ >=0.3.0 <0.4.0 (security behaviour for pre-1.0 versions only)
composer: Example project
{
"repositories": [ { "type": "composer", "url": "https://composer.typo3.org" } ],
"name": "netresearch/project",
"description" : "Siamar typo3 root project",
"config": { "platform": { "php": "5.5" } },
"license": "proprietary",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"typo3/cms": "~6.2",
"typo3-ter/realurl": "*"
}
}
composer: Example package
{
"name": "netresearch/kite",
"description": "Yet another build and deployment tool - inspired by TYPO3.Surf",
"license": "MIT",
"require": {
"symfony/expression-language": "~2.7",
"symfony/console": "~2.7",
"symfony/process": "~2.7",
"php": ">=5.4.0"
},
"autoload": { "psr-4": { "NetresearchKite": "src/" } },
"autoload-dev": { "psr-4": { "NetresearchKiteTest": "tests/" } },,
"bin": ["bin/kite"]
}
composer: Common commands
โ— composer init
โ—‹ Assistant to create the composer.json for a new project
โ— composer install [--optimize-autoloader]
โ—‹ Installs all packages at their state locked in composer.lock
โ—‹ If composer.lock isnโ€™t present, it does the same as composer update
โ—‹ Generates autoloader
โ— composer update
โ—‹ Installs the latest package versions (matching the required constraints)
โ—‹ Uninstalls packages that are installed but not required anymore
โ—‹ Generates autoloader
โ— composer show [--installed]
โ—‹ Shows the installed packages and their versions
โ— composer require "package=1.2.7"
โ—‹ Adds package to require in composer.json and installs it
composer: The lock file
โ— composer.lock
โ—‹ Lists packages & versions
โ—‹ Replaces composer.json
โ—‹ Created by composer install (installs your dependencies)
โ—‹ Updated by composer update (updates your dependencies)
โ—‹ SHOULD be committed in your VCS and shipped with your releases
โ— Benefits
โ—‹ Everyone on a team works with exactly the same dependency versions
โ—‹ When deploying, all machines run exactly the same dependency versions
โ—‹ Users will never get dependency versions that you did not test with
โ— Cons
โ—‹ Hindering during development: The exact revision of dev packages is locked => rebase and
merge are painful
โ—‹ => Workaround: Advanced checkout, merge and deployment with kite
โ€œ
Whatโ€™s kite?
โ— Yet another build automation tool inspired by TYPO3.Surf
โ— Everything in PHP: The tool itself as well as all configuration
โ— ECMA like variable access:
โ—‹ Sub tasks can access variables from parent but can set them on their own as well
โ—‹ Advanced logic during execution possible by using expressions
(utilizing Symfony Expression Language)
โ— Node based:
โ—‹ Unlimited number of remote targets possible
โ—‹ Nodes can be set globally or only for specific (sub) tasks
โ—‹ Remote tasks operate on all current nodes
โ— Dry-Run available by design (yet the tasks to include need to be configured)
โ— Originally planned and built as TYPO3 extension but later on ported to
generic composer package - installable globally or per project
kite: Task organization
โ— Tasks
โ—‹ Smallest, predefined steps (currently: answer, break, callback, choose, composer, confirm,
evaluate, exit, fs, git, include, iterate, output, phar, remoteShell, sub, tar, tryCatch)
โ— Workflows
โ—‹ Sets of tasks predefined in classes
โ—‹ Top level workflows can expose command line arguments and options
โ— Jobs
โ—‹ Available as commands on command line
โ—‹ Set of tasks and/or workflows defined in arrays (in arbitrary depth)
โ—‹ Configurable command line arguments and options
โ— Presets
โ—‹ Configuration presets (including f.i. common jobs)
โ— Configuration file (typo3conf/Kite.php, app/etc/kite.php, kite.php)
โ—‹ Defines the jobs; can load and override presets
kite: Common jobs
โ— kite [help command]
โ—‹ Gives a list of all available commands (jobs) or shows help for the given one
โ— kite checkout [--merge] branch
โ—‹ Goes through all composer packages and checks out the branch there if itโ€™s available
โ—‹ After checking out the branch on a package it goes through all packages requiring it and
updates the version constraint to that branch
โ—‹ When --merge is passed, the currently checked out branch is merged into the branch to
checkout
โ— kite merge [--squash] [--message=โ€Messageโ€] branch
โ—‹ Goes through all composer packages and merges the branch into the currently checked out
โ— kite package-foreach [--git] command
โ—‹ Runs a command for each composer package (optionally only dev packages)
โ— kite cc, kite ccr [stage]
โ—‹ Clears caches locally (cc) or on all nodes of a specific stage
kite: Deployment jobs
โ— kite deploy [stage]
โ—‹ Runs the deployment for all nodes on the given or selected stage
โ— kite rollout [stage]
โ—‹ Runs the deployment for all nodes for each stage until (including) the given stage
Links
- Composer homepage and documentation
http://getcomposer.org
http://slides.seld.be/ (lists slides for some advanced composer talks)
- Packagist
http://packagist.org
- Kite on github
https://github.com/netresearch/kite
- Kite on packagist
https://packagist.org/packages/netresearch/kite
- Kite task and workflow reference
https://github.com/netresearch/kite/blob/master/docs/reference.rst

More Related Content

What's hot

Clang Analyzer Tool Review
Clang Analyzer Tool ReviewClang Analyzer Tool Review
Clang Analyzer Tool Review
Doug Schuster
ย 
wxFormBuilder - Tutorial on โ€œA GUI for making GUIsโ€ for Python
wxFormBuilder - Tutorial on โ€œA GUI for making GUIsโ€ for PythonwxFormBuilder - Tutorial on โ€œA GUI for making GUIsโ€ for Python
wxFormBuilder - Tutorial on โ€œA GUI for making GUIsโ€ for Python
Umar Yusuf
ย 
Dynamic PHP web-application analysis
Dynamic PHP web-application analysisDynamic PHP web-application analysis
Dynamic PHP web-application analysis
ax330d
ย 

What's hot (20)

Cache in Chromium: Disk Cache
Cache in Chromium: Disk CacheCache in Chromium: Disk Cache
Cache in Chromium: Disk Cache
ย 
GNU Make, Autotools, CMake ็ฐกไป‹
GNU Make, Autotools, CMake ็ฐกไป‹GNU Make, Autotools, CMake ็ฐกไป‹
GNU Make, Autotools, CMake ็ฐกไป‹
ย 
Bsdtw17: lightning talks/wip sessions
Bsdtw17: lightning talks/wip sessionsBsdtw17: lightning talks/wip sessions
Bsdtw17: lightning talks/wip sessions
ย 
Clang Analyzer Tool Review
Clang Analyzer Tool ReviewClang Analyzer Tool Review
Clang Analyzer Tool Review
ย 
Inside debian-installer
Inside debian-installerInside debian-installer
Inside debian-installer
ย 
Introduction to the LLVM Compiler System
Introduction to the LLVM  Compiler SystemIntroduction to the LLVM  Compiler System
Introduction to the LLVM Compiler System
ย 
Composer namespacing
Composer namespacingComposer namespacing
Composer namespacing
ย 
wxFormBuilder - Tutorial on โ€œA GUI for making GUIsโ€ for Python
wxFormBuilder - Tutorial on โ€œA GUI for making GUIsโ€ for PythonwxFormBuilder - Tutorial on โ€œA GUI for making GUIsโ€ for Python
wxFormBuilder - Tutorial on โ€œA GUI for making GUIsโ€ for Python
ย 
The eID on Linux in 2015
The eID on Linux in 2015The eID on Linux in 2015
The eID on Linux in 2015
ย 
Dynamic PHP web-application analysis
Dynamic PHP web-application analysisDynamic PHP web-application analysis
Dynamic PHP web-application analysis
ย 
Eclipse - Installation and quick start guide
Eclipse - Installation and quick start guideEclipse - Installation and quick start guide
Eclipse - Installation and quick start guide
ย 
It gilde 20150209
It gilde 20150209It gilde 20150209
It gilde 20150209
ย 
Fluentd Hacking Guide at RubyKaigi 2014
Fluentd Hacking Guide at RubyKaigi 2014Fluentd Hacking Guide at RubyKaigi 2014
Fluentd Hacking Guide at RubyKaigi 2014
ย 
What is new in Go 1.8
What is new in Go 1.8What is new in Go 1.8
What is new in Go 1.8
ย 
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
ย 
ๅตŒๅ…ฅๅผLinux่ชฒ็จ‹-GNU Toolchain
ๅตŒๅ…ฅๅผLinux่ชฒ็จ‹-GNU ToolchainๅตŒๅ…ฅๅผLinux่ชฒ็จ‹-GNU Toolchain
ๅตŒๅ…ฅๅผLinux่ชฒ็จ‹-GNU Toolchain
ย 
FFmpeg - the universal multimedia toolkit
FFmpeg - the universal multimedia toolkitFFmpeg - the universal multimedia toolkit
FFmpeg - the universal multimedia toolkit
ย 
Clang compiler `
Clang compiler `Clang compiler `
Clang compiler `
ย 
A Look at Command Line Swift
A Look at Command Line SwiftA Look at Command Line Swift
A Look at Command Line Swift
ย 
Labri 2021-invited-talk
Labri 2021-invited-talkLabri 2021-invited-talk
Labri 2021-invited-talk
ย 

Similar to Development and deployment with composer and kite

Composer Helpdesk
Composer HelpdeskComposer Helpdesk
Composer Helpdesk
Sven Rautenberg
ย 
Don't Fear the Autotools
Don't Fear the AutotoolsDon't Fear the Autotools
Don't Fear the Autotools
Scott Garman
ย 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
Jason Grimes
ย 
Compiler design notes phases of compiler
Compiler design notes phases of compilerCompiler design notes phases of compiler
Compiler design notes phases of compiler
ovidlivi91
ย 

Similar to Development and deployment with composer and kite (20)

PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
ย 
Autotools pratical training
Autotools pratical trainingAutotools pratical training
Autotools pratical training
ย 
Introduction to containers
Introduction to containersIntroduction to containers
Introduction to containers
ย 
Composer Best Practices
Composer Best PracticesComposer Best Practices
Composer Best Practices
ย 
Composer Best Practices
Composer Best PracticesComposer Best Practices
Composer Best Practices
ย 
Composer Best Practices.pdf
Composer Best Practices.pdfComposer Best Practices.pdf
Composer Best Practices.pdf
ย 
Composer Helpdesk
Composer HelpdeskComposer Helpdesk
Composer Helpdesk
ย 
Don't Fear the Autotools
Don't Fear the AutotoolsDon't Fear the Autotools
Don't Fear the Autotools
ย 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
ย 
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
ย 
Composer & Drupal
Composer & DrupalComposer & Drupal
Composer & Drupal
ย 
Autotools
AutotoolsAutotools
Autotools
ย 
UCL All of the Things (MeetBSD California 2014 Lightning Talk)
UCL All of the Things (MeetBSD California 2014 Lightning Talk)UCL All of the Things (MeetBSD California 2014 Lightning Talk)
UCL All of the Things (MeetBSD California 2014 Lightning Talk)
ย 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
ย 
Composer
ComposerComposer
Composer
ย 
Open source projects with python
Open source projects with pythonOpen source projects with python
Open source projects with python
ย 
Magento Docker Setup.pdf
Magento Docker Setup.pdfMagento Docker Setup.pdf
Magento Docker Setup.pdf
ย 
Compiler design notes phases of compiler
Compiler design notes phases of compilerCompiler design notes phases of compiler
Compiler design notes phases of compiler
ย 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
ย 
Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008
ย 

Recently uploaded

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
ย 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
SUHANI PANDEY
ย 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
sivaprakash250
ย 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
ย 

Recently uploaded (20)

Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
ย 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
ย 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
ย 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
ย 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
ย 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
ย 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ย 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
ย 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
ย 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
ย 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ย 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
ย 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
ย 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
ย 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
ย 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
ย 
Top Rated Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
ย 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
ย 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
ย 

Development and deployment with composer and kite

  • 2. Whatโ€™s composer? โ— Tool for dependency management in PHP applications โ— Command line app written in PHP โ— Manages packages on a per-project basis (unlike Apt, Yum etc.) โ— Strongly inspired by similar projects in other languages like npm or bundler โ— Suppose: โ—‹ You have a project that depends on a number of libraries. โ—‹ Some of those libraries depend on other libraries. โ— Composer: โ—‹ Enables you to declare the libraries you depend on. โ—‹ Finds out which versions of which packages can and need to be installed, and installs them (meaning it downloads them into your project). โ€œ
  • 3. composer: Basic Usage โ— Everything related to composer is a kept in a composer.json at project or package root โ— Package names: โ—‹ vendor/package-name โ— Versions: โ—‹ Semantic versioning: x.y.z[-stability] โ–  x: Major version (potentially breaking changes) โ–  y: Minor version (new, compatible functionality) โ–  z: Patch version (bug fixes) โ–  stability flag: Flag stating the stability of a pre-release (e.g. 2.0.0-alpha) โ—‹ Branch names, prefixed by dev- (e.g. dev-master) โ—‹ Specific revisions (e.g. dev-master#9823928) { "name": "netresearch/project", "require": { "typo3/cms": "6.2.*" }, "require-dev": { "phpunit/phpunit": "^4.2" } }
  • 4. composer: Version constraints โ— Exact: 1.2.7 โ— Range: โ—‹ >=1.0 โ—‹ >=1.0 <2.0 (AND) โ—‹ >=1.0 <1.1 || >=1.2 โ—‹ 1.0 - 2.0 โ‰™ >=1.0.0 <2.1 โ—‹ 1.0.0 - 2.1.0 โ‰™ >=1.0.0 <=2.1.0 โ— Next significant release (tilde vs. caret): โ—‹ ~1.2 โ‰™ >=1.2 <2.0.0 โ—‹ ~1.2.3 โ‰™ >=1.2.3 <1.3.0 โ—‹ ^1.2 โ‰™ >=1.2.0 <2.0.0 โ—‹ ^1.2.3 โ‰™ >=1.2.3 <2.0.0 โ—‹ ^0.3 โ‰™ >=0.3.0 <0.4.0 (security behaviour for pre-1.0 versions only)
  • 5. composer: Example project { "repositories": [ { "type": "composer", "url": "https://composer.typo3.org" } ], "name": "netresearch/project", "description" : "Siamar typo3 root project", "config": { "platform": { "php": "5.5" } }, "license": "proprietary", "minimum-stability": "dev", "prefer-stable": true, "require": { "typo3/cms": "~6.2", "typo3-ter/realurl": "*" } }
  • 6. composer: Example package { "name": "netresearch/kite", "description": "Yet another build and deployment tool - inspired by TYPO3.Surf", "license": "MIT", "require": { "symfony/expression-language": "~2.7", "symfony/console": "~2.7", "symfony/process": "~2.7", "php": ">=5.4.0" }, "autoload": { "psr-4": { "NetresearchKite": "src/" } }, "autoload-dev": { "psr-4": { "NetresearchKiteTest": "tests/" } },, "bin": ["bin/kite"] }
  • 7. composer: Common commands โ— composer init โ—‹ Assistant to create the composer.json for a new project โ— composer install [--optimize-autoloader] โ—‹ Installs all packages at their state locked in composer.lock โ—‹ If composer.lock isnโ€™t present, it does the same as composer update โ—‹ Generates autoloader โ— composer update โ—‹ Installs the latest package versions (matching the required constraints) โ—‹ Uninstalls packages that are installed but not required anymore โ—‹ Generates autoloader โ— composer show [--installed] โ—‹ Shows the installed packages and their versions โ— composer require "package=1.2.7" โ—‹ Adds package to require in composer.json and installs it
  • 8. composer: The lock file โ— composer.lock โ—‹ Lists packages & versions โ—‹ Replaces composer.json โ—‹ Created by composer install (installs your dependencies) โ—‹ Updated by composer update (updates your dependencies) โ—‹ SHOULD be committed in your VCS and shipped with your releases โ— Benefits โ—‹ Everyone on a team works with exactly the same dependency versions โ—‹ When deploying, all machines run exactly the same dependency versions โ—‹ Users will never get dependency versions that you did not test with โ— Cons โ—‹ Hindering during development: The exact revision of dev packages is locked => rebase and merge are painful โ—‹ => Workaround: Advanced checkout, merge and deployment with kite โ€œ
  • 9. Whatโ€™s kite? โ— Yet another build automation tool inspired by TYPO3.Surf โ— Everything in PHP: The tool itself as well as all configuration โ— ECMA like variable access: โ—‹ Sub tasks can access variables from parent but can set them on their own as well โ—‹ Advanced logic during execution possible by using expressions (utilizing Symfony Expression Language) โ— Node based: โ—‹ Unlimited number of remote targets possible โ—‹ Nodes can be set globally or only for specific (sub) tasks โ—‹ Remote tasks operate on all current nodes โ— Dry-Run available by design (yet the tasks to include need to be configured) โ— Originally planned and built as TYPO3 extension but later on ported to generic composer package - installable globally or per project
  • 10. kite: Task organization โ— Tasks โ—‹ Smallest, predefined steps (currently: answer, break, callback, choose, composer, confirm, evaluate, exit, fs, git, include, iterate, output, phar, remoteShell, sub, tar, tryCatch) โ— Workflows โ—‹ Sets of tasks predefined in classes โ—‹ Top level workflows can expose command line arguments and options โ— Jobs โ—‹ Available as commands on command line โ—‹ Set of tasks and/or workflows defined in arrays (in arbitrary depth) โ—‹ Configurable command line arguments and options โ— Presets โ—‹ Configuration presets (including f.i. common jobs) โ— Configuration file (typo3conf/Kite.php, app/etc/kite.php, kite.php) โ—‹ Defines the jobs; can load and override presets
  • 11. kite: Common jobs โ— kite [help command] โ—‹ Gives a list of all available commands (jobs) or shows help for the given one โ— kite checkout [--merge] branch โ—‹ Goes through all composer packages and checks out the branch there if itโ€™s available โ—‹ After checking out the branch on a package it goes through all packages requiring it and updates the version constraint to that branch โ—‹ When --merge is passed, the currently checked out branch is merged into the branch to checkout โ— kite merge [--squash] [--message=โ€Messageโ€] branch โ—‹ Goes through all composer packages and merges the branch into the currently checked out โ— kite package-foreach [--git] command โ—‹ Runs a command for each composer package (optionally only dev packages) โ— kite cc, kite ccr [stage] โ—‹ Clears caches locally (cc) or on all nodes of a specific stage
  • 12. kite: Deployment jobs โ— kite deploy [stage] โ—‹ Runs the deployment for all nodes on the given or selected stage โ— kite rollout [stage] โ—‹ Runs the deployment for all nodes for each stage until (including) the given stage
  • 13. Links - Composer homepage and documentation http://getcomposer.org http://slides.seld.be/ (lists slides for some advanced composer talks) - Packagist http://packagist.org - Kite on github https://github.com/netresearch/kite - Kite on packagist https://packagist.org/packages/netresearch/kite - Kite task and workflow reference https://github.com/netresearch/kite/blob/master/docs/reference.rst