2
0
Эх сурвалжийг харах

Get npm install to run correctly on ARM64 chips #569

Mark Shust 2 жил өмнө
parent
commit
dbd31647b0

+ 20 - 3
compose/bin/setup-grunt

@@ -33,9 +33,26 @@ else
     bin/node -e "$GEN_THEME_JS"
 fi
 
-bin/clinotty cp package.json.sample package.json
-bin/clinotty cp Gruntfile.js.sample Gruntfile.js
-bin/clinotty cp grunt-config.json.sample grunt-config.json
+# Create files from sample files if they do not yet exist
+test -f src/package.json || cp src/package.json.sample src/package.json
+test -f src/Gruntfile.js || cp src/Gruntfile.js.sample src/Gruntfile.js
+test -f src/grunt-config.json || cp src/grunt-config.json.sample src/grunt-config.json
+
+# Disable grunt-contrib-jasmine on ARM processors (incompatible)
+if [ "$(uname -m)" == "arm64" ]; then
+    sed -e 's/"grunt-contrib-jasmine": "[~.0-9]*",//' src/package.json > package.json \
+      && mv package.json src/package.json
+fi
+
+# Enable these custom files on docker-compose.dev.yml so custom updates are persisted
+sed -e 's/grunt-config.json.sample/grunt-config.json/' docker-compose.dev.yml > docker-compose.dev.yml.updated \
+ && mv docker-compose.dev.yml.updated docker-compose.dev.yml
+sed -e 's/Gruntfile.js.sample/Gruntfile.js/' docker-compose.dev.yml > docker-compose.dev.yml.updated \
+ && mv docker-compose.dev.yml.updated docker-compose.dev.yml
+sed -e 's/package.json.sample/package.json/' docker-compose.dev.yml > docker-compose.dev.yml.updated \
+ && mv docker-compose.dev.yml.updated docker-compose.dev.yml
+bin/restart app phpfpm
+
 bin/npm install ajv@^5.0.0 --save
 bin/npm install
 bin/magento cache:clean

+ 3 - 0
compose/docker-compose.dev.yml

@@ -9,7 +9,10 @@ services:
       - ./src/app/etc:/var/www/html/app/etc:cached
       - ./src/composer.json:/var/www/html/composer.json:cached
       - ./src/composer.lock:/var/www/html/composer.lock:cached
+      - ./src/grunt-config.json.sample:/var/www/html/grunt-config.json:cached
+      - ./src/Gruntfile.js.sample:/var/www/html/Gruntfile.js:cached
       - ./src/nginx.conf.sample:/var/www/html/nginx.conf:cached
+      - ./src/package.json.sample:/var/www/html/package.json:cached
       #- ./src/auth.json:/var/www/html/auth.json:cached
       #- ./src/m2-hotfixes:/var/www/html/m2-hotfixes:cached
       #- ./src/patches:/var/www/html/patches:cached