Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.
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
28 changes: 28 additions & 0 deletions .versionrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"bumpFiles": [
{
"filename": "compose/base/2.3.yml",
"updater": "tools/standard-version/compose-yml"
},
{
"filename": "compose/base/2.4.yml",
"updater": "tools/standard-version/compose-yml"
},
{
"filename": "compose/php/7.2/7.2-dolphin.yml",
"updater": "tools/standard-version/compose-yml"
},
{
"filename": "compose/php/7.3/7.3-dolphin.yml",
"updater": "tools/standard-version/compose-yml"
},
{
"filename": "compose/php/7.4/7.4-dolphin.yml",
"updater": "tools/standard-version/compose-yml"
},
{
"filename": "compose/php/8.1/8.1-dolphin.yml",
"updater": "tools/standard-version/compose-yml"
}
]
}
19 changes: 9 additions & 10 deletions compose/base/2.3.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
version : '3'

version: "3"
services:
ingress:
extends:
file: ./compose/base/base.yml
service: ingress
image: graycore/magento-nginx:1.18-alpine-develop-v6.0.0-alpha.2
depends_on:
- magento2
- magento2
magento2:
extends:
file: ./compose/base/base.yml
service: magento2
image: graycore/magento-php:7.4-fpm-alpine-dolphin-v6.0.0-alpha.2
environment:
- CONFIG__DEFAULT__CATALOG__SEARCH__ELASTICSEARCH6_SERVER_HOSTNAME=elasticsearch
- CONFIG__DEFAULT__CATALOG__SEARCH__ENGINE=elasticsearch6
- CONFIG__DEFAULT__CATALOG__SEARCH__ELASTICSEARCH6_SERVER_PORT=9200
- CONFIG__DEFAULT__CATALOG__SEARCH__ELASTICSEARCH6_SERVER_HOSTNAME=elasticsearch
- CONFIG__DEFAULT__CATALOG__SEARCH__ENGINE=elasticsearch6
- CONFIG__DEFAULT__CATALOG__SEARCH__ELASTICSEARCH6_SERVER_PORT=9200
database:
extends:
file: ./compose/base/base.yml
Expand Down Expand Up @@ -51,8 +50,8 @@ services:
volumes:
- es_data:/usr/share/elasticsearch/data
networks:
frontend:
backend:
frontend: null
backend: null
volumes:
db_data:
es_data:
db_data: null
es_data: null
27 changes: 13 additions & 14 deletions compose/base/2.4.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
version : '3'

version: "3"
services:
ingress:
extends:
file: ./compose/base/base.yml
service: ingress
image: graycore/magento-nginx:1.18-alpine-develop-v6.0.0-alpha.2
depends_on:
- magento2
- magento2
magento2:
extends:
file: ./compose/base/base.yml
service: magento2
image: graycore/magento-php:7.4-fpm-alpine-dolphin-v6.0.0-alpha.2
environment:
- CONFIG__DEFAULT__CATALOG__SEARCH__ELASTICSEARCH7_SERVER_HOSTNAME=elasticsearch
- CONFIG__DEFAULT__CATALOG__SEARCH__ENGINE=elasticsearch7
- CONFIG__DEFAULT__CATALOG__SEARCH__ELASTICSEARCH7_SERVER_PORT=9200
- PHP_SENDMAIL_PATH=/usr/sbin/sendmail -S mailhog:1025
- XDEBUG_CLIENT_PORT=9003
- XDEBUG_CLIENT_HOST=localhost
- XDEBUG_MODE=debug
- CONFIG__DEFAULT__CATALOG__SEARCH__ELASTICSEARCH7_SERVER_HOSTNAME=elasticsearch
- CONFIG__DEFAULT__CATALOG__SEARCH__ENGINE=elasticsearch7
- CONFIG__DEFAULT__CATALOG__SEARCH__ELASTICSEARCH7_SERVER_PORT=9200
- PHP_SENDMAIL_PATH=/usr/sbin/sendmail -S mailhog:1025
- XDEBUG_CLIENT_PORT=9003
- XDEBUG_CLIENT_HOST=localhost
- XDEBUG_MODE=debug
database:
extends:
file: ./compose/base/base.yml
Expand Down Expand Up @@ -65,8 +64,8 @@ services:
networks:
- backend
networks:
frontend:
backend:
frontend: null
backend: null
volumes:
db_data:
es_data:
db_data: null
es_data: null
3 changes: 1 addition & 2 deletions compose/php/7.2/7.2-dolphin.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
version: "3"

services:
magento2:
image: graycore/magento-php:7.2-fpm-alpine-dolphin-v6.0.0-alpha.2
environment:
XDEBUG_REMOTE_PORT: "9002"
XDEBUG_REMOTE_HOST: "localhost"
XDEBUG_REMOTE_HOST: localhost
5 changes: 2 additions & 3 deletions compose/php/7.3/7.3-dolphin.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
version: "3"

services:
magento2:
image: graycore/magento-php:7.3-fpm-alpine-dolphin-v6.0.0-alpha.2
environment:
XDEBUG_CLIENT_PORT: "9003"
XDEBUG_CLIENT_HOST: "localhost"
XDEBUG_MODE: "debug"
XDEBUG_CLIENT_HOST: localhost
XDEBUG_MODE: debug
5 changes: 2 additions & 3 deletions compose/php/7.4/7.4-dolphin.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
version: "3"

services:
magento2:
image: graycore/magento-php:7.4-fpm-alpine-dolphin-v6.0.0-alpha.2
environment:
XDEBUG_CLIENT_PORT: "9003"
XDEBUG_CLIENT_HOST: "localhost"
XDEBUG_MODE: "debug"
XDEBUG_CLIENT_HOST: localhost
XDEBUG_MODE: debug
5 changes: 2 additions & 3 deletions compose/php/8.1/8.1-dolphin.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
version: "3"

services:
magento2:
image: graycore/magento-php:8.1-fpm-alpine-dolphin-v6.0.0-alpha.2
environment:
XDEBUG_CLIENT_PORT: "9003"
XDEBUG_CLIENT_HOST: "localhost"
XDEBUG_MODE: "debug"
XDEBUG_CLIENT_HOST: localhost
XDEBUG_MODE: debug
18 changes: 17 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"homepage": "https://github.com/graycoreio/mage2docker#readme",
"devDependencies": {
"standard-version": "^9.3.1"
"standard-version": "^9.3.1",
"yaml": "^2.1.1"
}
}
32 changes: 32 additions & 0 deletions tools/standard-version/compose-yml.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const yaml = require('yaml');

const semverMatchRegex = /-v(\d*.*)$/;

module.exports.readVersion = function (contents) {
const data = yaml.parse(contents);

for(let key of Object.keys(data.services)) {
if(data.services[key]?.image?.includes("graycore")){
const matchedVersion = data.services[key]?.image.match(semverMatchRegex)[1];
if(matchedVersion){
return matchedVersion;
}
}
}

throw new Error("Unable to find version");
}

module.exports.writeVersion = function (contents, version) {
const data = yaml.parse(contents);

for(let key of Object.keys(data.services)) {
if(data.services[key]?.image?.includes("graycore")){
const matchedVersion = data.services[key]?.image.match(semverMatchRegex)[1];
console.lo
data.services[key].image = data.services[key].image.replace(matchedVersion, version);
}
}

return yaml.stringify(data);
}