Web News

The robot comfort duck will see you now - CNET

Webware - Wed, 04/04/2018 - 8:00am
Cute furry robots like Paro seal and My Special Aflac Duck are the latest way to help people suffering from cancer, diabetes, depression and dementia.
Categories: Web

Flocon de toile | Freelance Drupal: Working with the Drupal Commerce 2 checkout flows

Web - Wed, 04/04/2018 - 8:00am

Drupal Commerce 2 allows to define out of the box multiple checkout flows, allowing to customize according to the order, the product purchased, the customer profile this buying process and modify it accordingly. This is an extremely interesting feature, in that it can simplify as much as necessary this famous checkout flows. Do you sell physical (and therefore with associated delivery) and digital (without delivery) products? In a few clicks you can have two separate checkout flows that will take into account these specificities.

Categories: Web

Lullabot: Continuous Integration in Drupal 8 with Travis CI

Web - Wed, 04/04/2018 - 6:07am

This article is the second in our series on Continuous Integration tools for Drupal 8, which started with CircleCI. This time, we explore Travis CI.

Travis CI is the most well known CI tool for open source projects. Its setup process is straightforward and it offers a lot of flexibility and resources to implement Continuous Integration for any kind of project. In this article we will implement the same set of jobs that we did with CircleCI and then compare both tools.

Resources

This article makes references to the following resources:

Browse the demo project to discover where the CI components are placed, then use the one-line installer to add these components automatically to your project.

The goal

We want to run the following jobs in a Drupal 8 project when someone creates a pull request:

To accomplish the above, we will use the following tools in Travis CI:

  • Drush, Drupal’s command line interface, to perform Drupal-related tasks like installing Drupal or updating the database.
  • Docker Compose, via docker4drupal, to build the environment where Behat tests run.
  • Robo, a PHP task runner, to define a set of tasks for each of the above jobs.

Here is a screenshot of the Travis CI dashboard with the above setup in place:

undefined

Now, let’s see how this has been set up. If you want to dive straight into the code, have a look at the demo Drupal 8 repository.

Setting up Travis CI

Travis CI requires the presence of a .travis.yml file at the root of the repository that dictates how it will build and test the project. I have used this installer that adds the following files:

Additionally, a few dependencies are added via Composer, which are required for the CI jobs.

After adding the above files to the repository, it’s time to give Travis CI access to it. Open https://travis-ci.org and authenticate there with your GitHub account. Next, add the repository at the Travis CI dashboard as shown below:

undefined

That’s it! After this, future changes to the repository should trigger builds at Travis CI. If you create a pull request, you will see a status message like the following one:

undefined Seeing the jobs at work

Here is an excerpt of the .travis.yml file. We are leveraging Travis’ build matrix for spinning up three jobs that run in parallel:

env: matrix: - JOB=job:check-coding-standards - JOB=job:run-unit-tests - JOB=job:run-behat-tests install: - composer --verbose install script: - vendor/bin/robo $JOB

The script section is called three times: one for each value assigned to the $JOB variable. It calls a different Robo task each time. We decided to write the implementation of each job as Robo tasks because:

  • It makes the .travis.yml file easier to read and maintain.
  • It makes the job implementations portable between CI tools.
  • It gives developers an opportunity to run the jobs locally.

If you are curious what a Robo task looks like, here is the implementation of the one that runs Behat tests:

/** * Command to run behat tests. * * @return \Robo\Result * The result of the collection of tasks. */ public function jobRunBehatTests() { $collection = $this->collectionBuilder(); $collection->addTaskList($this->downloadDatabase()); $collection->addTaskList($this->buildEnvironment()); $collection->addTask($this->waitForDrupal()); $collection->addTaskList($this->runUpdatePath()); $collection->addTaskList($this->runBehatTests()); return $collection->run(); } Building the environment with Docker Compose

The build environment task shown above, $this→buildEnvironment(), uses Docker Compose to build a Docker environment where the Drupal site will be configured, the database will be updated, and finally, Behat tests will run.

