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

Tugboat Integration #213

Merged
merged 178 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
b826d90
feat: Add an initial Tugboat scaffold
deviantintegral Sep 18, 2022
0aafc67
Force a new commit / build
deviantintegral Sep 26, 2022
ea62b57
Print env variable names
deviantintegral Sep 26, 2022
b0d99d6
expose TUGBOAT_API_KEY
deviantintegral Sep 26, 2022
31247c1
Fix name
deviantintegral Sep 26, 2022
52876bf
Try pushing up to the job
deviantintegral Sep 26, 2022
97906d8
update settings.php for tugboat
deviantintegral Sep 26, 2022
581da3e
Remove debugging prints
deviantintegral Sep 26, 2022
a1b02b1
Fix tugboat path
deviantintegral Sep 26, 2022
0154290
Tell users tugboat config is installed
deviantintegral Sep 26, 2022
c44ecd2
Fix paths for settings.php
deviantintegral Sep 26, 2022
2f640a1
configre tugboat
edutrul Oct 27, 2022
7af541e
Override default $DOCROOT symlink (#140)
hawkeyetwolf Oct 30, 2022
23dcd13
Merge branch 'main' of github.com:Lullabot/drainpipe into 96-tugboat
deviantintegral Nov 9, 2022
e542c32
Merge branch '96-tugboat-configure' into 96-tugboat
deviantintegral Nov 9, 2022
d93b263
Directly require twig/twig
deviantintegral Nov 11, 2022
19f66f9
Use twig to render tugboat templates
deviantintegral Nov 11, 2022
5425c9a
Downgrade to Twig 2
deviantintegral Nov 11, 2022
634950b
Set PHP version based on composer constraints
deviantintegral Nov 11, 2022
526ba37
Support configuring if you downsync or do a site install
deviantintegral Nov 11, 2022
79d9db2
Add a reminder about environment variables
deviantintegral Nov 11, 2022
015749b
Set permissions on copied files
deviantintegral Nov 11, 2022
aeecf23
Update README
deviantintegral Nov 11, 2022
da76c66
Fix overwriting webp configuration
deviantintegral Nov 11, 2022
fddc109
Fix hardcoding the database type
deviantintegral Nov 11, 2022
7491fdd
Fix indentation
deviantintegral Nov 11, 2022
3f744c1
Only install memcached extension if needed
deviantintegral Nov 11, 2022
bd7881b
Fix using unset variable
deviantintegral Nov 11, 2022
a862196
Simplify syntax
deviantintegral Nov 11, 2022
ce04c58
Add a newline
deviantintegral Nov 11, 2022
a3d0684
Use PHP_EOL instead
deviantintegral Nov 11, 2022
9cd15e7
Fix script path
deviantintegral Nov 11, 2022
4b6f794
Add fixing mkdir
deviantintegral Nov 11, 2022
75f34b7
Fix double }}
deviantintegral Nov 11, 2022
4bdc4de
Clean up spacing
deviantintegral Nov 11, 2022
58d3e04
Fix missing quotes
deviantintegral Nov 11, 2022
7e218f2
Fix guard
deviantintegral Nov 11, 2022
625f9f1
Only trigger caching in tugboat
deviantintegral Nov 11, 2022
408f88c
Clean up the init script
deviantintegral Nov 22, 2022
dcb81dc
Pin to a released ubuntu version
deviantintegral Nov 22, 2022
853fea0
Give a chance to do any dev dependency work
deviantintegral Nov 22, 2022
3afd84b
Add initial tests for config rendering
deviantintegral Nov 22, 2022
143bcad
Use a newer mariadb version when unknown
deviantintegral Nov 22, 2022
a87d405
Add a script to install mysql 5.7 on debian
deviantintegral Nov 22, 2022
3601c6b
Merge branch 'main' of github.com:Lullabot/drainpipe into 96-tugboat
deviantintegral Nov 22, 2022
c1ef2b7
Copy the mysql client install script
deviantintegral Nov 22, 2022
41c553a
Log shell commands as they run
deviantintegral Nov 22, 2022
1fe9afe
Fix if provider isn't set
deviantintegral Nov 22, 2022
da125a0
We already had a var
deviantintegral Nov 23, 2022
68189dc
Make a strict comparison
deviantintegral Nov 23, 2022
11e2b79
Fix chmod typo
deviantintegral Nov 23, 2022
f333b68
Fix assuming PHP 8.1 if undetected
deviantintegral Nov 23, 2022
687a4a2
Fix wrong mariadb version
deviantintegral Nov 23, 2022
52082f5
Fix hardcoding Acquia in tests
deviantintegral Nov 23, 2022
8896b02
Switch php version to strings so .0 isn't dropped
deviantintegral Nov 23, 2022
81d8a75
Purge mariadb if needed
deviantintegral Nov 23, 2022
4a3394a
memcache isn't directly available
deviantintegral Nov 23, 2022
1981cb9
Fix missing )
deviantintegral Nov 23, 2022
15f80b7
WIP
justafish Jun 12, 2023
aaa59cd
Merge branch 'main' into 96-tugboat-pantheon
justafish Jun 12, 2023
f52d05f
wip
justafish Jun 21, 2023
5703baa
Add nodejs support
justafish Jul 6, 2023
d138882
Switch to apache buster
justafish Jul 6, 2023
c7d5366
Fix scripts
justafish Jul 6, 2023
c44567c
Fix file moves
justafish Jul 6, 2023
ee9568f
Fix file moves
justafish Jul 6, 2023
6af5821
Fix file moves
justafish Jul 6, 2023
0afd79b
Fix file moves
justafish Jul 6, 2023
06e9f82
Fix file moves
justafish Jul 6, 2023
c95f7e5
Fix file moves
justafish Jul 6, 2023
4be3e3a
Fix file moves
justafish Jul 6, 2023
b220d18
.
justafish Jul 6, 2023
e0812d6
.
justafish Jul 6, 2023
187a4bd
.
justafish Jul 6, 2023
75eca65
.
justafish Jul 6, 2023
15d044e
.
justafish Jul 6, 2023
fdf3df4
.
justafish Jul 6, 2023
8cf53ea
.
justafish Jul 6, 2023
c826bf7
.
justafish Jul 6, 2023
16c9e16
.
justafish Jul 6, 2023
a8e1ca5
.
justafish Jul 6, 2023
062acbc
.
justafish Jul 6, 2023
e8fcaa1
.
justafish Jul 6, 2023
3d16987
.
justafish Jul 6, 2023
d9983ba
Merge branch 'main' into 96-tugboat-pantheon
justafish Jul 6, 2023
3317c74
Fix file append
justafish Jul 6, 2023
9c467f4
Don't remove the .tugboat directory if Drainpipe isn't controlling Tu…
justafish Jul 7, 2023
df74bcd
Revert scaffold installer plugin
justafish Jul 7, 2023
9cac1ed
Add dependencies
justafish Jul 7, 2023
c7b7a81
.
justafish Jul 7, 2023
6b206ba
.
justafish Jul 7, 2023
dd426c3
.
justafish Jul 10, 2023
8b4aa47
.
justafish Jul 10, 2023
19fb92b
.
justafish Jul 10, 2023
8c7a0d8
.
justafish Jul 10, 2023
aaf8b45
.
justafish Jul 10, 2023
9f3d945
.
justafish Jul 10, 2023
fe93b70
.
justafish Jul 10, 2023
fb017be
.
justafish Jul 10, 2023
717e7ef
.
justafish Jul 10, 2023
5478997
.
justafish Jul 10, 2023
f7ae436
.
justafish Jul 10, 2023
1bfe505
.
justafish Jul 10, 2023
abb2909
.
justafish Jul 10, 2023
f6f0f28
.
justafish Jul 10, 2023
679eb4b
.
justafish Jul 10, 2023
7a9718f
.
justafish Jul 10, 2023
ed22e76
.
justafish Jul 10, 2023
25b03b8
.
justafish Jul 10, 2023
92e9d04
.
justafish Jul 10, 2023
b0a5b0f
.
justafish Jul 10, 2023
142b9ba
.
justafish Jul 10, 2023
84e0284
.
justafish Jul 10, 2023
efa8c7b
Update Tugboat test
justafish Jul 10, 2023
7563bd9
Fix file names
justafish Jul 10, 2023
57e7996
Fix file names
justafish Jul 10, 2023
eb3c757
Fix image name
justafish Jul 10, 2023
05b5f64
remove linespace
justafish Jul 10, 2023
8ca393f
Fix extra newline
justafish Jul 11, 2023
71ebf9a
fix cmps
justafish Jul 11, 2023
9672a66
.
justafish Jul 11, 2023
7e4d277
Fix newline
justafish Jul 11, 2023
0f79218
Fix nodejs installer
justafish Jul 11, 2023
57de4a3
Remove space
justafish Jul 11, 2023
0a86a79
debugging
justafish Jul 11, 2023
2e4d9af
sed the right filesW
justafish Jul 11, 2023
0f78a6e
Remove debugging and switch to php-fpm image
justafish Jul 11, 2023
662ce89
bump libwebp
justafish Jul 11, 2023
d168100
Get all the Tugboat info out of the ddev configuration
justafish Jul 11, 2023
39325db
Add a build:tugboat command
justafish Jul 11, 2023
46a0e79
Update readme
justafish Jul 11, 2023
18ee8f6
Use a lower version of mariadb from the default to test tugboat confi…
justafish Jul 11, 2023
d55754c
Don't overrwite all tugboat config
justafish Jul 11, 2023
8300dab
Fix webserver image name
justafish Jul 11, 2023
b636ad9
Check apache image
justafish Jul 11, 2023
49c387f
Add file comment
justafish Jul 18, 2023
550d364
install task and allow hooks into tugboat steps
justafish Jul 18, 2023
a71bbda
Install into /usr/local/bin
justafish Jul 19, 2023
94814e2
bring in tasks
justafish Jul 19, 2023
33e5647
tidy up
justafish Jul 19, 2023
8cdf8e4
don't restart
justafish Jul 19, 2023
61d6516
Add documentation
justafish Jul 20, 2023
870cdf5
Add sync override support
justafish Jul 20, 2023
7b0229b
tidy up
justafish Jul 20, 2023
5d1be2d
fix spacing
justafish Jul 20, 2023
c8313fa
fix spacing
justafish Jul 20, 2023
1bbbf66
fix spacing
justafish Jul 20, 2023
1778bcd
fix spacing
justafish Jul 20, 2023
519d7e5
fix spacing
justafish Jul 20, 2023
050997f
fix spacing
justafish Jul 20, 2023
03d0532
fix spacing
justafish Jul 20, 2023
6b02ae6
Add missing -
justafish Jul 20, 2023
a915f54
Check items out in other images
justafish Jul 20, 2023
96b61da
spacing
justafish Jul 20, 2023
b6e1d31
Delete includes in redis and mysql
justafish Jul 20, 2023
235b0b6
zip extension
justafish Jul 20, 2023
b31ad15
Tugboat settings
justafish Jul 21, 2023
74e1848
Create files directory
justafish Jul 21, 2023
5cd5e0d
Create files directory
justafish Jul 21, 2023
d148f92
Fix nodejs version
justafish Jul 21, 2023
9567de2
rm dir
justafish Jul 21, 2023
e023607
Add Terminus support
justafish Jul 21, 2023
ac7bde9
cd to tugboat root
justafish Jul 21, 2023
600d9e3
Fix sync command
justafish Jul 24, 2023
e8df32a
Documentation
justafish Jul 24, 2023
39b8825
Add more default Tugboat settings
justafish Jul 24, 2023
2e3fafd
Fix indentation error
justafish Jul 24, 2023
9e8d030
test fixes
justafish Jul 24, 2023
da504c4
Fix node setup in test
justafish Jul 24, 2023
8522190
Remove file
justafish Jul 24, 2023
ac0050d
Merge branch 'main' into 96-tugboat-pantheon
justafish Jul 24, 2023
ed765ce
Use TUGBOAT_ROOT instead of DOCROOT
justafish Jul 24, 2023
1411e0b
Use TUGBOAT_ROOT instead of DOCROOT
justafish Jul 24, 2023
6ca6abe
remove explicit tugboat settings
justafish Jul 24, 2023
3305f63
Include tugboat settings
justafish Jul 24, 2023
35d6414
Configure composer.json
justafish Jul 24, 2023
743590a
.
justafish Jul 24, 2023
ba2539e
.
justafish Jul 24, 2023
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
75 changes: 75 additions & 0 deletions .github/workflows/TestTugboat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: "Test Tugboat"

