Skip to content

Instantly share code, notes, and snippets.

View markf3lton's full-sized avatar

Mark Felton markf3lton

View GitHub Profile
@markf3lton
markf3lton / create-a-drupal-codebase-for-site-factory.md
Last active October 30, 2024 19:18
Create a Drupal codebase for Site Factory

Create a Drupal codebase for Site Factory

Step-by-step instructions (last updated October 2024).

Use Composer to create a new project

Navigate to your project directory and start your new codebase there:

cd ~/Projects
@markf3lton
markf3lton / site-factory-new.md
Last active September 30, 2024 16:16
Create a Drupal codebase for Site Factory

A newer, more comprehensive version of this tutorial is at https://gist.github.com/markf3lton/05d54017e2e234bc3645ecab81818e4d

Create a plain vanilla Drupal codebase for Site Factory

Follow these steps to create plain vanilla codebase for your project. This is useful when launching a new Site Factory project, or perhaps you just want to test out some functionality using (not much more) than Drupal core.

Initialize your codebase

Navigate to your preferred ~/Projects directory. Use Acquia CLI to download Drupal and create a new project. If you already have a git repo you this project as a separate branch to keep things tidy and separate from any existing work.

## Per https://support.acquia.com/hc/en-us/articles/360042181273-Block-Access-to-Bad-Bots-coming-from-the-Huawei-Cloud
## this should be immediately after the RewriteEngine On line in your .htaccess file
################## Begin User Agent Blocks ########################
#RewriteCond %{HTTP_USER_AGENT} ^(.*)(.*)$
#Block empty user agents, these are never any good.
RewriteCond %{HTTP_USER_AGENT} ^-?$
RewriteRule .* - [R=410,L]
@markf3lton
markf3lton / Setup_Acquia_Cloud_IDE_to_work_with_Github.md
Last active February 9, 2021 15:43
Steps to set up a new IDE to work with acli and Github

Updated February 8, 2021

Acquia Cloud IDEs provide a workspace for developers that includes integration with your Acquia Cloud environments.

In other words, a developer should be ready to go if:

  • they have an Acquia Cloud account
  • they are a member a team that has access to the Acquia application on Acquia Cloud
@markf3lton
markf3lton / civiccms-aliases.md
Last active July 22, 2020 12:27
A script to generate ACSF aliases via the Site Factory API

For best results adapt this script use with aliases you have tested, e.g. the Acquia aliases... see: https://gist.github.com/markf3lton/0f446eb0d953bb2eb12a8f10bdaabcef#file-acsf-to-local-md

Or write a similar script that implements aliases in the format of your choice. For example if using Lando the Acquia drush aliases can be used within the virtual machine to sync sites from ACSF to your local environment, see step 6 here: https://gist.github.com/markf3lton/66c5cce6ccaaa69d8b0525ba16d1bd99#file-lando-md

The nice thing about this script is it is very simple, so it's a good starter-script. Many variations have been implemented by customers. ACSF are a popular topic in the BLT issue queue, for example: acquia/blt#3932

@markf3lton
markf3lton / lando.md
Last active July 21, 2020 20:39
Set up a LAMP in about 15 minutes with Lando

Set up a LAMP in 10 minutes with Lando

Any Windows, Linux and Mac computer suitable for modern web development can run Lando. If this your first-time trial of this free, LAMP tool, it may take 30 mins or so just to install it -- but then, using it can be very fast, afterwards! The learning curve is not very steep.

Step 1: Install Lando following the docs https://docs.lando.dev/basics/installation.html

The following part should only take 15 minutes or so, it is s very fast.

Step 2: Create a directory wherever you keep projects on your system. Then cd into that directory, and run

Copy permissions from existing role (optional)
Administration Select: All | None
Access the Cloud API
Grants the ability to use the API and bypass all other permissions via command line tools. (only applies to Cloud API v1)
Add Application Tags
Grants the ability to add tags to an application.
<?php
/**
* @file
* Contains Environment variables.
*/
$ah_env = isset($_ENV['AH_SITE_ENVIRONMENT']) ? $_ENV['AH_SITE_ENVIRONMENT'] : NULL;
$ah_group = isset($_ENV['AH_SITE_GROUP']) ? $_ENV['AH_SITE_GROUP'] : NULL;
$is_ah_env = (bool) $ah_env;
$is_ah_prod_env = ($ah_env == 'prod' || $ah_env == '01live');

Acquia BLT in Azure DevOps Pipelines

This guide will get you started with Acquia BLT and AzDo (Azure DevOps).

I wrote a guide for running BLT on Windows that will complement this tutorial.

I also wrote a Getting Started with BLT guide.

Set up your Azure Repo

Drupal and Acquia BLT on Windows 10

This tutorial provides you with a (minimal) dev environment that you can use to start developing Drupal and use Acquia BLT.

Most corporate users are running a managed laptop, which admin access, but this tutorial should still work.

If you're behind a corporate firewall, you may need to get on the real Internet to run Composer and install dev tools.

Install WSL (Windows Subsystem for Linux)