Skip to content

Commit

Permalink
Merge branch 'release/1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Welch committed Mar 1, 2021
2 parents a86c475 + b5a6993 commit 699c460
Show file tree
Hide file tree
Showing 25 changed files with 182 additions and 29 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# nystudio107/plugindev Change Log

## 1.0.1 - 2021.02.28
### Added
* Added postgres container
* Dynamic switching between mysql and postgres by just changing a line in `db.php`

### Changed
* Switch to Craft CMS 3.6.7 as a starting base
* Switch to MySQL 8.x

## 1.0.0 - 2021.02.28
### Added
* Initial release
Expand Down
3 changes: 1 addition & 2 deletions cms/composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"require": {
"craftcms/cms": "^3.5.15.1",
"craftcms/cms": "^3.6.7",
"vlucas/phpdotenv": "^3.4.0",
"yiisoft/yii2-redis": "^2.0.6",
"nystudio107/craft-connect": "^1.0.0",
"nystudio107/craft-cookies": "^1.0.0",
"nystudio107/craft-crafty": "^1.0.0",
"nystudio107/craft-disqus": "^1.0.0",
"nystudio107/craft-eagerbeaver": "^1.0.0",
"nystudio107/craft-emptycoalesce": "^1.0.0",
Expand Down
18 changes: 17 additions & 1 deletion cms/config/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

use craft\helpers\App;

return [
$baseConfig = [
'dsn' => App::env('DB_DSN') ?: null,
'driver' => App::env('DB_DRIVER'),
'server' => App::env('DB_SERVER'),
Expand All @@ -21,3 +21,19 @@
'schema' => App::env('DB_SCHEMA'),
'tablePrefix' => App::env('DB_TABLE_PREFIX'),
];

$mysqlConfig = [
'driver' => 'mysql',
'server' => 'mysql',
'port' => 3306,
];

$postgresConfig = [
'driver' => 'pgsql',
'server' => 'postgres',
'port' => 5432,
];

// Choose whether to override with either $mysqlConfig or $postgresConfig
// no restarting anything, just reload the page
return array_merge($baseConfig, $postgresConfig);
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
fieldLayouts:
31e67dee-1002-4a93-9546-8b234b3b368b:
tabs:
-
elements:
-
autocapitalize: true
autocomplete: false
autocorrect: true
class: null
disabled: false
id: null
instructions: null
label: null
max: null
min: null
name: null
orientation: null
placeholder: null
readonly: false
requirable: false
size: null
step: null
tip: null
title: null
type: craft\fieldlayoutelements\EntryTitleField
warning: null
width: 100
name: Content
sortOrder: 1
handle: errors
hasTitleField: true
name: Errors
section: a72bfe0c-3389-4f9f-8ec1-ab318ec10b29
sortOrder: 1
titleFormat: null
titleLabel: Title
titleTranslationKeyFormat: null
titleTranslationMethod: ''
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
fieldLayouts:
fff7ed87-136b-4fc9-b978-481e41e39e26:
tabs:
-
elements:
-
autocapitalize: true
autocomplete: false
autocorrect: true
class: null
disabled: false
id: null
instructions: null
label: null
max: null
min: null
name: null
orientation: null
placeholder: null
readonly: false
requirable: false
size: null
step: null
tip: null
title: null
type: craft\fieldlayoutelements\EntryTitleField
warning: null
width: 100
name: Content
sortOrder: 1
handle: homepage
hasTitleField: false
name: Homepage
section: 54e60257-f31a-44aa-960e-bbd364197e28
sortOrder: 1
titleFormat: '{section.name|raw}'
titleLabel: null
titleTranslationKeyFormat: null
titleTranslationMethod: ''
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ instructions: ''
name: 'Error Headline'
searchable: true
settings:
charLimit: ''
byteLimit: null
charLimit: null
code: ''
columnType: text
initialRows: '4'
multiline: ''
placeholder: ''
uiMode: normal
translationKeyFormat: null
translationMethod: none
type: craft\fields\PlainText
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,28 @@ instructions: ''
name: 'Error Image'
searchable: true
settings:
allowSelfRelations: false
allowUploads: true
allowedKinds:
- image
defaultUploadLocationSource: 'volume:5c642d7e-b16b-4836-9575-668d75d242e5'
defaultUploadLocationSubpath: ''
limit: '1'
localizeRelations: false
previewMode: full
restrictFiles: '1'
selectionLabel: ''
showSiteMenu: true
showUnpermittedFiles: false
showUnpermittedVolumes: true
singleUploadLocationSource: 'volume:5c642d7e-b16b-4836-9575-668d75d242e5'
singleUploadLocationSubpath: ''
source: null
sources:
- 'volume:5c642d7e-b16b-4836-9575-668d75d242e5'
targetSiteId: null
useSingleFolder: ''
validateRelatedElements: ''
useSingleFolder: false
validateRelatedElements: false
viewMode: large
translationKeyFormat: null
translationMethod: site
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ instructions: ''
name: 'Error Text'
searchable: true
settings:
charLimit: ''
byteLimit: null
charLimit: null
code: ''
columnType: text
initialRows: '4'
multiline: '1'
placeholder: ''
uiMode: normal
translationKeyFormat: null
translationMethod: none
type: craft\fields\PlainText
3 changes: 3 additions & 0 deletions cms/config/project/graphql/graphql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
publicToken:
enabled: false
expiryDate: null
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
isPublic: true
name: 'Public Schema'
8 changes: 2 additions & 6 deletions cms/config/project/project.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
dateModified: 1605065696
dateModified: 1614542205
email:
fromEmail: [email protected]
fromName: Craft
transportType: craft\mail\transportadapters\Sendmail
graphql:
publicToken:
enabled: false
expiryDate: null
plugins:
fastcgi-cache-bust:
edition: standard
Expand Down Expand Up @@ -96,7 +92,7 @@ system:
live: true
name: Project
retryDuration: 60
schemaVersion: 3.5.13
schemaVersion: 3.6.4
timeZone: America/New_York
users:
allowPublicRegistration: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
baseUrl: $SITE_URL
enabled: true
handle: default
hasUrls: true
language: en-US
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,40 @@
fieldLayouts:
8e570088-70dd-482b-9657-5b8511032da4:
tabs:
-
elements:
-
autocapitalize: true
autocomplete: false
autocorrect: true
class: null
disabled: false
id: null
instructions: null
label: null
max: null
min: null
name: null
orientation: null
placeholder: null
readonly: false
requirable: false
size: null
step: null
tip: null
title: null
type: craft\fieldlayoutelements\AssetTitleField
warning: null
width: 100
name: Content
sortOrder: 1
handle: site
hasUrls: true
name: Site
settings:
path: '@webroot/assets/site'
sortOrder: 1
titleTranslationKeyFormat: null
titleTranslationMethod: site
type: craft\volumes\Local
url: '@assetsUrl/assets/site'
3 changes: 0 additions & 3 deletions cms/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ RUN_QUEUE_AUTOMATICALLY=0
SECURITY_KEY=EOdiVBONceb8zFGJP7InMui2pMkvNACz

# Craft database settings
DB_DRIVER=mysql
DB_SERVER=mariadb
DB_USER=project
DB_PASSWORD=project
DB_DATABASE=project
DB_SCHEMA=public
DB_TABLE_PREFIX=
DB_PORT=3306

# URL & path settings
ASSETS_URL=http://localhost:8000
Expand Down
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nystudio107/plugindev",
"description": "nystudio107 Craft CMS plugin development environment scaffolding",
"version": "1.0.0",
"version": "1.0.1",
"keywords": [
"craft",
"cms",
Expand All @@ -20,8 +20,6 @@
"rss": "https://craftcms.com/changelog.rss"
},
"require": {
"craftcms/cms": "^3.5.15.1",
"vlucas/phpdotenv": "^3.4.0"
},
"autoload": {
"psr-4": {
Expand Down
Binary file removed db-seed/seed_db.sql.gz
Binary file not shown.
35 changes: 28 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ services:
context: ./docker-config/php-prod-craft
dockerfile: ./Dockerfile
depends_on:
- "mariadb"
- "mysql"
- "postgres"
- "redis"
env_file:
*env
Expand Down Expand Up @@ -51,6 +52,23 @@ services:
user: www-data
volumes:
*php-volumes
# postgres - database
postgres:
build:
context: ./docker-config/postgres
dockerfile: ./Dockerfile
env_file:
*env
environment:
POSTGRES_DB: project
POSTGRES_USER: project
POSTGRES_PASSWORD: project
init: true
ports:
- "5432:5432"
volumes:
- postgres-db-data:/usr/local/pgsql/data
- ./postgres-db-seed/:/docker-entrypoint-initdb.d
# queue - runs queue jobs via php craft queue/listen
queue:
build:
Expand All @@ -66,11 +84,13 @@ services:
user: www-data
volumes:
*php-volumes
# mariadb - database
mariadb:
# mysql - database
mysql:
build:
context: ./docker-config/mariadb
context: ./docker-config/mysql
dockerfile: ./Dockerfile
cap_add:
- SYS_NICE # CAP_SYS_NICE
env_file:
*env
environment:
Expand All @@ -82,8 +102,8 @@ services:
ports:
- "3306:3306"
volumes:
- db-data:/var/lib/mysql
- ./db-seed/:/docker-entrypoint-initdb.d
- mysql-db-data:/var/lib/mysql
- ./mysql-db-seed:/docker-entrypoint-initdb.d
# redis - key/value database for caching & php sessions
redis:
build:
Expand All @@ -94,6 +114,7 @@ services:
init: true

volumes:
db-data:
mysql-db-data:
postgres-db-data:
cpresources:
storage:
1 change: 0 additions & 1 deletion docker-config/mariadb/Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions docker-config/mysql/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM mysql:8
Loading

0 comments on commit 699c460

Please sign in to comment.