on:
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
Test-Tugboat:
runs-on: ubuntu-latest
steps:
- name: Create a Drupal project
run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd

- uses: actions/checkout@v3
with:
path: drainpipe

- uses: ./drainpipe/scaffold/github/actions/common/set-env

- name: Install DDEV
uses: ./drainpipe/scaffold/github/actions/common/ddev
with:
git-name: Drainpipe Bot
git-email: no-reply@example.com
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Setup Project
run: |
ddev config --auto
ddev config --php-version "8.1"
ddev config --nodejs-version "18"
ddev config --database=mariadb:10.4
ddev start
ddev composer config extra.drupal-scaffold.gitignore true
ddev composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"]
ddev composer config --no-plugins allow-plugins.composer/installers true
ddev composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true
ddev composer config --no-plugins allow-plugins.lullabot/drainpipe true
ddev composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}'
ddev composer config minimum-stability dev
ddev composer config extra.drainpipe --json '{"tugboat": {}}'
ddev composer require lullabot/drainpipe --with-all-dependencies

# Compare the generated files to the ones used to build this repository
# preview - they should be the same.
- name: Test Generated Files
run: |
cmp -b drainpipe/.tugboat/config.yml .tugboat/config.yml
sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/1-init.sh
sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/2-update.sh
sed -i '/#drainpipe-start/,/#drainpipe-end/d' drainpipe/.tugboat/steps/3-build.sh
cmp -b drainpipe/.tugboat/steps/1-init.sh .tugboat/steps/1-init.sh
cmp -b drainpipe/.tugboat/steps/2-update.sh .tugboat/steps/2-update.sh
cmp -b drainpipe/.tugboat/steps/3-build.sh .tugboat/steps/3-build.sh

