SlideShare a Scribd company logo
Nikita Pohrebniak,
Software
Development
Manager
Acquia BLT for the Win, or
How to speed up the project setup,
development and deployment
SPEAKER
2
Software Development Manager
ImageX
nikitap@imagexmedia.com
Nikita Pohrebniak
ABOUT IMAGEX
● Founded in 2001, have successfully
launched 500+ web initiatives
● Offices in Vancouver, Kelowna & Kiev
● 70 full-time web specialists, including
dedicated design/UX, SEO/digital
marketing teams
● Global offices provide broad time-zone
coverage, 20+ hours/day
● One of the highest rated customer satisfaction
scores globally for web agencies (Clutch.co)
● Higher education division with specialized
project team
● Bjorn Thomson & Laura Ballay, 15 years at UBC
& 10 Years at CMU & SFU, respectively
● Clients include: Stanford University, University
of Arizona, UC Irvine, CSU - Stanislaus, Trinity
University, YMCA
3
1 |
2 |
3 |
4 |
5 |
6 |
Yet another tool?! The Problem.
Acquia BLT. The Solution.
What’s under the hood? The key features and how
to speed up the development process using BLT.
Raising the bar: ways to use Acquia BLT by the
Technical Architects/Lead Developers.
What if I need more? No problem! Extending and
overriding Acquia BLT.
Q&A.
AGENDA
444
Yet another tool?
The problem.1
● Projects with different requirements and level of complexity.
● Various hosting platforms.
● Distributed teams.
● Lack of standards.
6
Yet another tool? The problem.
The following standard scripts and tools were required
● Boilerplate project, with Docksal in mind;
● Check the coding standards;
● Run the tests;
● Build script for Bitbucket Pipelines;
● Standardize the deployment process;
● Make everyone happy!
7
Yet another tool? The problem.
Acquia BLT.
The Solution.2
9
What’s under the hood
Acquia Build and Launch Tool. The Solution.
For the Technical Architects:
● Add Drupal VM to the project;
● Generate the multisite;
● Generate empty config_splits;
● Generate the default CI configuration;
● Build Artifacts.
● Even more.
For the Developers:
● Install/Reinstall Drupal;
● Add git hooks;
● Pull DB and Files from remote;
● Build the frontend assets;
● Run tests;
● Make coffee (Finally).
BLT Features for the
Developers.3
11
Install/Reinstall Drupal
BLT Features for the Developers.
● blt source:build //Generates all required files for a full build
● blt drupal:install
public function build() {
$this->invokeCommands([
'tests:behat:init:config',
// source:build:composer must run prior to blt:init:settings to ensure
// that scaffold files are present.
'source:build:composer',
'blt:init:git-hooks',
'blt:init:settings',
'source:build:frontend',
]);
$this->invokeHook("post-setup-build");
}
12
Git Hooks
BLT Features for the Developers.
● blt:init:git-hooks
13
Pull DB and Files from Remote
BLT Features for the Developers.
● blt drupal:sync:default:site
● blt drupal:sync:default:db
● blt drupal:sync:files
● blt drupal:sync:private-files
drush:
aliases:
remote: projectname.prod
local: self
ci: self
default_alias: '${drush.aliases.local}'
14
Build/compile the frontend assets
BLT Features for the Developers.
● source:build:frontend-reqs
● source:build:frontend-assets
● source:build:frontend
command-hooks:
frontend-reqs:
dir: '${project.theme.dir}'
command: 'npm install && cd ${docroot}/modules/custom/program_finder && npm install && cd
${docroot}/modules/custom/event_finder && npm install'
frontend-assets:
dir: '${project.theme.dir}'
command: 'npm run build && cd ${docroot}/modules/custom/program_finder && npm run build && cd
${docroot}/modules/custom/event_finder && npm run build'
15
Run tests
BLT Features for the Developers.
● blt tests:all
● tests:phpunit
● blt tests:behat
● blt tests:frontend
● blt validate:composer
● blt validate:phpcs
● blt validate:twig
● blt validate:yaml
● blt tests:security-updates
BLT Features for the
Technical Architects &
Lead Developers.
4
17
Add Drupal VM to the Project
BLT Features for the Technical Architects & Lead Developers.
● blt recipes:drupalvm:init
18
Generate the multisite
BLT Features for the Technical Architects & Lead Developers.
● blt recipes:multisite:init
blt recipes:multisite:init
This will generate a new site in the docroot/sites directory.
Site machine name (e.g. 'example') subsite
Local domain name [http://local.subsite.com]
Would you like to configure the local database credentials? (y/n) n
Default remote drush alias [subsite.remote]
Default local drush alias [subsite.local]
> blt:init:settings
Hash salt already exists.
New site generated at /var/www/docroot/sites/subsite
Drush aliases generated:
* @subsite.remote
Config directory created for new site at config/subsite
19
Generate empty config_splits
BLT Features for the Technical Architects & Lead Developers.
● blt recipes:config:init:splits
git:(master) ✗ blt recipes:config:init:splits
This command will generate configuration and directories for the following environment
based splits: Local, CI, Dev, Stage, and Prod.
[FilesystemFilesystemStack] mkdir ["/var/www/docroot/../config/envs/local"]
[FileWrite] Writing to
/var/www/docroot/../config/default/config_split.config_split.local.yml.
[FilesystemFilesystemStack] mkdir ["/var/www/docroot/../config/envs/ci"]
[FileWrite] Writing to
/var/www/docroot/../config/default/config_split.config_split.ci.yml.
[FilesystemFilesystemStack] mkdir ["/var/www/docroot/../config/envs/dev"]
[FileWrite] Writing to
/var/www/docroot/../config/default/config_split.config_split.dev.yml.
[FilesystemFilesystemStack] mkdir ["/var/www/docroot/../config/envs/stage"]
[FileWrite] Writing to
/var/www/docroot/../config/default/config_split.config_split.stage.yml.
[FilesystemFilesystemStack] mkdir ["/var/www/docroot/../config/envs/prod"]
[FileWrite] Writing to
/var/www/docroot/../config/default/config_split.config_split.prod.yml.
20
Generate the default CI configuration
BLT Features for the Technical Architects & Lead Developers.
● blt recipes:ci:gitlab:init
● blt recipes:ci:pipelines:init
● blt recipes:ci:probo:init
● blt recipes:ci:travis:init
stages:
- validate
- build
- test
- deploy
variables:
APP_NAME: Project
before_script:
- echo "hello world"
validate:
stage: validate
script:
- blt validate:all
build:
stage: build
script:
- composer validate --no-check-all --ansi
- composer install --ansi
- blt source:build --ansi --verbose
test:
stage: test
script:
- blt tests --define tests.run-server=true --ansi --no-interaction
--verbose
production:
stage: deploy
script:
- echo "Launching application"
environment:
name: production
url: http://$APP_NAME.example.com
only:
- master
21
Build and Deploy Artifacts
BLT Features for the Technical Architects & Lead Developers.
● blt artifact:build
● blt artifact:deploy
In blt.yml
drush:
aliases:
remote: projectname.prod
local: self
ci: self
default_alias : '${drush.aliases.local}'
In bitbucket-pipelines.yml
${BIN_DIR}/blt -vvv artifact:deploy --commit-msg "Bitbucket build - $BITBUCKET_BUILD_NUMBER, Commit
$BITBUCKET_COMMIT" --branch "$BITBUCKET_BRANCH" --no-interaction
22
Build and Deploy Artifacts
BLT Features for the Technical Architects & Lead Developers.
if ($options['dry-run']) {
$this->logger->warning("This will be a dry run, the artifact will not be pushed.");
}
$this->checkDirty($options);
if (isset($options['ignore-platform-reqs'])) {
$this->ignorePlatformReqs = $options['ignore-platform-reqs'];
}
if (!$options['tag'] && !$options['branch']) {
$this->createTag = $this->confirm("Would you like to create a tag?", $this->createTag);
}
$this->commitMessage = $this->getCommitMessage($options);
if ($options['tag'] || $this->createTag) {
// Warn if they're creating a tag and we won't tag the source for them.
if (!$this->tagSource) {
$this->say("Config option deploy.tag_source if FALSE. The source repo will not be tagged.");
}
$this->deployToTag($options);
}
else {
$this->deployToBranch($options);
}
23
And even more cool features
BLT Features for the Technical Architects & Lead Developers.
● blt recipes:simplesamlphp:init
● blt recipes:acsf:init:all
● blt recipes:behat:init
● blt recipes:aliases:init:acquia
● blt source:fix:php-standards
Extending and overriding
Acquia BLT.5
25
Extending and overriding Acquia BLT.
● Built with “Robo” and “Annotated Command”.
● Supports defining new custom commands.
● Allows hooking into existing commands.
● Replace/override a Robo command using “Replace Command Hook”.
● Disable command.
26
Define new command
Extending and overriding Acquia BLT.
● blt recipes:blt:command:init
**
* Defines commands in the "custom" namespace.
*/
class ExampleCommands extends BltTasks {
/**
* Print "Hello world!" to the console.
*
* @command custom:hello
* @description This is an example command.
*/
public function hello() {
$this->say("Hello world!" );
}
}
27
Hook into the existing command
Extending and overriding Acquia BLT.
/**
* Defines commands in the "custom" namespace.
*/
class ExampleCommands extends BltTasks {
/**
* This will be called before the `custom:hello` command is executed.
*
* @hook command-event custom:hello
*/
public function preExampleHello (ConsoleCommandEvent $event) {
$command = $event->getCommand();
$this->say("preCommandMessage hook: The {$command->getName()} command is about to run!" );
}
}
28
Replace/override a BLT command
Extending and overriding Acquia BLT.
class CustomHelloReplaceCommandHook {
/**
* Parameters must match original command method.
*
* @hook replace-command custom:hello
*/
public function myHelloReplacement () {
$this->say("Goodbye world!");
}
}
29
Disable command
Extending and overriding Acquia BLT.
In blt.yml
disable-targets:
custom:
hello: true
Q&A.
6
QUESTIONS?
31
Software Development Manager
ImageX
nikitap@imagexmedia.com
Nikita Pohrebniak

More Related Content

PPT
Problemática de los Armadores Pesqueros de la Ley 26920 (Asociación Nacional ...
PPTX
PRESUPUESTO
PPTX
Blt introduction
PPTX
Drupal 8 Development at the Speed of Lightning (& BLT)
PDF
Development Setup of B-Translator
PDF
Automatisation in development and testing - within budget
PDF
What makes me "Grunt"?
PDF
Efficient development workflows with composer
Problemática de los Armadores Pesqueros de la Ley 26920 (Asociación Nacional ...
PRESUPUESTO
Blt introduction
Drupal 8 Development at the Speed of Lightning (& BLT)
Development Setup of B-Translator
Automatisation in development and testing - within budget
What makes me "Grunt"?
Efficient development workflows with composer

Similar to Acquia BLT for the Win, or How to speed up the project setup, development and deployment (20)

PPTX
Containers @ KitchenStories - DevOps 201704
PDF
Modernize Your Drupal Development
PDF
Configuration Kits - DrupalCamp NYC 2021
PDF
One commit, one release. Continuously delivering a Symfony project.
PDF
Live deployment, ci, drupal
PDF
Creating Sentiment Line Chart with Watson
PDF
Intro to IBM Bluemix DevOps Services, an open lab for IBM InterConnect
PDF
Automatisation in development and testing - within budget [IronCamp prague 20...
PDF
Advanced Topics in Continuous Deployment
PPTX
Git Going w/ Git
PDF
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
PDF
DevOps for Drupal: Why We Cook With Chef
PPTX
drupal ci cd concept cornel univercity.pptx
PDF
Creating a Reusable Drupal Website for Higher Education - at USG Tech Day
PDF
Open Source Tools for Leveling Up Operations FOSSET 2014
PDF
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
PPT
Managing Servers with Chef
PDF
Drupal Best Practices
PDF
Intro to IBM Bluemix DevOps Services, a Workshop with a Cloudant twist
PDF
Efficient development workflows with composer
Containers @ KitchenStories - DevOps 201704
Modernize Your Drupal Development
Configuration Kits - DrupalCamp NYC 2021
One commit, one release. Continuously delivering a Symfony project.
Live deployment, ci, drupal
Creating Sentiment Line Chart with Watson
Intro to IBM Bluemix DevOps Services, an open lab for IBM InterConnect
Automatisation in development and testing - within budget [IronCamp prague 20...
Advanced Topics in Continuous Deployment
Git Going w/ Git
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
DevOps for Drupal: Why We Cook With Chef
drupal ci cd concept cornel univercity.pptx
Creating a Reusable Drupal Website for Higher Education - at USG Tech Day
Open Source Tools for Leveling Up Operations FOSSET 2014
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Managing Servers with Chef
Drupal Best Practices
Intro to IBM Bluemix DevOps Services, a Workshop with a Cloudant twist
Efficient development workflows with composer
Ad

More from DrupalCamp Kyiv (20)

PDF
Speed up the site building with Drupal's Bootstrap Layout Builder
PDF
Performance Monitoring with Google Lighthouse
PPTX
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
PDF
Upgrading to Drupal 9
PDF
THE INTERNET OF THINGS IS GETTING REAL
PDF
FRONT-END COMPONENTS IN DRUPAL THEME. "KAIZEN" - DRUPAL 8 THEME FROM SKILLD
PDF
DRUPAL AND ELASTICSEARCH
PDF
WHAT WE LEARNED FROM OPEN SOCIAL IN 3 YEARS, MOVING FROM AN AGENCY TO A PRODU...
PDF
Blackfire Workshop
PDF
DRUPAL 8 STORAGES OVERVIEW
PPTX
ONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICES
DOCX
1-1 MEETING: STEP-BY-STEP-HOW-TO
PPTX
UX DURING MODULE INSTALLATION AND CONFIGURATION
PDF
SWITCHING FROM QA ENGINEER TO PROJECT MANAGER - LEVEL UP OR DOWN?
PDF
TECHNOLOGIES-POWERED WEB AND THE POST-BROWSER ERA
PPTX
PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPAL
PDF
DRUPAL AUDITS MADE FASTR
PDF
FROM DISTRO TO CUSTOM - HOW WE CREATE GREAT COMMUNITIES FOR EVERY ORGANIZATIO...
PDF
SEARCH API: TIPS AND TRICKS - FROM BEGINNING TO CUSTOM SOLUTIONS
PDF
DEVOPS & THE DEATH AND REBIRTH OF CHILDHOOD INNOCENCE
Speed up the site building with Drupal's Bootstrap Layout Builder
Performance Monitoring with Google Lighthouse
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
Upgrading to Drupal 9
THE INTERNET OF THINGS IS GETTING REAL
FRONT-END COMPONENTS IN DRUPAL THEME. "KAIZEN" - DRUPAL 8 THEME FROM SKILLD
DRUPAL AND ELASTICSEARCH
WHAT WE LEARNED FROM OPEN SOCIAL IN 3 YEARS, MOVING FROM AN AGENCY TO A PRODU...
Blackfire Workshop
DRUPAL 8 STORAGES OVERVIEW
ONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICES
1-1 MEETING: STEP-BY-STEP-HOW-TO
UX DURING MODULE INSTALLATION AND CONFIGURATION
SWITCHING FROM QA ENGINEER TO PROJECT MANAGER - LEVEL UP OR DOWN?
TECHNOLOGIES-POWERED WEB AND THE POST-BROWSER ERA
PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPAL
DRUPAL AUDITS MADE FASTR
FROM DISTRO TO CUSTOM - HOW WE CREATE GREAT COMMUNITIES FOR EVERY ORGANIZATIO...
SEARCH API: TIPS AND TRICKS - FROM BEGINNING TO CUSTOM SOLUTIONS
DEVOPS & THE DEATH AND REBIRTH OF CHILDHOOD INNOCENCE
Ad

Recently uploaded (20)

PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Pre independence Education in Inndia.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Cell Structure & Organelles in detailed.
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Insiders guide to clinical Medicine.pdf
PPTX
master seminar digital applications in india
PPTX
Institutional Correction lecture only . . .
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Computing-Curriculum for Schools in Ghana
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
O5-L3 Freight Transport Ops (International) V1.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Pre independence Education in Inndia.pdf
Microbial disease of the cardiovascular and lymphatic systems
Final Presentation General Medicine 03-08-2024.pptx
Cell Structure & Organelles in detailed.
STATICS OF THE RIGID BODIES Hibbelers.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Anesthesia in Laparoscopic Surgery in India
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Microbial diseases, their pathogenesis and prophylaxis
Insiders guide to clinical Medicine.pdf
master seminar digital applications in india
Institutional Correction lecture only . . .
Renaissance Architecture: A Journey from Faith to Humanism
Computing-Curriculum for Schools in Ghana
Abdominal Access Techniques with Prof. Dr. R K Mishra

Acquia BLT for the Win, or How to speed up the project setup, development and deployment

  • 1. Nikita Pohrebniak, Software Development Manager Acquia BLT for the Win, or How to speed up the project setup, development and deployment
  • 3. ABOUT IMAGEX ● Founded in 2001, have successfully launched 500+ web initiatives ● Offices in Vancouver, Kelowna & Kiev ● 70 full-time web specialists, including dedicated design/UX, SEO/digital marketing teams ● Global offices provide broad time-zone coverage, 20+ hours/day ● One of the highest rated customer satisfaction scores globally for web agencies (Clutch.co) ● Higher education division with specialized project team ● Bjorn Thomson & Laura Ballay, 15 years at UBC & 10 Years at CMU & SFU, respectively ● Clients include: Stanford University, University of Arizona, UC Irvine, CSU - Stanislaus, Trinity University, YMCA 3
  • 4. 1 | 2 | 3 | 4 | 5 | 6 | Yet another tool?! The Problem. Acquia BLT. The Solution. What’s under the hood? The key features and how to speed up the development process using BLT. Raising the bar: ways to use Acquia BLT by the Technical Architects/Lead Developers. What if I need more? No problem! Extending and overriding Acquia BLT. Q&A. AGENDA 444
  • 6. ● Projects with different requirements and level of complexity. ● Various hosting platforms. ● Distributed teams. ● Lack of standards. 6 Yet another tool? The problem.
  • 7. The following standard scripts and tools were required ● Boilerplate project, with Docksal in mind; ● Check the coding standards; ● Run the tests; ● Build script for Bitbucket Pipelines; ● Standardize the deployment process; ● Make everyone happy! 7 Yet another tool? The problem.
  • 9. 9 What’s under the hood Acquia Build and Launch Tool. The Solution. For the Technical Architects: ● Add Drupal VM to the project; ● Generate the multisite; ● Generate empty config_splits; ● Generate the default CI configuration; ● Build Artifacts. ● Even more. For the Developers: ● Install/Reinstall Drupal; ● Add git hooks; ● Pull DB and Files from remote; ● Build the frontend assets; ● Run tests; ● Make coffee (Finally).
  • 10. BLT Features for the Developers.3
  • 11. 11 Install/Reinstall Drupal BLT Features for the Developers. ● blt source:build //Generates all required files for a full build ● blt drupal:install public function build() { $this->invokeCommands([ 'tests:behat:init:config', // source:build:composer must run prior to blt:init:settings to ensure // that scaffold files are present. 'source:build:composer', 'blt:init:git-hooks', 'blt:init:settings', 'source:build:frontend', ]); $this->invokeHook("post-setup-build"); }
  • 12. 12 Git Hooks BLT Features for the Developers. ● blt:init:git-hooks
  • 13. 13 Pull DB and Files from Remote BLT Features for the Developers. ● blt drupal:sync:default:site ● blt drupal:sync:default:db ● blt drupal:sync:files ● blt drupal:sync:private-files drush: aliases: remote: projectname.prod local: self ci: self default_alias: '${drush.aliases.local}'
  • 14. 14 Build/compile the frontend assets BLT Features for the Developers. ● source:build:frontend-reqs ● source:build:frontend-assets ● source:build:frontend command-hooks: frontend-reqs: dir: '${project.theme.dir}' command: 'npm install && cd ${docroot}/modules/custom/program_finder && npm install && cd ${docroot}/modules/custom/event_finder && npm install' frontend-assets: dir: '${project.theme.dir}' command: 'npm run build && cd ${docroot}/modules/custom/program_finder && npm run build && cd ${docroot}/modules/custom/event_finder && npm run build'
  • 15. 15 Run tests BLT Features for the Developers. ● blt tests:all ● tests:phpunit ● blt tests:behat ● blt tests:frontend ● blt validate:composer ● blt validate:phpcs ● blt validate:twig ● blt validate:yaml ● blt tests:security-updates
  • 16. BLT Features for the Technical Architects & Lead Developers. 4
  • 17. 17 Add Drupal VM to the Project BLT Features for the Technical Architects & Lead Developers. ● blt recipes:drupalvm:init
  • 18. 18 Generate the multisite BLT Features for the Technical Architects & Lead Developers. ● blt recipes:multisite:init blt recipes:multisite:init This will generate a new site in the docroot/sites directory. Site machine name (e.g. 'example') subsite Local domain name [http://local.subsite.com] Would you like to configure the local database credentials? (y/n) n Default remote drush alias [subsite.remote] Default local drush alias [subsite.local] > blt:init:settings Hash salt already exists. New site generated at /var/www/docroot/sites/subsite Drush aliases generated: * @subsite.remote Config directory created for new site at config/subsite
  • 19. 19 Generate empty config_splits BLT Features for the Technical Architects & Lead Developers. ● blt recipes:config:init:splits git:(master) ✗ blt recipes:config:init:splits This command will generate configuration and directories for the following environment based splits: Local, CI, Dev, Stage, and Prod. [FilesystemFilesystemStack] mkdir ["/var/www/docroot/../config/envs/local"] [FileWrite] Writing to /var/www/docroot/../config/default/config_split.config_split.local.yml. [FilesystemFilesystemStack] mkdir ["/var/www/docroot/../config/envs/ci"] [FileWrite] Writing to /var/www/docroot/../config/default/config_split.config_split.ci.yml. [FilesystemFilesystemStack] mkdir ["/var/www/docroot/../config/envs/dev"] [FileWrite] Writing to /var/www/docroot/../config/default/config_split.config_split.dev.yml. [FilesystemFilesystemStack] mkdir ["/var/www/docroot/../config/envs/stage"] [FileWrite] Writing to /var/www/docroot/../config/default/config_split.config_split.stage.yml. [FilesystemFilesystemStack] mkdir ["/var/www/docroot/../config/envs/prod"] [FileWrite] Writing to /var/www/docroot/../config/default/config_split.config_split.prod.yml.
  • 20. 20 Generate the default CI configuration BLT Features for the Technical Architects & Lead Developers. ● blt recipes:ci:gitlab:init ● blt recipes:ci:pipelines:init ● blt recipes:ci:probo:init ● blt recipes:ci:travis:init stages: - validate - build - test - deploy variables: APP_NAME: Project before_script: - echo "hello world" validate: stage: validate script: - blt validate:all build: stage: build script: - composer validate --no-check-all --ansi - composer install --ansi - blt source:build --ansi --verbose test: stage: test script: - blt tests --define tests.run-server=true --ansi --no-interaction --verbose production: stage: deploy script: - echo "Launching application" environment: name: production url: http://$APP_NAME.example.com only: - master
  • 21. 21 Build and Deploy Artifacts BLT Features for the Technical Architects & Lead Developers. ● blt artifact:build ● blt artifact:deploy In blt.yml drush: aliases: remote: projectname.prod local: self ci: self default_alias : '${drush.aliases.local}' In bitbucket-pipelines.yml ${BIN_DIR}/blt -vvv artifact:deploy --commit-msg "Bitbucket build - $BITBUCKET_BUILD_NUMBER, Commit $BITBUCKET_COMMIT" --branch "$BITBUCKET_BRANCH" --no-interaction
  • 22. 22 Build and Deploy Artifacts BLT Features for the Technical Architects & Lead Developers. if ($options['dry-run']) { $this->logger->warning("This will be a dry run, the artifact will not be pushed."); } $this->checkDirty($options); if (isset($options['ignore-platform-reqs'])) { $this->ignorePlatformReqs = $options['ignore-platform-reqs']; } if (!$options['tag'] && !$options['branch']) { $this->createTag = $this->confirm("Would you like to create a tag?", $this->createTag); } $this->commitMessage = $this->getCommitMessage($options); if ($options['tag'] || $this->createTag) { // Warn if they're creating a tag and we won't tag the source for them. if (!$this->tagSource) { $this->say("Config option deploy.tag_source if FALSE. The source repo will not be tagged."); } $this->deployToTag($options); } else { $this->deployToBranch($options); }
  • 23. 23 And even more cool features BLT Features for the Technical Architects & Lead Developers. ● blt recipes:simplesamlphp:init ● blt recipes:acsf:init:all ● blt recipes:behat:init ● blt recipes:aliases:init:acquia ● blt source:fix:php-standards
  • 25. 25 Extending and overriding Acquia BLT. ● Built with “Robo” and “Annotated Command”. ● Supports defining new custom commands. ● Allows hooking into existing commands. ● Replace/override a Robo command using “Replace Command Hook”. ● Disable command.
  • 26. 26 Define new command Extending and overriding Acquia BLT. ● blt recipes:blt:command:init ** * Defines commands in the "custom" namespace. */ class ExampleCommands extends BltTasks { /** * Print "Hello world!" to the console. * * @command custom:hello * @description This is an example command. */ public function hello() { $this->say("Hello world!" ); } }
  • 27. 27 Hook into the existing command Extending and overriding Acquia BLT. /** * Defines commands in the "custom" namespace. */ class ExampleCommands extends BltTasks { /** * This will be called before the `custom:hello` command is executed. * * @hook command-event custom:hello */ public function preExampleHello (ConsoleCommandEvent $event) { $command = $event->getCommand(); $this->say("preCommandMessage hook: The {$command->getName()} command is about to run!" ); } }
  • 28. 28 Replace/override a BLT command Extending and overriding Acquia BLT. class CustomHelloReplaceCommandHook { /** * Parameters must match original command method. * * @hook replace-command custom:hello */ public function myHelloReplacement () { $this->say("Goodbye world!"); } }
  • 29. 29 Disable command Extending and overriding Acquia BLT. In blt.yml disable-targets: custom: hello: true