Skip to content

Instantly share code, notes, and snippets.

View markf3lton's full-sized avatar

Mark Felton markf3lton

View GitHub Profile
@markf3lton
markf3lton / site-factory-new.md
Last active May 3, 2024 20:09
Create a "vanilla" codebase for Site Factory

Create a "vanilla" Drupal codebase for Site Factory

These steps may be followed to create a "vanilla" code branch for your project. This is useful when starting a new Site Factory project — or perhaps you just want to test some platform functionality on a clean Drupal branch running the latest version of Drupal.

Initialize the codebase

Navigate to your Projects directory. Use Acquia CLI to fetch Drupal and create a new project. (You can can then add this to an existing code repository, as a separate branch, to keep things tidy.)

cd ~/Projects
acli new

When prompted, you will select option [0] for the acquia/drupal-recommended-project.

## 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)

@markf3lton
markf3lton / ACSF-htaccess.md
Last active September 25, 2019 20:29
Recommendations for .htaccess on Site Factory

Recommendations for .htaccess on Site Factory

This guide builds a set of .htaccess rules that are appropriate for common ACSF use cases and RCAB requirements.

1 - Default .htaccess

2 - ACSF requirement

3 — Force HTTP to HTTPS