- name: Add a build:tugboat step
run: |
echo " build:tugboat:" >> Taskfile.yml
echo " cmds:" >> Taskfile.yml
echo " - echo \"Tugboat build\"" >> Taskfile.yml
ddev composer install
if ! grep -q './vendor/bin/task build:tugboat' .tugboat/steps/3-build.sh; then
exit 1
fi

- name: Upload test artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: .tugboat
path: .tugboat
16 changes: 16 additions & 0 deletions .tugboat/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
services:
php:
http: false
image: tugboatqa/php-nginx:8.1-fpm
default: true

depends:
- mariadb

commands:
init: ./.tugboat/steps/1-init.sh
update: ./.tugboat/steps/2-update.sh
build: ./.tugboat/steps/3-build.sh

mariadb:
image: tugboatqa/mariadb:10.4
71 changes: 71 additions & 0 deletions .tugboat/steps/1-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/bin/bash

set -eux
echo "Initializing..."

# Install task
sh -c "$(curl --location https://raw.githubusercontent.com/go-task/task/v3.24.0/install-task.sh)" -- -d -b /usr/local/bin

# Install mysql or mariadb client.
apt-get update
apt-get install -y mariadb-client

# Link the document root to the expected path. Tugboat uses /docroot
# by default. So, if Drupal is located at any other path in your git
# repository, change that here. This example links /web to the docroot
ln -snf "${TUGBOAT_ROOT}/web" "${DOCROOT}"

