Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
47 changes: 47 additions & 0 deletions .github/workflows/drupal_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Drupal Dev

on:
push:
branches:
- main
paths:
- 'drupal/**'

env:
SKPR_USERNAME: ${{ secrets.SKPR_QA_USERNAME }}
SKPR_PASSWORD: ${{ secrets.SKPR_QA_PASSWORD }}

concurrency:
group: drupal-dev
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./drupal
steps:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not using the gh-workflows because it needs to set the working directory. And I can't do that easily without updating those workflows.

- name: ⬇️ Checkout Code
uses: actions/checkout@v6

- name: Setup skpr
uses: skpr/setup-action@v1
env:
GH_TOKEN: ${{ github.token }}

- name: Get version
id: version
run: |
version=$(git rev-parse --short HEAD)
echo "::notice:: Using version $version from git describe"
echo "version=$version" >> $GITHUB_OUTPUT

- name: 📦 Package
run: skpr package ${{ steps.version.outputs.version }}

- name: 🚀 Deploy
run: skpr deploy dev ${{ steps.version.outputs.version }}

- name: 🧹 Post-deploy
run: skpr exec dev "drush updb -y"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/
.env
12 changes: 12 additions & 0 deletions drupal/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
app/
bin/
composer.lock
config-export/
recipes/
vendor/
.editorconfig
.gitattributes
.php/

!app/sites/default/settings.php
!app/sites/default/services.yml
4 changes: 2 additions & 2 deletions drupal/.skpr/package/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG COMPILE_IMAGE=scratch
FROM ${COMPILE_IMAGE} as build
FROM ${COMPILE_IMAGE} AS build

FROM skpr/php-cli:7.4-1.x
FROM skpr/php-cli:8.3-v2-stable
ARG SKPR_VERSION
ENV SKPR_VERSION=$SKPR_VERSION
COPY --chown=skpr:skpr --from=build /data /data
15 changes: 6 additions & 9 deletions drupal/.skpr/package/compile/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
FROM skpr/php-cli:7.4-1.x as build
FROM skpr/php-cli:8.3-v2-stable AS build

ADD .skpr/package/compile/composer.json composer.json
RUN composer install --prefer-dist
ADD composer.json composer.json
RUN composer install --prefer-dist --no-progress

ADD .skpr/package/compile/settings.php app/sites/default/settings.php
ADD .skpr/package/compile/services.yml app/sites/default/services.yml
ADD app/sites/default/settings.php app/sites/default/settings.php
ADD app/sites/default/services.yml app/sites/default/services.yml

RUN mkdir /data/config-export

FROM skpr/php-fpm:7.4-1.x as run
COPY --chown=skpr:skpr --from=build /data /data
RUN mkdir config-export
4 changes: 2 additions & 2 deletions drupal/.skpr/package/fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG COMPILE_IMAGE=scratch
FROM ${COMPILE_IMAGE} as build
FROM ${COMPILE_IMAGE} AS build

FROM skpr/php-fpm:7.4-1.x
FROM skpr/php-fpm:8.3-v2-stable
ARG SKPR_VERSION
ENV SKPR_VERSION=$SKPR_VERSION
COPY --chown=skpr:skpr --from=build /data /data
4 changes: 2 additions & 2 deletions drupal/.skpr/package/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG COMPILE_IMAGE=scratch
FROM ${COMPILE_IMAGE} as build
FROM ${COMPILE_IMAGE} AS build

FROM skpr/nginx:1.x
FROM skpr/nginx-drupal:v3-stable
COPY --chown=skpr:skpr --from=build /data /data
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,26 @@
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => $skpr->get('mysql.default.database') ?: 'local',
'username' => $skpr->get('mysql.default.username') ?: 'drupal',
'password' => $skpr->get('mysql.default.password') ?: 'drupal',
'username' => $skpr->get('mysql.default.username') ?: 'local',
'password' => $skpr->get('mysql.default.password') ?: 'local',
'host' => $skpr->get('mysql.default.proxy') ?: '127.0.0.1',
);

