Valuebound: Step-by-step guide to Drush & Drush Aliases to make sure your web application has quick releases
Have you ever thought that your business needs to make sure that your web application has a quick release in order to sustain the long race. This sort of has become easy to manage by continuous development & continuous integration using Drush & Drush Aliases. Drupal web development is one such place where multiple command-line interface (CLI) tools are available to make developer’s life easy, and among them, the two important things are Drush and Drupal Console.
In this blog, we will take a brief look at Drush & Drush Aliases and how it can make developer’s tedious manual web development tasks easy by offering various commands to…
Last week I was fortunate enough to attend and deliver a session at DrupalCon Vienna. The session was based around leveraging and getting productive with the automated testing tools we use in the Drupal community.by Sam Becker / 3 October 2017
For the kind of large scale projects we work on, it's essential that automated testing is a priority and firmly embedded in our technical culture. Stability and maintainability of the code we're working on helps to build trusting relationships and happy technical teams. I have for a long time been engaged with the developments of automated testing in Drupal core and internally we've worked hard to adapt these processes into the projects we build and fill-in any blanks where required.
I was fortunate enough to be selected to share this at DrupalCon Vienna. Without further ado, I present, Test all the things! Get productive with automated testing in Drupal 8:
Our current testing ethos is based around using the same tools for core and contrib for our bespoke Drupal project builds. Doing so allows us to context-switch between our own client work and contributed project or core work. To make this work we've addressed a few gaps in what's available to us out of the box.Current State of Testing
I had some great conversations after the session with developers who were just starting to explore automated testing in Drupal. While the tools at our disposal are powerful, there is still lots of Drupal-specific knowledge required to become productive. My hope is the session helped to fill in some of the blanks in this regard.E2E Testing
Because all of the test cases in core are isolated and individually setup environments/installations, end-to-end testing is tricky without some additional work. One of the touch points in the session was based around skipping the traditional set-up processes and using the existing test classes against pre-provisioned environments. Doing so replicates production-like environments in a test suite, which helps to provide a high-level of confidence tests are asserting behaviors of the whole system. Bringing this into core as a native capability is being discussed on drupal.org and was touched on in the session.JS Unit Testing
Summing up, attending DrupalCon Vienna, presenting the session and meeting the members of the broader community was a great experience. I'm hopeful my session was able to contribute to the outstanding quality of sessions and technical discussions.Tagged DrupalCon, DrupalCon Vienna, Testing
Dated 3 October 2017Add new comment
This article is about serving your Drupal Docker container, and/or any other container, via https with a valid Let’s encrypt SSL certificate.Step one: make sure you have a public VM
To follow along, create a new virtual machine (VM) with Docker, for example using the “Docker” distribution in the “One-click apps” section of Digital Ocean.
This will not work on localhost, because in order to use Let’s Encrypt, you need to demonstrate ownership over your domain(s) to the outside world.
In this tutorial we will serve two different sites, one simple HTML site and one Drupal site, each using standard ports, on the same Docker host, using a reverse proxy, a container which sits in front of your other containers and directs traffic.Step two: Set up two domains or subdomains you own and point them to your server
Start by making sure you have two domains which point to your server, in this example we’ll use:
- test-one.example.com will be a simple HTML site.
- test-two.example.com will be a Drupal site.
We do not want to map our containers’ ports directly to our host ports using -p 80:80 -p 443:443 because we will have more than one app using the same port (the secure 443). Port mapping will be the responsibility of the reverse proxy (more on that later). Replace example.com with your own domain:DOMAIN=example.com docker run -d \ -e "VIRTUAL_HOST=test-one.$DOMAIN" \ -e "LETSENCRYPT_HOST=test-one.$DOMAIN" \ -e "LETSENCRYPT_EMAIL=my-email@$DOMAIN" \ --expose 80 --name test-one \ httpd docker run -d \ -e "VIRTUAL_HOST=test-two.$DOMAIN" \ -e "LETSENCRYPT_HOST=test-two.$DOMAIN" \ -e "LETSENCRYPT_EMAIL=my-email@$DOMAIN" \ --expose 80 --name test-two \ drupal
Now you have two running sites, but they’re not yet accessible to the outside world.Step three: a reverse proxy and Let’s encrypt
The term “proxy” means something which represents something else. In our case we want to have a webserver container which represents our Drupal and html containers. The Drupal and html containers are effectively hidden in front of a proxy. Why “reverse”? The term “proxy” is already used and means that the web user is hidden from the server. If it is the web servers that are hidden (in this case Drupal or the html containers), we use the term “reverse proxy”.
Let’s encrypt is a free certificate authority which certifies that you are the owner of your domain.
We will use nginx-proxy as our reverse proxy. Because that does not take care of certificates, we will use LetsEncrypt companion container for nginx-proxy to set up and maintain Let’s Encrypt certificates.
Let’s start by creating an empty directory which will contain our certificates:mkdir "$HOME"/certs
Now, following the instructions of the LetsEncrypt companion project, we can set up our reverse proxy:docker run -d -p 80:80 -p 443:443 \ --name nginx-proxy \ -v "$HOME"/certs:/etc/nginx/certs:ro \ -v /etc/nginx/vhost.d \ -v /usr/share/nginx/html \ -v /var/run/docker.sock:/tmp/docker.sock:ro \ --label com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy \ jwilder/nginx-proxy
And, finally, start the LetEncrypt companion:docker run -d \ --name nginx-letsencrypt \ -v "$HOME"/certs:/etc/nginx/certs:rw \ -v /var/run/docker.sock:/var/run/docker.sock:ro \ --volumes-from nginx-proxy \ jrcs/letsencrypt-nginx-proxy-companion
Wait a few minutes for "$HOME"/certs to be populated with your certificate files, and you should now be able to access your sites:
- https://test-two.example.com/ should show the Drupal installer (setting up a MySQL container to actually install Drupal is outside the scope of this article);
- https://test-one.example.com should show the “It works!” page.
- In both cases, the certificate should be valid and you should get no error message.
- http://test-one.example.com should redirect to https://test-one.example.com
- http://test-two.example.com should redirect to https://test-two.example.com
Let’s Encrypt certificates last 3 months, so we generally want to renew every two months. LetsEncrypt companion container for nginx-proxy states that it automatically renews certificates which are set to expire in less than a month, and it checks this hourly, although there are some renewal-related issues in the issue queue.
It seems to also be possible to force renewals by running:docker exec nginx-letsencrypt /app/force_renew
So it might be worth considering to be on the lookout for failed renewals and force them if necessary.Enjoy!
You can now bask in the knowledge that your cooking blog will not be man-in-the-middled.
This article is about serving your Drupal Docker container, and/or any other container, via https with a valid Let’s encrypt SSL certificate.
The #D8isGr8 blog series will focus on why we love Drupal 8 and how it provides solutions for our clients. This post in the series comes from Alex Brandt, Marketing Lead.In this post we will cover...
- What changes Drupal 8 has made to the editing experience
- How Drupal 8 promotes accessibility
- One way we use Drupal 8 to connect with our audience
Stay connected with the latest news on web strategy, design, and development.Sign up for our newsletter.
Oh Drupal 8, how do I love thee? Let me count the ways… As a content editor on a small team, I welcome every chance I get to publish something easier, quicker, and more effectively. My first experience publishing content in Drupal was in Drupal 7, and without having previous HTML experience, it was a time-consuming endeavor. Although there is a plethora of different reasons why I love publishing content in Drupal 8, I’ll narrow it down to my top three.1.) WYSIWYG FTW!
This little bar is my best friend:
A quick WYSIWYG editor (CKEditor) is now standard in Drupal 8 core, which means there’s no need to look up the HTML every time I want to include a link, stylize a heading, or insert an image. The amount of time I save when publishing is awesome, but it also prevents me from using sloppy code that could become an issue later down the line if we migrate content.2.) Keeping Things Accessible with Alt Text
Drupal 8 now flags when you need alternative text (alt text), and it doesn’t allow you to publish a post without providing these descriptions. We always strive to make our corner of the web equally accessible for all users, and this is a safeguard to make sure we continue doing so. You can read more about why alt text is important in our recent post on accessibility.This red asterisk prompt displays every time you insert an image.3.) Customization
Just like most institutions, our website is one of the most important marketing tools for our agency. Not only does it provide us with a place to share knowledge with our audience, it provides different ways for our audience to engage with us.
One of the easiest ways we are able to connect with our clients, partners, and community is by creating customizable call-to-action buttons to display in various places on our site. These buttons allow our site visitors to sign up for our newsletter, schedule a time to chat with us, register for a webinar, or any other action we hope they take. By having the ability to customize each button (opposed to only having a generic contact us button), we can make sure the call-to-action buttons fits the content where they are displayed. Drupal 8 makes these buttons easy to create (once we set up our desired fields).Different options for customizing CTA buttons.Easy Publishing in Drupal 8
All of these features in Drupal 8 allow me to share tailored content with our audience, without becoming bogged down by the technology. And because I know you were wondering, the time it took me to take this blog post from google doc to published? 3 minutes, 17 seconds.
We want to make your project a success.Let's Chat.