In contrast with CircleCI, where we define the mix of Docker images that the test environment will use to run the jobs, Travis CI offers two environments (Precise and Trusty) with common pre-installed services. Trusty has everything that we need for checking coding standards or running PHPUnit tests, but Behat tests require more setup which we find easier to manage via Docker Compose.

Here are the contents of the build environment task. For simplicity, we have removed a few unrelated lines:

/** * Builds the Docker environment. * * @return \Robo\Task\Base\Exec[] * An array of tasks. */ protected function buildEnvironment() { $force = true; $tasks = []; $tasks[] = $this->taskFilesystemStack() ->copy('.travis/docker-compose.yml', 'docker-compose.yml', $force); $tasks[] = $this->taskExec('docker-compose pull --parallel'); $tasks[] = $this->taskExec('docker-compose up -d'); return $tasks; }

The above task uses this docker-compose.yml file to build the environment.

Generating and visualizing coverage reports

Travis CI does not support storing artifacts like CircleCI does. Therefore, we need to use a third-party service to host them. Travis documentation suggests either uploading them to an Amazon S3 bucket or using Coveralls, a hosted analysis tool. We chose the latter because it posts a summary in each pull request with a link to the full coverage report.

Setting up Coveralls is straightforward. Start by opening https://coveralls.io and then, after authenticating with your GitHub account, use their browser to find and connect to a repository, like this:

undefined

Next, it is recommended to review the repository settings so we can customize the developer experience:

undefined

With that in place, new pull requests will show a status message with a one-line summary of the coverage report, plus a link to the full details:

undefined

Finally, when we click on Details, we see the following coverage report:

undefined A comparison to CircleCI

CircleCI can do all that Travis CI does with less setup. For example, coverage reports and Behat screenshots can be stored as job artifacts and visualized at the CircleCI dashboard. Additionally, CircleCI’s Command Line Interface gives a chance to developers to debug jobs locally.

Travis CI shines on flexibility: for example, only the Behat job uses Docker Compose to build the environment while the rest of the jobs use the Trusty image. Additionally, there is a huge amount of articles and documentation, which you will surely find helpful when tweaking the jobs to fit your team's needs.

If you liked Travis CI, check out this installer to get started quickly in your Drupal 8 project.

What next?

We aren’t sure about which tool to pick for our next article in this series on CI tools for Drupal 8. Do you have a preference? Do you have feedback on what you’ve found relevant about this article? Please let us know by posting a comment.

Acknowledgements
Categories: Web

Kalamuna Blog: How-to: Using Drupal-Project to Craft Your Perfect Start State

Web - Wed, 04/04/2018 - 2:05am
How-to: Using Drupal-Project to Craft Your Perfect Start State Shannon O'Malley Tue, 04/03/2018 - 23:05

The drupal-project repository is quickly becoming the de facto starter for all Drupal 8 projects. So how can you quickly spin up a new site with Composer and drupal-project? How do you take drupal-project and customize it to suit your particular needs? And, how do you leverage post-install tasks to keep yourself DRY? This February I gave a talk at DrupalCamp Florida where I got into all of these questions.

Categories Articles Drupal
Categories: Web

OSTraining: A Further Look at the New Layout Builder in Drupal 8

Web - Wed, 04/04/2018 - 1:48am

Earlier in this blog, OSTraining's Steve Burge made an excellent introduction to the new Drupal Layout Builder.

Many users have been eagerly expecting this module and it was released in version 8.5.

In this tutorial, you will take a further look at how to work with this module. You will see how to use the Layout Builder to configure:

  • Content types.
  • Nodes.
Categories: Web

YouTube HQ shooting: Three injured, suspected shooter dead - CNET

Webware - Wed, 04/04/2018 - 12:49am
San Bruno Police said the victims are being transported to area hospitals.
Categories: Web

Google Doodle celebrates Dr. Maya Angelou - CNET