$databases['default']['default']['pdo'][PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = false;

$config['cron_safe_threshold'] = '0';
$settings['file_public_path'] = 'sites/default/files';
$config['system.file']['path']['temporary'] = '/mnt/temporary';
$settings['file_private_path'] = '/mnt/private';
$config['system.file']['path']['temporary'] = $skpr->get('mount.temporary', '/tmp');;
$settings['file_private_path'] = $skpr->get('mount.private', '/data/app/sites/default/files/private');;

$settings['hash_salt'] = !empty($settings['hash_salt']) ? $settings['hash_salt'] : 'xxxxxxxxxxxxxxxxxxxx';
$settings['hash_salt'] = $skpr->get('drupal.hash_salt', 'xxxxxxxxxxxxxxxxxxxxxxx');

$settings['trusted_host_patterns'][] = '^127\.0\.0\.1$';
foreach ($skpr->hostNames() as $hostname) {
$settings['trusted_host_patterns'][] = '^' . preg_quote($hostname) . '$';
}

$config['prometheus_exporter_token_access.settings']['access_token'] = $skpr->get('skpr.token') ?: '';
$config['prometheus_exporter_token_access.settings']['access_token'] = $skpr->get('skpr.token', '');

$config['elasticsearch_connector.cluster.default']['url'] = $skpr->get('elasticsearch.writer.endpoint', 'https://localhost:9200');
$config['elasticsearch_connector.cluster.default']['options']['username'] = $skpr->get('elasticsearch.writer.username', 'admin');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
],
"require": {
"composer/installers": "^1.9",
"drupal/core-composer-scaffold": "^9.1",
"drupal/core-project-message": "^9.1",
"drupal/core-recommended": "^9.1",
"drupal/elasticsearch_connector": "^7.0@dev",
"drupal/search_api": "^1.18",
"drush/drush": "^10",
"skpr/config": "^2.0-beta2"
"drupal/core-composer-scaffold": "^11.2",
"drupal/core-project-message": "^11.2",
"drupal/core-recommended": "^11.2",
"drupal/search_api_opensearch": "^2.5",
"drupal/skpr_logs": "^1.0",
"drush/drush": "^13",
"skpr/config": "^3.0"
},
"conflict": {
"drupal/drupal": "*"
Expand All @@ -30,7 +30,8 @@
"allow-plugins": {
"composer/installers": true,
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true
"drupal/core-project-message": true,
"php-http/discovery": true
}
},
"extra": {
Expand Down
15 changes: 7 additions & 8 deletions drupal/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
version: "3"

services:

##################
# Web
##################

nginx:
image: skpr/nginx-drupal:dev-v2-latest
image: skpr/nginx-drupal:dev-v3-latest
ports:
- 8080:8080
- 3306:3306
Expand All @@ -17,7 +15,7 @@ services:
- ./:/data

php-fpm:
image: skpr/php-fpm:8.0-dev-v2-latest
image: skpr/php-fpm:8.3-dev-v2-latest
network_mode: service:nginx
environment:
- PHP_IDE_CONFIG=serverName=localhost
Expand All @@ -29,7 +27,7 @@ services:
##################

php-cli:
image: skpr/php-cli:8.0-dev-v2-latest
image: skpr/php-cli:8.3-dev-v2-latest
command: /bin/bash -c "sleep infinity"
network_mode: service:nginx
environment:
Expand All @@ -43,14 +41,15 @@ services:

mysql-default:
# For "skpr mysql pull dev" to get the latest image.
image: xxxxxxxxx.dkr.ecr.ap-southeast-2.amazonaws.com/skpr-project/mysql:dev-default-latest
# You can replace the environment variables here with hard-coded values.
image: ${ECR_ID:-xxxxxx}.dkr.ecr.ap-southeast-2.amazonaws.com/${SKPR_PROJECT:-skpr-project}/mysql/dev:default-latest
network_mode: service:nginx

##################
# Services
##################

mailhog:
image: mailhog/mailhog
mail:
image: axllent/mailpit
ports:
- 8025:8025