Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Acquia DB backups to cloud v2. #218

Merged
merged 26 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
43bad59
WIP, Move Acquia DB backups to cloud v2.
acidaniel Feb 28, 2023
395c45a
Adding Download Methods and removing dump messages.
acidaniel Mar 1, 2023
6fc0dd1
Removing wrong return FALSE.
acidaniel Mar 1, 2023
fa54ae9
Adding Exeptions and cleaning code.
acidaniel Mar 1, 2023
5ae6bc5
Moving acquia package to suggested and ensure this is going to be add…
acidaniel Mar 7, 2023
5f87378
Adding task to copy .env.example file if acquia is selected.
acidaniel Mar 7, 2023
3ec3f03
Moving suggest package and add it as a normal require if acquia is se…
acidaniel Mar 7, 2023
768f54a
Fixing the extension of the backups.
acidaniel Mar 9, 2023
47f9626
Fixing the command to decompress file and importing it without drush …
acidaniel Mar 9, 2023
4466d7f
Adding hosting packages as new phing task.
acidaniel Mar 9, 2023
4e1beeb
Adding PHPStan.neo file to exclude Acquia refeences to be scanned fir…
acidaniel Mar 15, 2023
8472626
Removing the check if we are in CIrcleCI to add composer dependencies…
acidaniel Mar 15, 2023
1364c34
Fixing foreach typo in clossing tag.
acidaniel Mar 16, 2023
4fc7395
Installing specific packages per hosting default task tag.
acidaniel Mar 16, 2023
c7bfa88
Merge branch 'develop' into cloud-api-version-2-backup
byrond Nov 17, 2023
3e11faf
allow newer versions of phpmd
byrond Nov 17, 2023
564b04c
revert change to version constraint so we can fix it elsewhere
byrond Nov 17, 2023
a696c86
Merge branch 'develop' into cloud-api-version-2-backup
agentrickard Jan 3, 2024
90cee16
sort use statements in GetLatestBackupTask.php
byrond Jan 12, 2024
eb12d5c
fix the-build installer for host packages
byrond Mar 13, 2024
d9d5cea
remove inheritall from foreach in install.xml
byrond Mar 13, 2024
4a4f630
remove check for .env since there is already a check for the env vars
byrond Mar 13, 2024
f77c56e
Merge remote-tracking branch 'origin/develop' into cloud-api-version-…
byrond Mar 13, 2024
dc83879
Merge branch 'develop' into cloud-api-version-2-backup
byrond Oct 11, 2024
be6fe11
revert change to default database name
byrond Oct 14, 2024
90b7d7d
default first database name in ddev is "db"
byrond Oct 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
echo "phpmd for tasks"
vendor/bin/phpmd src text defaults/standard/phpmd.xml --suffixes php,inc,module,theme,profile,install,test
echo "phpstan for tasks"
vendor/bin/phpstan analyse src --level=2
vendor/bin/phpstan analyse -c phpstan.neon