Webware - Wed, 04/04/2018 - 12:35am
Dr. Maya Angelou's incredible life story is celebrated on what would have been her 90th birthday.
Categories: Web

YouTube HQ shooter has been identified as Nasim Aghdam - CNET

Webware - Tue, 04/03/2018 - 11:49pm
Multiple reports have identified the shooter as Nasim Aghdam, woman in her late 30s with a grudge against YouTube.
Categories: Web

Here's what we know about the shooting at YouTube HQ - CNET

Webware - Tue, 04/03/2018 - 11:39pm
A shooter wounded three people at the video site's headquarters before apparently taking her own life. Her motive remains unknown.
Categories: Web

In How to Talk to Girls at Parties trailer, aliens find love - CNET

Webware - Tue, 04/03/2018 - 11:26pm
See the trailer for Neil Gaiman's sci-fi tale about a punk rocker who falls for a beautiful alien girl in 1970s London.
Categories: Web

Tim Cook, Jeff Bezos and more react to YouTube HQ shooting - CNET

Webware - Tue, 04/03/2018 - 11:20pm
The incident left three people injured at YouTube's San Bruno, Calif. headquarters. Silicon Valley's most powerful took to Twitter to react.
Categories: Web

X-Planes are the supersonic daredevils of aviation history - CNET

Webware - Tue, 04/03/2018 - 8:52pm
Starting with the original X-1 in the 1940s, these research aircraft have pushed the bounds of what flies. Now NASA's got a new X-Plane in the works.
Categories: Web

Electric cars could kill the convenience store, report says - Roadshow

Webware - Tue, 04/03/2018 - 8:39pm
The Washington Post suggests that if EVs became widely enough adopted, it could severely impact the beverage and convenience store industries.
Categories: Web

Agiledrop.com Blog: AGILEDROP: DrupalCon Nashville, here I come!

Web - Tue, 04/03/2018 - 8:22pm
I was not planning to go to DrupalCon this year due to so many things going on at the company, but with a little delegation effort, I will be able to go.  I would not like to miss this one, to be honest. So here is what I am looking forward to in Nashville.   Meeting new people DrupalCons in the US are the biggest Drupal events, and even if you are an active community member for 11 years like I am, you still see a lot of new faces. Developers are generally more on the introvert side, so you don't see so much intentional networking like on some other events, but don't hesitate to ask the… READ MORE
Categories: Web

YouTube staffer's Twitter account hacked during shooting - CNET

Webware - Tue, 04/03/2018 - 7:57pm
After Vadim Lavrusk tweeted about the active shooting at YouTube's headquarters, his Twitter account was briefly hijacked and spammed with hoax posts.
Categories: Web

Fake news on YouTube shooting spreads, despite recent efforts - CNET

Webware - Tue, 04/03/2018 - 7:57pm
In the wake of tragedy, familiar accusations, claims and conspiracies emerge on Twitter, Reddit, Facebook and beyond.
Categories: Web

Facebook axes Russia-linked pages to stop election interference - CNET

Webware - Tue, 04/03/2018 - 7:46pm
Mark Zuckerberg says a Russian agency has "tried to manipulate people in the US, Europe, and Russia -- and we don't want them on Facebook anywhere in the world."
Categories: Web

YouTube headquarters shooting appears on Google Maps - CNET

Webware - Tue, 04/03/2018 - 7:22pm
Google Maps adds an interactive icon identifying a shooting on YouTube's campus in San Bruno, California, after police confirm the incident Tuesday afternoon.
Categories: Web

A Swiss scooter company wants to sell you an electric Urkel-mobile - Roadshow

Webware - Tue, 04/03/2018 - 6:31pm
Micro Mobility is debuted its Europe-only Microlino electric Isetta tribute at Geneva
Categories: Web

Elon Musk's next SpaceX rocket could blast off 100 times - CNET

Webware - Tue, 04/03/2018 - 6:16pm
The CEO envisions colonizing Mars atop reusable rockets. So far he's never used the same Falcon 9 booster more than twice, but that's about to change.
Categories: Web

Pages