Skip to content

Commit bc92d90

Browse files
mdt-40224: Added CI environment support. (#25)
* mdt-40224: Added CI environment support. * mdt-40224: Updated pantheon deploy workflow and gitignore file. * mdt-40224: Added CI environment support - Updated CI support.
1 parent 29b59e7 commit bc92d90

File tree

5 files changed

+99
-6
lines changed

5 files changed

+99
-6
lines changed

assets/drupal10/settings.ci.php

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?php
2+
3+
/**
4+
* @file
5+
* CI development override configuration feature.
6+
*/
7+
8+
$loc_db_name = "drupal";
9+
$loc_db_user = 'drupal';
10+
$loc_db_pass = 'drupal';
11+
$loc_db_host = "127.0.0.1";
12+
$loc_db_port = '3306';
13+
14+
$databases = [
15+
'default' =>
16+
[
17+
'default' =>
18+
[
19+
'database' => $loc_db_name,
20+
'username' => $loc_db_user,
21+
'password' => $loc_db_pass,
22+
'host' => $loc_db_host,
23+
'port' => $loc_db_port,
24+
'driver' => 'mysql',
25+
'prefix' => '',
26+
],
27+
],
28+
];
29+
30+
/**
31+
* Setup files on local.
32+
*/
33+
$settings['file_public_path'] = "sites/default/files";
34+
$settings['file_private_path'] = "sites/default/files/private";
35+
$settings["file_temp_path"] = 'sites/default/files/tmp';
36+
37+
/**
38+
* Skip file system permissions hardening on local.
39+
*/
40+
$settings['skip_permissions_hardening'] = TRUE;
41+
42+
/**
43+
* Access control for update.php script.
44+
*/
45+
$settings['update_free_access'] = TRUE;
46+
47+
/**
48+
* Enable local development services.
49+
*/
50+
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';
51+
52+
/**
53+
* Disable Drupal caching.
54+
*/
55+
$settings['cache']['bins']['render'] = 'cache.backend.null';
56+
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
57+
58+
/**
59+
* Enable access to rebuild.php.
60+
*
61+
* This setting can be enabled to allow Drupal's php and database cached
62+
* storage to be cleared via the rebuild.php page. Access to this page can also
63+
* be gained by generating a query string from rebuild_token_calculator.sh and
64+
* using these parameters in a request to rebuild.php.
65+
*/
66+
$settings['rebuild_access'] = TRUE;
67+
68+
/**
69+
* Salt for one-time login links, cancel links, form tokens, etc.
70+
*/
71+
$settings['hash_salt'] = 'LOCAL_ONLY';

assets/drupal10/settings.main.php

+11
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,17 @@
103103
}
104104
}
105105

106+
/**
107+
* Github Actions environment settings.
108+
*/
109+
if (getenv('CI') == 'GITHUB_ACTIONS') {
110+
$path = DRUPAL_ROOT . "/sites/$site/settings/settings.ci.php";
111+
// Load settings.
112+
if (!empty($path) && file_exists($path)) {
113+
require $path;
114+
}
115+
}
116+
106117
/**
107118
* Lando environment settings.
108119
*/

assets/github-actions/workflows/pantheon_deploy.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
---
1+
name: Pantheon Deploy
22
# Triggers the workflow on push or delete events
33
on: [push,delete]
44

55
jobs:
66
validate:
7-
name: Validate Composer
7+
name: Validate Composer Files
88
runs-on: ubuntu-latest
99
steps:
1010
- name: checkout
@@ -29,12 +29,12 @@ jobs:
2929
# - name: Fail if branch name does not match pantheon limitations
3030
# run: TODO
3131

32-
gitsync:
33-
name: Build and push repo
32+
build_deploy:
33+
name: Build and Deploy
3434
runs-on: ubuntu-latest
3535
needs: validate
3636
steps:
37-
- name: Checkout.
37+
- name: Checkout Repository
3838
uses: actions/checkout@v2
3939
with:
4040
fetch-depth: '0'
@@ -44,7 +44,7 @@ jobs:
4444
php-version: '8.3'
4545
tools: composer:v2
4646
extensions: mbstring, gd, intl, yaml, bcmath, curl
47-
- name: Execute build script
47+
- name: Run build script
4848
env:
4949
GIT_REMOTE: ${{ secrets.GIT_REMOTE_HOSTING }}
5050
GIT_SSH_PRIVATE_KEY: ${{ secrets.PANTHEON_DEPLOYER_SSH_PRIVATE }}

assets/misc/gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,19 @@ public.key
9595

9696
# Ignore .env files as they are personal
9797
/.env
98+
# Ignore files generated by MacOS
99+
.DS_Store
98100

99101
# Ignore Test and CI artifacts.
100102
/tests/backstop/backstop_data/bitmaps_reference
101103
/tests/backstop/backstop_data/bitmaps_test
102104
/tests/backstop/backstop_data/ci_report
103105
/tests/backstop/backstop_data/html_report
106+
107+
# Cypress folders
108+
/tests/cypress/screenshots/
109+
/tests/cypress/videos/
110+
/tests/backstop/backstop_data/
111+
112+
#Ignore Google Application credentials
113+
google_application_credentials.json

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"[web-root]/sites/default/settings/pantheon-preproduction-services.yml": "assets/pantheon/pantheon-preproduction-services.yml",
3535
"[web-root]/sites/default/settings/pantheon-production-services.yml": "assets/pantheon/pantheon-production-services.yml",
3636
"[web-root]/sites/default/settings/settings.main.php": "assets/drupal10/settings.main.php",
37+
"[web-root]/sites/default/settings/settings.ci.php": "assets/drupal10/settings.ci.php",
3738
"[web-root]/sites/default/settings/settings.dev.php": "assets/drupal10/settings.dev.php",
3839
"[web-root]/sites/default/settings/settings.lando.php": "assets/drupal10/settings.lando.php",
3940
"[web-root]/sites/default/settings/settings.live.php": "assets/drupal10/settings.live.php",

0 commit comments

Comments
 (0)