# Install a drupal test project.
- run:
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"sort-packages": true,
"allow-plugins": {
"cweagans/composer-patches": true,
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"phing/phing-composer-configurator": true
}
},
"extra": {
Expand Down
22 changes: 6 additions & 16 deletions defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ build:
# The destination host, either 'acquia', 'pantheon', 'platformsh', or 'other'. This is
# currently only used when setting up the settings.php file for a Drupal site.
host: acquia
# Adding specific packages for specific host. One per line.
host_packages:
acquia:
- "typhonius/acquia-php-sdk-v2:^2.0"
byrond marked this conversation as resolved.
Show resolved Hide resolved

# Drupal configuration used by targets/drupal.xml
drupal:
Expand Down Expand Up @@ -134,9 +138,9 @@ drupal:
# $> gunzip -c FILENAME.sql.gz | drush sqlc
#
# Command to extract text contents of the backup file.
contents_command: gunzip -c
contents_command: gzip -dc
byrond marked this conversation as resolved.
Show resolved Hide resolved
# Command to load database contents into Drupal.
mysql_command: drush sqlc
mysql_command: mysql --host=${drupal.site.database.host} --user=${drupal.site.database.username} --password=${drupal.site.database.password} --database=${drupal.site.database.database}
byrond marked this conversation as resolved.
Show resolved Hide resolved

# Load a specific file rather than one matching the `export_pattern`. This can be used
# if your build relies on a seed database that is checked in to the repository.
Expand Down Expand Up @@ -191,14 +195,6 @@ acquia:
# Directory for storing downloaded database backups.
backups: artifacts/backups

# Max age of the downloaded backup database, in hours.
backup_age_hours: 24

# The Acquia Cloud hosting "realm" where the site is running.
# - Acquia Cloud Enterprise: 'prod'
# - Acquia Cloud Professional: 'devcloud'
realm: ""

# Acquia site/application name.
site: ""

Expand All @@ -209,12 +205,6 @@ acquia:
# Acquia environment to download backups from.
env: "prod"

# Acquia Cloud API credentials file, downloaded from your Acquia account. Do not check
# this file into your codebase.
cloud:
conf: "${env.HOME}/.acquia/cloudapi.conf"


# Configuration to use the PHP interpreter's built in linter to check for syntax errors
# and deprecated code. This property is used by the <phplint> task in the
# defaults/build.xml template.
Expand Down
9 changes: 9 additions & 0 deletions defaults/install/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ddev docker env file.
# See: https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#providing-custom-environment-variables-to-a-container

# Copy this file into .env (ie. remove .example)

# Set Acquia Cloud API keys.
# See DevOps secure note in 1Password.
export ACQUIA_CLOUD_API_KEY='REPLACE_ME'
export ACQUIA_CLOUD_API_SECRET='REPLACE_ME'
2 changes: 1 addition & 1 deletion defaults/install/the-build/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ drupal:

# OPTIONAL: The Drupal database name defaults to the site's "dir" value.
database:
database: "drupal"
database: "db"

# Multisites created by `phing drupal-add-multisite` will be automatically added here.
# @multisite_placeholder@
Expand Down
8 changes: 1 addition & 7 deletions docs/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,9 @@ Download a recent backup from Acquia Cloud.
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| dir | directory path | Local backups directory. | | Yes |
| realm | string | Acquia hosting realm, either "devcloud" or "prod". | | Yes |
| site | string | Acquia site name. | | Yes |
| env | string | Acquia environment, generally "dev", "test", or "prod". | | Yes |
| database | string | Acquia database name. | The site name. | No |
| maxAge | int | Maximum age of the backup, in hours. | 24 | No |
| propertyName | string | Name of a property to set to the backup file. | | No |
| credentialsFile | file path | Path to your Acquia Cloud API credentials. (Do not check this file in to your repository) | `~/.acquia/cloudapi.conf` | No |

### Example

Expand All @@ -118,8 +114,6 @@ Download a recent backup from Acquia Cloud.
<taskdef name="getAcquiaBackup" classname="TheBuild\Acquia\GetLatestBackupTask" />

<!-- Required parameters only -->
<getAcquiaBackup dir="artifacts/backups" realm="devcloud" site="mysite" env="prod" />
<getAcquiaBackup dir="artifacts/backups" site="acquia_site_name" env="prod" database="acquia_database" />

<!-- More parameters -->
<getAcquiaBackup dir="artifacts/backups" realm="devcloud" site="mysite" env="prod" credentialsFile="artifacts/.acquia/cloudapi.conf" propertyName="drupal.site.load_db.file" />
```
7 changes: 7 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
parameters:
level: 2
paths:
- src
excludePaths:
analyse:
- src/TheBuild/Acquia
126 changes: 0 additions & 126 deletions src/TheBuild/Acquia/AcquiaTask.php

This file was deleted.

Loading