Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Symfony demo on Platform.sh

Symfony demo on Platform.sh

Introduction on how to get Symfony running on Platform.sh and some information on the YellowCube solution incl. integration with Drupal Commerce and Magento by PostLogistics and Liip

lsmith

May 01, 2015
Tweet

More Decks by lsmith

Other Decks in Technology

Transcript

  1. Agile Web Development Liip.ch – SYMFONY DEMO ON Some first

    steps and experience .. and a small surprise
  2. SYMFONY @ LIIP • Liip was one of the first

    agencies world wide to use Symfony2 • Symfony thanks to its modular architecture is very widely used • Biggest strength of is its flexibility and time to market for highly individualized applications
  3. HOSTING PAIN POINTS @ LIIP • Hosting is done by

    customer internal IT or hosting partners • Risk of delays due to missing testing/staging setup • Preview of parallel development branches not possible • Differences in development, staging and production
  4. WORKING WITH BRANCHES Code • Application-Code • Infrastructure Production Staging

    Development Data • Database • Files • Solr-Index • etc.
  5. CONFIGURATION OF INFRASTRUCTURE • Compact configurations files right in the

    application • Services can be activated with li le effort (MySQL, Solr, Redis, ..) • Read Only Filesystem improves security • Persistenter storage is available (f.e. for log files, caches ..) • Dedicated documentation on platform.sh and symfony.com
  6. SYMFONY CONFIGURATION # Symfony specific settings in the .platform.app.yaml #

    The toolstack used to build the application. toolstack: "php:symfony" # The configuration of app when it is exposed to the web. web: document_root: "/web" passthru: "/app.php" # The mounts that will be performed when the package is deployed. mounts: "/app/cache": "shared:files/cache" "/app/logs": "shared:files/logs" # The hooks that will be performed when the package is deployed. hooks: build: | rm web/app_dev.php app/console --env=prod assetic:dump --no-debug # At this point the file system is read-only! deploy: | app/console --env=prod cache:clear
  7. SERVICES ACTIVATION # Enable services in the .platform/services.yaml # host:

    database.internal, port: 3306, username/password: [blank] mysql: type: mysql disk: 2048 # host: redis.internal, scheme: redis, port: 6379 redis: type: redis # host: solr.internal, scheme: solr, port: 8080 solr: type: solr disk: 1024
  8. DATABASE CONFIGURATION # app/config/config.yml imports: - { resource: parameters.yml }

    - { resource: parameters_platform.php } - { resource: security.yml } .. <?php // app/config/parameters_platform.php $relationships = getenv("PLATFORM_RELATIONSHIPS"); if (!$relationships) { return; } $relationships = json_decode(base64_decode($relationships), TRUE); foreach ($relationships['database'] as $endpoint) { if (empty($endpoint['query']['is_master'])) { continue; } $container->setParameter('database_driver', 'pdo_' . $endpoint['scheme']); $container->setParameter('database_host', $endpoint['host']); $container->setParameter('database_port', $endpoint['port']); $container->setParameter('database_name', $endpoint['path']); $container->setParameter('database_user', $endpoint['username']); $container->setParameter('database_password', $endpoint['password']); $container->setParameter('database_path', ''); }
  9. PHP CONFIGURATION # Configure PHP extensions in the .platform.app.yaml #

    Enabled by default are: pdo, mysql, mysqli, pdo_mysql, sqlite3, gd, curl, intl, mcrypt and zendopcache runtime: extensions: - http - redis - ssh2 disabled_extensions: - sqlite3 # Configure other PHP settings inside php.ini ; Increase PHP memory limit memory_limit = 256M ; Store sessions in /tmp, alternatively mount a shared directory session.save_path = '/tmp/sessions'
  10. ROUTING CONFIGURATION # Manage routing in the .platform/routes.yaml "http://{default}/": type:

    upstream upstream: "php:php" "http://www.{default}/": type: redirect to: "http://{default}/"
  11. INTEGRATION WITH GITHUB • Automatic deployment of development branches and

    PRs • Deployment status is shown right in the PR platform integration:add --type=github --token=GITHUB-USER-TOKEN --repository=USER/REPOSITORY For details see
  12. INTEGRATION WITH BLACKFIRE.IO • Integrated profiling solution for platform.sh runtime:

    extensions: - name: blackfire configuration: server_id: "ce95eba9-2d90-48b7-ad75-fcad42e1bcab" server_token: "ca7e32ac2d466ecfdf30b8ac43bdfef1304fc3feeb66e8906c1192b435e206f0"
  13. ROBUST + MODERN INFRASTRUCTURE Platform.sh Enterprise offers additional important features

    • Integrated CDN (Content Delivery Network) • High availability through the use of multiple data centers (99,99%) • Elastic scaling • Compatible with different public clouds (Amazon, Azure) • Private cloud is possible on demand
  14. AND NOW FOR A A SMALL SURPRISE .. • Developers

    get bombarded daily with new services • Many services do not hold their promises • Or everything that isn’t promised explicitly is missing • Our developers are therefore pre y sceptic these days
  15. THIS IS ADRIAN .. AND HE IS SCEPTIC Still within

    4 hours before his holidays he quickly without previous knowledge about platform.sh, he created this demo ..
  16. YELLOWCUBE Comprehensive logistic solution for e-commerce by PostLogistics • automatic

    order and shipping process (picking, packing and shipping) • Shipping both national and international • Storage of smaller items von Kleinteilen (< 30 kg) • Pale e and block storage of larger items
  17. YELLOWCUBE And more • Return management • Customer individual packaging

    • Adding of prospects and flyers etc • Logging of serial numbers • Management of goods that has date of expiries • Customs
  18. YELLOWCUBE CONNECTORS Open Source YellowCube Connectors by Liip • PHP

    Client Library (SOAP) • Magento Extension • Drupal Commerce Module GitHub: h ps://github.com/swisspost-yellowcube Infos: h p://www.liip.ch/de/yellowcube
  19. WHY YELLOWCUBE ON PLATFORM.SH? • Simple and fast starting point

    with a few clicks • Preconfigured Drupal Commerce with YellowCube (Magento coming soon) • Fully automatic deployment saves costs • Testing of parallel development branches • International scaleable shop-solution incl. CDN