# Create the Drupal private and public files directories if they aren't
# already present.
mkdir -p "${TUGBOAT_ROOT}/web/sites/default/files"
chmod 777 "${TUGBOAT_ROOT}/web/sites/default/files"

# Install the PHP opcache as it's not included by default and needed for
# decent performance.
docker-php-ext-install opcache

# GD dependencies.
apt-get install -y libpng-dev libjpeg-dev libfreetype6-dev

# WebP dependencies.
apt-get install -y libwebp-dev libwebp7 webp libmagickwand-dev

# Build and install gd.
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp
docker-php-ext-install gd

# Install ImageMagick. This is recommended by both Acquia and Pantheon instead
# of GD. Lullabot will likely be publishing an ADR recommending it too.
apt-get install -y imagemagick

# Install node
curl -fsSL https://deb.nodesource.com/setup_current.x | bash -
apt-get install -y nodejs
npm install -g n
n 18
# This only works for node > 16, but that version is unsupported now anyway.
corepack enable
#drainpipe-start
# This is necessary for testing as this repository doesn't hold a Drupal site.
shopt -s dotglob
mkdir ../drainpipe-tmp
mv * ../drainpipe-tmp/
composer create-project drupal/recommended-project .
mv ../drainpipe-tmp drainpipe
composer config extra.drupal-scaffold.gitignore true
composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"]
composer config --no-plugins allow-plugins.composer/installers true
composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true
composer config --no-plugins allow-plugins.lullabot/drainpipe true
composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": true}}'
composer config extra.drainpipe --json '{"tugboat": {}}'
composer config minimum-stability dev
composer require lullabot/drainpipe --with-all-dependencies
cp web/sites/default/default.settings.php web/sites/default/settings.php
#drainpipe-end

