@scandipwa/magento-scripts 2.4.9 → 2.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/cli.js +25 -9
- package/lib/config/docker.js +17 -12
- package/lib/config/magento/required-php-extensions/magento-2.4.js +1 -0
- package/lib/config/php-config.js +2 -1
- package/lib/config/services/composer/versions/composer-1.js +1 -1
- package/lib/config/services/composer/versions/composer-2.9.js +8 -0
- package/lib/config/services/composer/versions/index.js +2 -1
- package/lib/config/services/elasticsearch/versions/elasticsearch-6.8.js +4 -4
- package/lib/config/services/elasticsearch/versions/elasticsearch-7.6.js +2 -1
- package/lib/config/services/nginx/versions/nginx-1.18.js +2 -1
- package/lib/config/services/nginx/versions/nginx-1.22.js +2 -1
- package/lib/config/services/nginx/versions/nginx-1.24.js +2 -1
- package/lib/config/services/nginx/versions/nginx-1.26.js +2 -1
- package/lib/config/services/nginx/versions/nginx-1.28.js +3 -2
- package/lib/config/services/php/versions/php-8.1.js +1 -1
- package/lib/config/services/php/versions/php-8.2.js +1 -1
- package/lib/config/services/php/versions/php-8.3.js +1 -1
- package/lib/config/services/php/versions/php-8.4.js +1 -1
- package/lib/config/services/php/versions/php-8.5.js +32 -0
- package/lib/config/templates/magentorc.template +1 -0
- package/lib/config/templates/nginx.template.conf +1 -1
- package/lib/config/versions/magento-2.4.4-p16.js +1 -1
- package/lib/config/versions/magento-2.4.4-p17.js +41 -0
- package/lib/config/versions/magento-2.4.5-p16.js +41 -0
- package/lib/config/versions/magento-2.4.6-p14.js +41 -0
- package/lib/config/versions/magento-2.4.7-p1.js +2 -2
- package/lib/config/versions/magento-2.4.7-p2.js +2 -2
- package/lib/config/versions/magento-2.4.7-p3.js +2 -2
- package/lib/config/versions/magento-2.4.7-p4.js +2 -2
- package/lib/config/versions/magento-2.4.7-p5.js +2 -2
- package/lib/config/versions/magento-2.4.7-p6.js +2 -2
- package/lib/config/versions/magento-2.4.7-p7.js +2 -2
- package/lib/config/versions/magento-2.4.7-p8.js +2 -2
- package/lib/config/versions/magento-2.4.7-p9.js +41 -0
- package/lib/config/versions/magento-2.4.7.js +2 -2
- package/lib/config/versions/magento-2.4.8-p1.js +2 -2
- package/lib/config/versions/magento-2.4.8-p2.js +2 -2
- package/lib/config/versions/magento-2.4.8-p3.js +2 -3
- package/lib/config/versions/magento-2.4.8-p4.js +43 -0
- package/lib/config/versions/magento-2.4.8.js +2 -2
- package/lib/config/versions/magento-2.4.9-beta1.js +41 -0
- package/lib/tasks/docker/containers/container-api.js +2 -2
- package/lib/tasks/docker/containers/tasks.js +31 -18
- package/lib/tasks/docker/image/image-api.d.ts +12 -0
- package/lib/tasks/docker/image/image-api.js +22 -1
- package/lib/tasks/docker/project-image-builder.js +21 -11
- package/lib/tasks/execute.js +2 -1
- package/lib/tasks/magento/setup-magento/clear-logs.js +31 -0
- package/lib/tasks/magento/setup-magento/disable-2fa.js +13 -0
- package/lib/tasks/magento/setup-magento/set-base-url.js +42 -15
- package/lib/tasks/magento/setup-magento/urn-highlighter.js +84 -2
- package/lib/tasks/requirements/searchengine-version.js +24 -2
- package/lib/tasks/start.js +9 -5
- package/lib/util/config-file-validator.js +15 -7
- package/lib/util/execute-in-container.js +4 -3
- package/lib/util/instance-metadata.js +15 -9
- package/lib/util/open-browser.js +7 -0
- package/lib/util/wait-for-logs.js +27 -6
- package/package.json +2 -2
- package/typings/context.d.ts +4 -2
- package/typings/index.d.ts +22 -0
- package/lib/config/services/elasticsearch/base-repo.js +0 -3
|
@@ -7,7 +7,7 @@ const { sslTerminator } = require('../services/ssl-terminator')
|
|
|
7
7
|
const { varnish76 } = require('../services/varnish')
|
|
8
8
|
const { repo } = require('../services/php/base-repo')
|
|
9
9
|
const { nginx126 } = require('../services/nginx/versions')
|
|
10
|
-
const {
|
|
10
|
+
const { composer29 } = require('../services/composer/versions')
|
|
11
11
|
const { maildev } = require('../services/maildev')
|
|
12
12
|
const { redis72 } = require('../services/redis')
|
|
13
13
|
const { mariadb1011 } = require('../services/mariadb/versions')
|
|
@@ -31,7 +31,7 @@ module.exports = ({ templateDir }) => ({
|
|
|
31
31
|
mysql: mysql80(),
|
|
32
32
|
mariadb: mariadb1011(),
|
|
33
33
|
elasticsearch: elasticsearch817(),
|
|
34
|
-
composer:
|
|
34
|
+
composer: composer29(),
|
|
35
35
|
varnish: varnish76({ templateDir }),
|
|
36
36
|
sslTerminator: sslTerminator({ templateDir }),
|
|
37
37
|
maildev: maildev(),
|
|
@@ -7,7 +7,7 @@ const { sslTerminator } = require('../services/ssl-terminator')
|
|
|
7
7
|
const { varnish76 } = require('../services/varnish')
|
|
8
8
|
const { repo } = require('../services/php/base-repo')
|
|
9
9
|
const { nginx128 } = require('../services/nginx/versions')
|
|
10
|
-
const {
|
|
10
|
+
const { composer29 } = require('../services/composer/versions')
|
|
11
11
|
const { maildev } = require('../services/maildev')
|
|
12
12
|
const { redis72 } = require('../services/redis')
|
|
13
13
|
const { mariadb1011 } = require('../services/mariadb/versions')
|
|
@@ -31,7 +31,7 @@ module.exports = ({ templateDir }) => ({
|
|
|
31
31
|
mysql: mysql80(),
|
|
32
32
|
mariadb: mariadb1011(),
|
|
33
33
|
elasticsearch: elasticsearch817(),
|
|
34
|
-
composer:
|
|
34
|
+
composer: composer29(),
|
|
35
35
|
varnish: varnish76({ templateDir }),
|
|
36
36
|
sslTerminator: sslTerminator({ templateDir }),
|
|
37
37
|
maildev: maildev(),
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const sodium = require('../services/php/extensions/sodium')
|
|
2
|
+
const {
|
|
3
|
+
magento24PHPExtensionList
|
|
4
|
+
} = require('../magento/required-php-extensions')
|
|
5
|
+
const { php82 } = require('../services/php/versions')
|
|
6
|
+
const { sslTerminator } = require('../services/ssl-terminator')
|
|
7
|
+
const { varnish76 } = require('../services/varnish')
|
|
8
|
+
const { repo } = require('../services/php/base-repo')
|
|
9
|
+
const { nginx128 } = require('../services/nginx/versions')
|
|
10
|
+
const { composer29 } = require('../services/composer/versions')
|
|
11
|
+
const { maildev } = require('../services/maildev')
|
|
12
|
+
const { redis72 } = require('../services/redis')
|
|
13
|
+
const { mariadb1011 } = require('../services/mariadb/versions')
|
|
14
|
+
const { elasticsearch817 } = require('../services/elasticsearch/versions')
|
|
15
|
+
const { mysql80 } = require('../services/mysql/versions')
|
|
16
|
+
const { opensearch219 } = require('../services/opensearch/versions')
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @type {import('../../../typings/common').MagentoVersionConfigurationFunction}
|
|
20
|
+
*/
|
|
21
|
+
module.exports = ({ templateDir }) => ({
|
|
22
|
+
magentoVersion: '2.4.7-p9',
|
|
23
|
+
configuration: {
|
|
24
|
+
php: php82({
|
|
25
|
+
templateDir,
|
|
26
|
+
extensions: { ...magento24PHPExtensionList, sodium },
|
|
27
|
+
baseImage: `${repo}:php-8.2-magento-2.4`
|
|
28
|
+
}),
|
|
29
|
+
nginx: nginx128({ templateDir }),
|
|
30
|
+
redis: redis72(),
|
|
31
|
+
mysql: mysql80(),
|
|
32
|
+
mariadb: mariadb1011(),
|
|
33
|
+
elasticsearch: elasticsearch817(),
|
|
34
|
+
composer: composer29(),
|
|
35
|
+
varnish: varnish76({ templateDir }),
|
|
36
|
+
sslTerminator: sslTerminator({ templateDir }),
|
|
37
|
+
maildev: maildev(),
|
|
38
|
+
opensearch: opensearch219(),
|
|
39
|
+
searchengine: 'opensearch'
|
|
40
|
+
}
|
|
41
|
+
})
|
|
@@ -7,7 +7,7 @@ const { sslTerminator } = require('../services/ssl-terminator')
|
|
|
7
7
|
const { varnish74 } = require('../services/varnish')
|
|
8
8
|
const { repo } = require('../services/php/base-repo')
|
|
9
9
|
const { nginx118 } = require('../services/nginx/versions')
|
|
10
|
-
const {
|
|
10
|
+
const { composer29 } = require('../services/composer/versions')
|
|
11
11
|
const { maildev } = require('../services/maildev')
|
|
12
12
|
const { redis72 } = require('../services/redis')
|
|
13
13
|
const { mariadb106 } = require('../services/mariadb/versions')
|
|
@@ -31,7 +31,7 @@ module.exports = ({ templateDir }) => ({
|
|
|
31
31
|
mysql: mysql80(),
|
|
32
32
|
mariadb: mariadb106(),
|
|
33
33
|
elasticsearch: elasticsearch811(),
|
|
34
|
-
composer:
|
|
34
|
+
composer: composer29(),
|
|
35
35
|
varnish: varnish74({ templateDir }),
|
|
36
36
|
sslTerminator: sslTerminator({ templateDir }),
|
|
37
37
|
maildev: maildev(),
|
|
@@ -8,7 +8,7 @@ const { sslTerminator } = require('../services/ssl-terminator')
|
|
|
8
8
|
const { varnish76 } = require('../services/varnish')
|
|
9
9
|
const { repo } = require('../services/php/base-repo')
|
|
10
10
|
const { nginx126 } = require('../services/nginx/versions')
|
|
11
|
-
const {
|
|
11
|
+
const { composer29 } = require('../services/composer/versions')
|
|
12
12
|
const { maildev } = require('../services/maildev')
|
|
13
13
|
const { valkey80 } = require('../services/redis')
|
|
14
14
|
const { mariadb114 } = require('../services/mariadb/versions')
|
|
@@ -32,7 +32,7 @@ module.exports = ({ templateDir }) => ({
|
|
|
32
32
|
mysql: mysql80(),
|
|
33
33
|
mariadb: mariadb114(),
|
|
34
34
|
elasticsearch: elasticsearch817(),
|
|
35
|
-
composer:
|
|
35
|
+
composer: composer29(),
|
|
36
36
|
varnish: varnish76({ templateDir }),
|
|
37
37
|
sslTerminator: sslTerminator({ templateDir }),
|
|
38
38
|
maildev: maildev(),
|
|
@@ -8,7 +8,7 @@ const { sslTerminator } = require('../services/ssl-terminator')
|
|
|
8
8
|
const { varnish76 } = require('../services/varnish')
|
|
9
9
|
const { repo } = require('../services/php/base-repo')
|
|
10
10
|
const { nginx126 } = require('../services/nginx/versions')
|
|
11
|
-
const {
|
|
11
|
+
const { composer29 } = require('../services/composer/versions')
|
|
12
12
|
const { maildev } = require('../services/maildev')
|
|
13
13
|
const { valkey80 } = require('../services/redis')
|
|
14
14
|
const { mariadb114 } = require('../services/mariadb/versions')
|
|
@@ -32,7 +32,7 @@ module.exports = ({ templateDir }) => ({
|
|
|
32
32
|
mysql: mysql80(),
|
|
33
33
|
mariadb: mariadb114(),
|
|
34
34
|
elasticsearch: elasticsearch817(),
|
|
35
|
-
composer:
|
|
35
|
+
composer: composer29(),
|
|
36
36
|
varnish: varnish76({ templateDir }),
|
|
37
37
|
sslTerminator: sslTerminator({ templateDir }),
|
|
38
38
|
maildev: maildev(),
|
|
@@ -8,7 +8,7 @@ const { sslTerminator } = require('../services/ssl-terminator')
|
|
|
8
8
|
const { varnish76 } = require('../services/varnish')
|
|
9
9
|
const { repo } = require('../services/php/base-repo')
|
|
10
10
|
const { nginx128 } = require('../services/nginx/versions')
|
|
11
|
-
const {
|
|
11
|
+
const { composer29 } = require('../services/composer/versions')
|
|
12
12
|
const { maildev } = require('../services/maildev')
|
|
13
13
|
const { valkey80 } = require('../services/redis')
|
|
14
14
|
const { mariadb114 } = require('../services/mariadb/versions')
|
|
@@ -21,7 +21,6 @@ const { opensearch300 } = require('../services/opensearch/versions')
|
|
|
21
21
|
*/
|
|
22
22
|
module.exports = ({ templateDir }) => ({
|
|
23
23
|
magentoVersion: '2.4.8-p3',
|
|
24
|
-
isDefault: true,
|
|
25
24
|
configuration: {
|
|
26
25
|
php: php83({
|
|
27
26
|
templateDir,
|
|
@@ -33,7 +32,7 @@ module.exports = ({ templateDir }) => ({
|
|
|
33
32
|
mysql: mysql80(),
|
|
34
33
|
mariadb: mariadb114(),
|
|
35
34
|
elasticsearch: elasticsearch817(),
|
|
36
|
-
composer:
|
|
35
|
+
composer: composer29(),
|
|
37
36
|
varnish: varnish76({ templateDir }),
|
|
38
37
|
sslTerminator: sslTerminator({ templateDir }),
|
|
39
38
|
maildev: maildev(),
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const sodium = require('../services/php/extensions/sodium')
|
|
2
|
+
const ftp = require('../services/php/extensions/ftp')
|
|
3
|
+
const {
|
|
4
|
+
magento24PHPExtensionList
|
|
5
|
+
} = require('../magento/required-php-extensions')
|
|
6
|
+
const { php83 } = require('../services/php/versions')
|
|
7
|
+
const { sslTerminator } = require('../services/ssl-terminator')
|
|
8
|
+
const { varnish76 } = require('../services/varnish')
|
|
9
|
+
const { repo } = require('../services/php/base-repo')
|
|
10
|
+
const { nginx128 } = require('../services/nginx/versions')
|
|
11
|
+
const { composer29 } = require('../services/composer/versions')
|
|
12
|
+
const { maildev } = require('../services/maildev')
|
|
13
|
+
const { valkey80 } = require('../services/redis')
|
|
14
|
+
const { mariadb114 } = require('../services/mariadb/versions')
|
|
15
|
+
const { elasticsearch817 } = require('../services/elasticsearch/versions')
|
|
16
|
+
const { mysql80 } = require('../services/mysql/versions')
|
|
17
|
+
const { opensearch300 } = require('../services/opensearch/versions')
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @type {import('../../../typings/common').MagentoVersionConfigurationFunction}
|
|
21
|
+
*/
|
|
22
|
+
module.exports = ({ templateDir }) => ({
|
|
23
|
+
magentoVersion: '2.4.8-p4',
|
|
24
|
+
isDefault: true,
|
|
25
|
+
configuration: {
|
|
26
|
+
php: php83({
|
|
27
|
+
templateDir,
|
|
28
|
+
extensions: { ...magento24PHPExtensionList, sodium, ftp },
|
|
29
|
+
baseImage: `${repo}:php-8.3-magento-2.4`
|
|
30
|
+
}),
|
|
31
|
+
nginx: nginx128({ templateDir }),
|
|
32
|
+
redis: valkey80(),
|
|
33
|
+
mysql: mysql80(),
|
|
34
|
+
mariadb: mariadb114(),
|
|
35
|
+
elasticsearch: elasticsearch817(),
|
|
36
|
+
composer: composer29(),
|
|
37
|
+
varnish: varnish76({ templateDir }),
|
|
38
|
+
sslTerminator: sslTerminator({ templateDir }),
|
|
39
|
+
maildev: maildev(),
|
|
40
|
+
opensearch: opensearch300(),
|
|
41
|
+
searchengine: 'opensearch'
|
|
42
|
+
}
|
|
43
|
+
})
|
|
@@ -8,7 +8,7 @@ const { sslTerminator } = require('../services/ssl-terminator')
|
|
|
8
8
|
const { varnish76 } = require('../services/varnish')
|
|
9
9
|
const { repo } = require('../services/php/base-repo')
|
|
10
10
|
const { nginx126 } = require('../services/nginx/versions')
|
|
11
|
-
const {
|
|
11
|
+
const { composer29 } = require('../services/composer/versions')
|
|
12
12
|
const { maildev } = require('../services/maildev')
|
|
13
13
|
const { valkey80 } = require('../services/redis')
|
|
14
14
|
const { mariadb114 } = require('../services/mariadb/versions')
|
|
@@ -32,7 +32,7 @@ module.exports = ({ templateDir }) => ({
|
|
|
32
32
|
mysql: mysql80(),
|
|
33
33
|
mariadb: mariadb114(),
|
|
34
34
|
elasticsearch: elasticsearch817(),
|
|
35
|
-
composer:
|
|
35
|
+
composer: composer29(),
|
|
36
36
|
varnish: varnish76({ templateDir }),
|
|
37
37
|
sslTerminator: sslTerminator({ templateDir }),
|
|
38
38
|
maildev: maildev(),
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const sodium = require('../services/php/extensions/sodium')
|
|
2
|
+
const {
|
|
3
|
+
magento24PHPExtensionList
|
|
4
|
+
} = require('../magento/required-php-extensions')
|
|
5
|
+
const { php84 } = require('../services/php/versions')
|
|
6
|
+
const { sslTerminator } = require('../services/ssl-terminator')
|
|
7
|
+
const { varnish77 } = require('../services/varnish')
|
|
8
|
+
const { repo } = require('../services/php/base-repo')
|
|
9
|
+
const { nginx126 } = require('../services/nginx/versions')
|
|
10
|
+
const { composer29 } = require('../services/composer/versions')
|
|
11
|
+
const { maildev } = require('../services/maildev')
|
|
12
|
+
const { valkey80 } = require('../services/redis')
|
|
13
|
+
const { mariadb114 } = require('../services/mariadb/versions')
|
|
14
|
+
const { elasticsearch87 } = require('../services/elasticsearch/versions')
|
|
15
|
+
const { mysql84 } = require('../services/mysql/versions')
|
|
16
|
+
const { opensearch300 } = require('../services/opensearch/versions')
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @type {import('../../../typings/common').MagentoVersionConfigurationFunction}
|
|
20
|
+
*/
|
|
21
|
+
module.exports = ({ templateDir }) => ({
|
|
22
|
+
magentoVersion: '2.4.9-beta1',
|
|
23
|
+
configuration: {
|
|
24
|
+
php: php84({
|
|
25
|
+
templateDir,
|
|
26
|
+
extensions: { ...magento24PHPExtensionList, sodium },
|
|
27
|
+
baseImage: `${repo}:php-8.4-magento-2.4`
|
|
28
|
+
}),
|
|
29
|
+
nginx: nginx126({ templateDir }),
|
|
30
|
+
redis: valkey80(),
|
|
31
|
+
mysql: mysql84(),
|
|
32
|
+
mariadb: mariadb114(),
|
|
33
|
+
elasticsearch: elasticsearch87(),
|
|
34
|
+
composer: composer29(),
|
|
35
|
+
varnish: varnish77({ templateDir }),
|
|
36
|
+
sslTerminator: sslTerminator({ templateDir }),
|
|
37
|
+
maildev: maildev(),
|
|
38
|
+
opensearch: opensearch300(),
|
|
39
|
+
searchengine: 'opensearch'
|
|
40
|
+
}
|
|
41
|
+
})
|
|
@@ -16,9 +16,9 @@ const transformEnvValue = (value) => {
|
|
|
16
16
|
|
|
17
17
|
for (const [key, val] of Object.entries(value)) {
|
|
18
18
|
if (typeof val === 'string' && val) {
|
|
19
|
-
envArguments.push(`--env
|
|
19
|
+
envArguments.push(`--env=${key}='${val.replaceAll("'", "\\'")}'`)
|
|
20
20
|
} else if (String(val)) {
|
|
21
|
-
envArguments.push(`--env
|
|
21
|
+
envArguments.push(`--env=${key}=${val}`)
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -16,23 +16,28 @@ const stopAndRemoveContainers = async (containers) => {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* @param {string}
|
|
20
|
-
|
|
21
|
-
const pull = async (image) => execAsyncSpawn(`docker pull ${image}`)
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @param {string[]} acc
|
|
25
|
-
* @param {{ remoteImages?: string[], image: string }} val
|
|
19
|
+
* @param {{ image: string, platform?: string }[]} acc
|
|
20
|
+
* @param {{ remoteImages?: string[], image: string, platform?: string }} val
|
|
26
21
|
*/
|
|
27
22
|
const remoteImageReducer = (acc, val) => {
|
|
28
23
|
if (
|
|
29
24
|
Array.isArray(val.remoteImages) &&
|
|
30
25
|
val.remoteImages.every((image) => typeof image === 'string')
|
|
31
26
|
) {
|
|
32
|
-
return acc.concat(
|
|
27
|
+
return acc.concat(
|
|
28
|
+
val.remoteImages.map((image) => ({
|
|
29
|
+
image,
|
|
30
|
+
platform: val.platform
|
|
31
|
+
}))
|
|
32
|
+
)
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
return acc.concat([
|
|
35
|
+
return acc.concat([
|
|
36
|
+
{
|
|
37
|
+
image: val.image,
|
|
38
|
+
platform: val.platform
|
|
39
|
+
}
|
|
40
|
+
])
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
/**
|
|
@@ -59,10 +64,10 @@ const pullImages = () => ({
|
|
|
59
64
|
containers
|
|
60
65
|
.filter(filterNonPullableImages)
|
|
61
66
|
.reduce(remoteImageReducer, [])
|
|
62
|
-
.map((image) => {
|
|
67
|
+
.map(({ image, platform }) => {
|
|
63
68
|
const [repo, tag = 'latest'] = image.split(':')
|
|
64
69
|
|
|
65
|
-
return { repo, tag }
|
|
70
|
+
return { repo, tag, platform }
|
|
66
71
|
})
|
|
67
72
|
.reduce(
|
|
68
73
|
(acc, val) =>
|
|
@@ -76,11 +81,15 @@ const pullImages = () => ({
|
|
|
76
81
|
),
|
|
77
82
|
[]
|
|
78
83
|
)
|
|
79
|
-
.map(({ repo, tag }) => ({
|
|
84
|
+
.map(({ repo, tag, platform }) => ({
|
|
80
85
|
title: `Pulling ${logger.style.file(
|
|
81
86
|
`${repo}:${tag}`
|
|
82
87
|
)} image`,
|
|
83
|
-
task: () =>
|
|
88
|
+
task: () =>
|
|
89
|
+
imageApi.pull({
|
|
90
|
+
image: `${repo}:${tag}`,
|
|
91
|
+
platform
|
|
92
|
+
})
|
|
84
93
|
})),
|
|
85
94
|
{
|
|
86
95
|
concurrent: true,
|
|
@@ -92,7 +101,7 @@ const pullImages = () => ({
|
|
|
92
101
|
const imagesFilter = containers
|
|
93
102
|
.filter(filterNonPullableImages)
|
|
94
103
|
.reduce(remoteImageReducer, [])
|
|
95
|
-
.map((image) => `reference='${image}'`)
|
|
104
|
+
.map(({ image }) => `reference='${image}'`)
|
|
96
105
|
|
|
97
106
|
const existingImages = await imageApi.ls({
|
|
98
107
|
formatToJSON: true,
|
|
@@ -102,10 +111,10 @@ const pullImages = () => ({
|
|
|
102
111
|
const missingContainerImages = containers
|
|
103
112
|
.filter(filterNonPullableImages)
|
|
104
113
|
.reduce(remoteImageReducer, [])
|
|
105
|
-
.map((image) => {
|
|
114
|
+
.map(({ image, platform }) => {
|
|
106
115
|
const [repo, tag = 'latest'] = image.split(':')
|
|
107
116
|
|
|
108
|
-
return { repo, tag }
|
|
117
|
+
return { repo, tag, platform }
|
|
109
118
|
})
|
|
110
119
|
.filter(
|
|
111
120
|
({ repo, tag }) =>
|
|
@@ -132,9 +141,13 @@ const pullImages = () => ({
|
|
|
132
141
|
}
|
|
133
142
|
|
|
134
143
|
return task.newListr(
|
|
135
|
-
missingContainerImages.map(({ repo, tag }) => ({
|
|
144
|
+
missingContainerImages.map(({ repo, tag, platform }) => ({
|
|
136
145
|
title: `Pulling ${logger.style.file(`${repo}:${tag}`)} image`,
|
|
137
|
-
task: () =>
|
|
146
|
+
task: () =>
|
|
147
|
+
imageApi.pull({
|
|
148
|
+
image: `${repo}:${tag}`,
|
|
149
|
+
platform
|
|
150
|
+
})
|
|
138
151
|
})),
|
|
139
152
|
{
|
|
140
153
|
concurrent: true,
|
|
@@ -75,3 +75,15 @@ export function inspect(
|
|
|
75
75
|
options?: ImagesInspectOptions<true>,
|
|
76
76
|
execOptions?: ExecAsyncSpawnOptions<false>
|
|
77
77
|
): Promise<ImagesInspectResult>
|
|
78
|
+
|
|
79
|
+
export interface ImagesPullOptions {
|
|
80
|
+
image: string
|
|
81
|
+
allTags?: boolean
|
|
82
|
+
platform?: string
|
|
83
|
+
quiet?: boolean
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function pull(
|
|
87
|
+
options?: ImagesPullOptions,
|
|
88
|
+
execOptions?: ExecAsyncSpawnOptions<false>
|
|
89
|
+
): Promise<string>
|
|
@@ -78,7 +78,28 @@ const inspect = async (options, execOptions = {}) => {
|
|
|
78
78
|
return execAsyncSpawn(`docker image inspect ${args}`, execOptions)
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* @param {import('./image-api').ImagesPullOptions} options
|
|
83
|
+
* @param {import('../../../util/exec-async-command').ExecAsyncSpawnOptions} execOptions
|
|
84
|
+
*/
|
|
85
|
+
const pull = async (options, execOptions = {}) => {
|
|
86
|
+
const { image, allTags, platform, quiet } = options
|
|
87
|
+
|
|
88
|
+
const allTagsArg = typeof allTags === 'boolean' ? '--all-tags' : ''
|
|
89
|
+
const platformArg =
|
|
90
|
+
typeof platform === 'string' ? `--platform=${platform}` : ''
|
|
91
|
+
|
|
92
|
+
const quietArg = typeof quiet === 'boolean' ? '--quiet' : ''
|
|
93
|
+
|
|
94
|
+
const args = [allTagsArg, platformArg, quietArg, image]
|
|
95
|
+
.filter(Boolean)
|
|
96
|
+
.join(' ')
|
|
97
|
+
|
|
98
|
+
return execAsyncSpawn(`docker image pull ${args}`, execOptions)
|
|
99
|
+
}
|
|
100
|
+
|
|
81
101
|
module.exports = {
|
|
82
102
|
ls,
|
|
83
|
-
inspect
|
|
103
|
+
inspect,
|
|
104
|
+
pull
|
|
84
105
|
}
|
|
@@ -302,17 +302,25 @@ const buildDebugDockerFileInstructions = async (ctx, { image, tag }) => {
|
|
|
302
302
|
* @returns {import('listr2').ListrTask<import('../../../typings/context').ListrContext>}
|
|
303
303
|
*/
|
|
304
304
|
const buildProjectImage = () => ({
|
|
305
|
-
title:
|
|
306
|
-
? 'Building Project Images (for x86)'
|
|
307
|
-
: 'Building Project Images',
|
|
305
|
+
title: 'Building Project Images',
|
|
308
306
|
task: async (ctx, task) => {
|
|
309
307
|
const containers = ctx.config.docker.getContainers(ctx.ports)
|
|
308
|
+
const isUsingLinuxAmd64Platform =
|
|
309
|
+
rosettaTranslatedContainers.includes('php') ||
|
|
310
|
+
containers.php.platform === 'linux/amd64'
|
|
311
|
+
|
|
312
|
+
if (isUsingLinuxAmd64Platform) {
|
|
313
|
+
task.title = 'Building Project Images (for x86)'
|
|
314
|
+
} else if (
|
|
315
|
+
containers.php.platform &&
|
|
316
|
+
containers.php.platform !== 'linux/amd64'
|
|
317
|
+
) {
|
|
318
|
+
task.title = `Building Project Images (for ${containers.php.platform})`
|
|
319
|
+
}
|
|
310
320
|
|
|
311
321
|
return task.newListr([
|
|
312
322
|
{
|
|
313
|
-
title:
|
|
314
|
-
? 'Building PHP image (for x86)'
|
|
315
|
-
: 'Building PHP image',
|
|
323
|
+
title: 'Building PHP image',
|
|
316
324
|
task: async () => {
|
|
317
325
|
const [image, tag = 'latest'] =
|
|
318
326
|
ctx.config.overridenConfiguration.configuration.php.baseImage.split(
|
|
@@ -328,8 +336,10 @@ const buildProjectImage = () => ({
|
|
|
328
336
|
try {
|
|
329
337
|
await execAsyncSpawn(
|
|
330
338
|
`docker build -t ${containers.php.image}${
|
|
331
|
-
|
|
339
|
+
isUsingLinuxAmd64Platform
|
|
332
340
|
? ' --platform linux/amd64'
|
|
341
|
+
: containers.php.platform
|
|
342
|
+
? ` --platform ${containers.php.platform}`
|
|
333
343
|
: ''
|
|
334
344
|
} -<<EOF
|
|
335
345
|
${dockerFileInstructions}
|
|
@@ -350,9 +360,7 @@ EOF`,
|
|
|
350
360
|
}
|
|
351
361
|
},
|
|
352
362
|
{
|
|
353
|
-
title:
|
|
354
|
-
? 'Building PHP with XDebug image (for x86)'
|
|
355
|
-
: 'Building PHP with XDebug image',
|
|
363
|
+
title: 'Building PHP with XDebug image',
|
|
356
364
|
task: async () => {
|
|
357
365
|
const [phpImage, phpTag] = containers.php.image.split(':')
|
|
358
366
|
const debugImageInstructions =
|
|
@@ -364,8 +372,10 @@ EOF`,
|
|
|
364
372
|
try {
|
|
365
373
|
await execAsyncSpawn(
|
|
366
374
|
`docker build -t ${containers.phpWithXdebug.image}${
|
|
367
|
-
|
|
375
|
+
isUsingLinuxAmd64Platform
|
|
368
376
|
? ' --platform linux/amd64'
|
|
377
|
+
: containers.php.platform
|
|
378
|
+
? ` --platform ${containers.php.platform}`
|
|
369
379
|
: ''
|
|
370
380
|
} -<<EOF
|
|
371
381
|
${debugImageInstructions}
|
package/lib/tasks/execute.js
CHANGED
|
@@ -101,7 +101,8 @@ const executeTask = async (argv) => {
|
|
|
101
101
|
const result = executeInContainer({
|
|
102
102
|
containerName: container.name,
|
|
103
103
|
commands: argv.commands,
|
|
104
|
-
user: container.user
|
|
104
|
+
user: container.user,
|
|
105
|
+
env: container.execCommandEnv
|
|
105
106
|
})
|
|
106
107
|
|
|
107
108
|
return result
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const fs = require('fs')
|
|
2
|
+
const path = require('path')
|
|
3
|
+
const pathExists = require('../../../util/path-exists')
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @returns {import('listr2').ListrTask<import('../../../../typings/context').ListrContext>}
|
|
7
|
+
*/
|
|
8
|
+
const clearLogs = () => ({
|
|
9
|
+
title: 'Clearing Magento logs',
|
|
10
|
+
task: async (ctx, task) => {
|
|
11
|
+
let deletedLogsCount = 0
|
|
12
|
+
await Promise.all(
|
|
13
|
+
[
|
|
14
|
+
'./var/log/system.log',
|
|
15
|
+
'./var/log/debug.log',
|
|
16
|
+
'./var/log/xdebug.log'
|
|
17
|
+
].map(async (logPath) => {
|
|
18
|
+
if (await pathExists(path.join(process.cwd(), logPath))) {
|
|
19
|
+
await fs.promises.rm(path.join(process.cwd(), logPath))
|
|
20
|
+
deletedLogsCount++
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
if (deletedLogsCount === 0) {
|
|
26
|
+
task.skip()
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
module.exports = clearLogs
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const configPhpToJson = require('../../../util/config-php-json')
|
|
2
2
|
const getJsonfileData = require('../../../util/get-jsonfile-data')
|
|
3
3
|
const path = require('path')
|
|
4
|
+
const semver = require('semver')
|
|
4
5
|
const composerTask = require('../../../util/composer-task')
|
|
5
6
|
const magentoTask = require('../../../util/magento-task')
|
|
6
7
|
|
|
@@ -9,6 +10,18 @@ const magentoTask = require('../../../util/magento-task')
|
|
|
9
10
|
*/
|
|
10
11
|
module.exports = () => ({
|
|
11
12
|
title: 'Disabling 2FA module',
|
|
13
|
+
// this module is only for magento 2.4 or newer
|
|
14
|
+
skip: (ctx) => {
|
|
15
|
+
const { magentoVersion } = ctx
|
|
16
|
+
|
|
17
|
+
const pureMagentoVersion = magentoVersion.match(
|
|
18
|
+
/^([0-9]+\.[0-9]+\.[0-9]+)/
|
|
19
|
+
)[1]
|
|
20
|
+
|
|
21
|
+
const isMagento24 = semver.satisfies(pureMagentoVersion, '>=2.4.0')
|
|
22
|
+
|
|
23
|
+
return !isMagento24
|
|
24
|
+
},
|
|
12
25
|
task: async (ctx, task) => {
|
|
13
26
|
// Check if MarkShust module is already installed via composer.lock
|
|
14
27
|
const composerLockPath = path.join(
|