如何在Packer中加载常见的bash脚本

时间:2018-12-16 13:33:29

标签: packer

如何为配置者加载另一个常见脚本,例如 . scripts/common/import.sh

  "provisioners": [
    {
      "type": "shell",
      "script": "scripts/scr.sh",
    }
  ],

1 个答案:

答案 0 :(得分:1)

使用file将通用脚本上传到/tmp/common.sh

"provisioners": [
  {
    "type": "file",
    "source": "scripts/common.sh",
    "destination": "/tmp/common.sh"
  }
  {
    "type": "shell",
    "script": "scripts/scr.sh"
  }
],

编辑:更新了答案以实际回答问题。

相关问题