post-install-cmd 在 Google App Engine 柔性环境中不起作用

问题描述

我正在尝试通过 Composer 的 post-install-cmd 更新文件权限,但在我看来它没有正常工作虽然在日志中它说命令执行正确但是当我登录到 VM 时它仍然显示不正确许可。

这就是我在/composer.json

"scripts": {
    "post-root-package-install": [
        "@php -r \"file_exists('.env') || copy('.env.example','.env');\""
    ],"post-install-cmd": [
        "chmod -R 777 public\/external_package\/webmail\/data"
    ]
}

这就是我的 /app.yaml

runtime: php
env: flex

service: webservice-dev

runtime_config:
  document_root: public
  whitelist_functions: phpversion,phpinfo

env_variables:
  # Environment variables.
  APP_NAME: 'Laravel App (Dev)'
  APP_ENV: dev
  # ...
  # ...

beta_settings:
  cloud_sql_instances: ""

automatic_scaling:
  min_num_instances: 2
  max_num_instances: 10
  cpu_utilization:
    target_utilization: 0.50

resources:
  cpu: 1
  memory_gb: 4

这是 Cloud Build 的屏幕截图

gcp file permission issue

这就是我在虚拟机中看到的

dr-xr-x--- 1 root www-data  4096 Jan 28 19:18 data

我希望此目录权限为 777 而不是 550

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)