composer install
#drainpipe-start
rm -rf .tugboat
mv drainpipe/.tugboat .tugboat
#drainpipe-end
15 changes: 15 additions & 0 deletions .tugboat/steps/2-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -eux
echo "Updating..."

#drainpipe-start
mv .tugboat .tugboat-tmp
#drainpipe-end
composer install
./vendor/bin/task sync
#drainpipe-start
./vendor/bin/drush config:export --yes
rm -rf .tugboat
mv .tugboat-tmp .tugboat
#drainpipe-end
7 changes: 7 additions & 0 deletions .tugboat/steps/3-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -eux
echo "Building..."

./vendor/bin/task build
./vendor/bin/task drupal:update
93 changes: 93 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,101 @@ Requires `GITLAB_ACCESS_TOKEN` variable to be set, which is an access token with
}
```

- Add the following the composer.json to enable deployment of Pantheon Review Apps
```json
"extra": {
"drainpipe": {
"github": ["PantheonReviewApps"]
}
}
```
- Run `composer install`
- Add your Pantheon `site-name` to the last job in the new
workflow file at `.github/workflows/PantheonReviewApps.yml`
- Add the following secrets to your repository:
- `PANTHEON_TERMINUS_TOKEN` See https://pantheon.io/docs/terminus/install#machine-token
- `SSH_PRIVATE_KEY` A private key of a user which can push to Pantheon
- `SSH_KNOWN_HOSTS` The result of running `ssh-keyscan -H codeserver.dev.$PANTHEON_SITE_ID.drush.in`
- `TERMINUS_PLUGINS` Comma-separated list of Terminus plugins to be available (optional)

This will setup Merge Request deployment to Pantheon Multidev environments. See
[scaffold/gitlab/gitlab-ci.example.yml] for an example. You can also just
include which will give you helpers that you can include and reference for tasks
such as setting up [Terminus](https://pantheon.io/docs/terminus). See
[scaffold/gitlab/Pantheon.gitlab-ci.yml](scaffold/gitlab/Pantheon.gitlab-ci.yml).

## Tugboat

Add the following to `composer.json` to add Tugboat configuration:

```json
{
"extra": {
"drainpipe": {
"tugboat": {}
}
}
}
```

The following will be autodetected based on your `.ddev/config.yml`:
- Web server (nginx or apache)
- PHP version
- Database type and version
- nodejs version
- Redis (Obtained with `ddev get ddev/ddev-redis`)

Additionally, Pantheon Terminus can be added:
```json
{
"extra": {
"drainpipe": {
"tugboat": {
"terminus": true
}
}
}
}
```

It is assumed the following tasks exist:
- `build`
- `sync`

The `build` and `sync` tasks can be overridden with a `build:tugboat` and
`sync:tugboat` task if required (you will need to re-run `composer install` to
regenerate the Tugboat scripts if you are adding this task to your
`Taskfile.yml` for the first time).

```
sync:
desc: "Fetches a database from Pantheon and imports it"
cmds:
- task: pantheon:fetch-db
- task: drupal:import-db
sync:tugboat:
desc: "Fetches a database from Pantheon and imports it in Tugboat"
cmds:
- task: pantheon:fetch-db
vars:
DB_DIR: /var/lib/tugboat/files/db
- task: drupal:import-db
vars:
DB_DIR: /var/lib/tugboat/files/db
```

>>>
💡
`composer install` should be re-run if any changes are made to the DDEV
configuration.
>>>

You can hook into the `init` step of images by adding them to your
`Taskfile.yml`, e.g.

```
tugboat:php:init:
cmds:
- apt-get install -y libldap2-dev
- docker-php-ext-install ldap
```
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
},
"require": {
"php": "^7.3||^8.0",
"ext-json": "*",
"composer-plugin-api": "^2.0",
"drush/drush": "^10|^11",
"symfony/yaml": "^3|^4|^5|^6",
"twig/twig": "^2|^3",
"vlucas/phpdotenv": "^4|^5",
"ext-json": "*"
},
Expand Down
8 changes: 8 additions & 0 deletions scaffold/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@ tasks:
# assets:watch:
# desc: "Builds assets such as CSS & JS, and watches them for changes"
# deps: [sass:watch, javascript:watch]
sync:
desc: "Sync a database from production and import it"
cmds:
# Replace this with a command to fetch your database.
- ./vendor/bin/drush site:install -y
- echo "🧹 Sanitising database"
- ./vendor/bin/drush sql:sanitize --yes

42 changes: 42 additions & 0 deletions scaffold/tugboat/config.yml.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
services:
php:
http: false
image: {{ webserver_image }}
default: true

depends:
- {{ database_type }}
{% if memory_cache_type %}
- {{ memory_cache_type }}
{% endif %}

commands:
init: ./.tugboat/steps/1-init.sh
update: ./.tugboat/steps/2-update.sh
build: ./.tugboat/steps/3-build.sh

{{ database_type }}:
image: tugboatqa/{{ database_type }}:{{ database_version }}
{% if init.mysql %}
checkout: true
commands:
init:
- sh -c "$(curl --location https://raw.githubusercontent.com/go-task/task/v{{ task_version }}/install-task.sh)" -- -d -b /usr/local/bin
- wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq
- yq -i 'del(."includes")' Taskfile.yml
- task tugboat:mysql:init
{% endif %}
{% if memory_cache_type %}

{{ memory_cache_type }}:
image: tugboatqa/{{ memory_cache_type }}:{{ memory_cache_version }}
{% if init.redis %}
checkout: true
commands:
init:
- sh -c "$(curl --location https://raw.githubusercontent.com/go-task/task/v{{ task_version }}/install-task.sh)" -- -d -b /usr/local/bin
- wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq
- yq -i 'del(."includes")' Taskfile.yml
- task tugboat:redis:init
{% endif %}
{% endif %}
32 changes: 32 additions & 0 deletions scaffold/tugboat/settings.tugboat.php.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

/**
* @file
* Tugboat Drupal settings.
*
* This file cannot be edited, but you can add/override Tugboat settings after
* it has been included in the main settings.php file.
*/

if (file_exists(__DIR__ . '/settings.tugboat.php') && getenv('TUGBOAT_PREVIEW_ID')) {
$databases['default']['default'] = [
'database' => 'tugboat',
'username' => 'tugboat',
'password' => 'tugboat',
'prefix' => '',
'host' => '{{ database_type }}',
'port' => '3306',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
];

$settings['hash_salt'] = hash('sha256', getenv('TUGBOAT_REPO_ID'));

$settings['trusted_host_patterns'] = [
'\.tugboatqa\.com$',
];

$config['environment_indicator.indicator']['name'] = '☑️ Tugboat';
$config['environment_indicator.indicator']['bg_color'] = '#07688c';
$config['environment_indicator.indicator']['fg_color'] = '#ffffff';
}
Loading