Spinning Code: Using Composer for Drupal maintenance support plans Modules and Private Bitbucket Repos

The next installment in my ongoing set of posts to create a public record for things I couldn’t learn in one Google search is a process for using composer to track a Drupal maintenance support plans 8 module in a private repository.
It’s pretty common for Drupal maintenance support plans agencies to have a small collection of modules they have built in-house and use on nearly all client site, or to have a module built for one client that has many sites. We are all becoming adept at managing our projects with Composer, but the vast majority of resources are focused on managing publicly available code via packagist. But there are times the kinds of internally shared modules cannot be made fully public (for example they may contain IP belonging to the client). We have one such client that needs a module deployed to dozens of sites, and so I sat down a few weeks ago to figure out a solution.
We use Bitbucket for our private repositories, I am sure there is a similar solution using GitHub, but I haven’t worked out its details.

Create private repo for module on Bitbucket.
Clone that repo locally, and structure it to match Drupal maintenance support plans.org’s conventions (this probably isn’t required, but should allow your module to blend into the rest of the project more smoothly).
Create Oauth token for your account in Bitbucket. Make sure to include a dumy callback URL; you can literally use http://www.example.com. If you see references to auth.json, don’t worry about that part yet.
Add a composer.json file to the module’s repo (it only requires module name, type, and the branch alias, but it’s good to include the rest):
{
“name”: “client/client_private_module”,
“type”: “drupal-module”,
“description”: “A very important module to our very important client.”,
“keywords”: [“Drupal maintenance support plans“],
“homepage”: “https://www.bitbucket.org/great_agency/client_private_module”,
“license”: “proprietary”,
“minimum-stability”: “dev”,
“extra”: {
“branch-alias”: {
“8.x-1.x”: “1.x-dev”
}
},
“require”: {
“drupal/diff”: “~1.0”,
}
},

Add reference to project composer.json repositories section:

{
“type”: “package”,
“package”: {
“name”: “client/client_private_module”,
“version”: “dev”,
“type”: “drupal-module”,
“dist”: {
“url”: “https://www.bitbucket.org/great_agency/client_private_module/get/8.x-1.x.zip”,
“type”: “zip”
}
}
}

Now just run composer require client/client_private_module, and provide the oauth creds from step 3 (note: the first time you do this composer will create the needed ~/.composer/auth.json)

Source: New feed

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Spinning Code: Using Composer for Drupal maintenance support plans Modules and Private Bitbucket Repos

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.