Skip to content

Commit 9857d17

Browse files
MCLOUD-3766: Ability to disable Elasticsearch and use MySQL instead f… (#182)
1 parent be14a3d commit 9857d17

File tree

39 files changed

+813
-238
lines changed

39 files changed

+813
-238
lines changed

.github/ISSUE_TEMPLATE.md renamed to .github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
---
2+
name: Bug report
3+
about: Technical issue with the Magento ECE-Tools
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
19
<!---
210
Thank you for contributing to Magento.
311
To help us process this issue we recommend that you add the following information:
@@ -33,3 +41,4 @@
3341
### Actual result
3442
<!--- Tell us what happens instead -->
3543
1. [Screenshots, logs or description]
44+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
12+
**Describe the solution you'd like**
13+
A clear and concise description of what you want to happen.
14+
15+
**Describe alternatives you've considered**
16+
A clear and concise description of any alternative solutions or features you've considered.
17+
18+
**Additional context**
19+
Add any other context or screenshots about the feature request here.

bin/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
dev-ece-docker
1+
/dev-*

config/services.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<service id="Magento\CloudDocker\Compose\ProductionBuilder" shared="false"/>
2727
<service id="Magento\CloudDocker\Config\Config" autowire="false"/>
2828
<service id="Magento\CloudDocker\Config\Source\CliSource" autowire="false"/>
29+
<service id="Magento\CloudDocker\Config\Source\CustomSource" autowire="false"/>
2930
<service id="Composer\Semver\VersionParser"/>
3031
<service id="Composer\Semver\Semver"/>
3132
</services>

images/php/7.1-cli/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ RUN ["chmod", "+x", \
214214

215215
RUN mkdir -p ${MAGENTO_ROOT}
216216

217-
VOLUME /root/.composer/cache
218217
VOLUME ${MAGENTO_ROOT}
219218

220219
ENTRYPOINT ["/docker-entrypoint.sh"]

images/php/7.1-cli/bin/run-hooks

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env python3
22

3-
import yaml
43
import os
54
import sys
65
import subprocess
7-
from os import path
6+
import json
7+
import base64
88

99
# Disable output buffering.
1010
os.environ['PYTHONUNBUFFERED'] = "1"
@@ -29,19 +29,13 @@ def get_magento_root():
2929

3030
# Gets set hooks by hook name.
3131
def get_hooks(hook_name):
32-
config = get_magento_root() + "/.magento.docker.yaml"
33-
34-
if path.exists(get_magento_root() + "/.magento.app.yaml"):
35-
config = get_magento_root() + "/.magento.app.yaml"
36-
37-
with open(config, 'r') as stream:
38-
try:
39-
content = yaml.safe_load(stream)
40-
return content["hooks"][hook_name]
41-
except yaml.YAMLError as exc:
42-
error_exit(exc)
43-
except KeyError:
44-
error_exit("The hook \"" + hook_name + "\" is not in the \"" + config + "\" file. Skipped", 0)
32+
try:
33+
application = str(os.environ['MAGENTO_CLOUD_APPLICATION'])
34+
content = json.loads(base64.b64decode(application).decode("utf-8"))
35+
36+
return content['hooks'][hook_name]
37+
except Exception as exc:
38+
error_exit("Cannot decode string: " + str(exc))
4539

4640

4741
# Main function.

images/php/7.1-fpm/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ RUN ["chmod", "+x", "/docker-entrypoint.sh"]
177177

178178
RUN mkdir -p ${MAGENTO_ROOT}
179179

180-
VOLUME /root/.composer/cache
181180
VOLUME ${MAGENTO_ROOT}
182181

183182
ENTRYPOINT ["/docker-entrypoint.sh"]

images/php/7.2-cli/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ RUN ["chmod", "+x", \
214214

215215
RUN mkdir -p ${MAGENTO_ROOT}
216216

217-
VOLUME /root/.composer/cache
218217
VOLUME ${MAGENTO_ROOT}
219218

220219
ENTRYPOINT ["/docker-entrypoint.sh"]

images/php/7.2-cli/bin/run-hooks

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env python3
22

3-
import yaml
43
import os
54
import sys
65
import subprocess
7-
from os import path
6+
import json
7+
import base64
88

99
# Disable output buffering.
1010
os.environ['PYTHONUNBUFFERED'] = "1"
@@ -29,19 +29,13 @@ def get_magento_root():
2929

3030
# Gets set hooks by hook name.
3131
def get_hooks(hook_name):
32-
config = get_magento_root() + "/.magento.docker.yaml"
33-
34-
if path.exists(get_magento_root() + "/.magento.app.yaml"):
35-
config = get_magento_root() + "/.magento.app.yaml"
36-
37-
with open(config, 'r') as stream:
38-
try:
39-
content = yaml.safe_load(stream)
40-
return content["hooks"][hook_name]
41-
except yaml.YAMLError as exc:
42-
error_exit(exc)
43-
except KeyError:
44-
error_exit("The hook \"" + hook_name + "\" is not in the \"" + config + "\" file. Skipped", 0)
32+
try:
33+
application = str(os.environ['MAGENTO_CLOUD_APPLICATION'])
34+
content = json.loads(base64.b64decode(application).decode("utf-8"))
35+
36+
return content['hooks'][hook_name]
37+
except Exception as exc:
38+
error_exit("Cannot decode string: " + str(exc))
4539

4640

4741
# Main function.

images/php/7.2-fpm/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ RUN ["chmod", "+x", "/docker-entrypoint.sh"]
177177

178178
RUN mkdir -p ${MAGENTO_ROOT}
179179

180-
VOLUME /root/.composer/cache
181180
VOLUME ${MAGENTO_ROOT}
182181

183182
ENTRYPOINT ["/docker-entrypoint.sh"]

0 commit comments

Comments
 (0)