如何在加壳器中加载常见的 bash 脚本
How to load common bash scripts in packer
如何为供应商加载另一个通用脚本,例如
. scripts/common/import.sh
"provisioners": [
{
"type": "shell",
"script": "scripts/scr.sh",
}
],
使用file
上传常用脚本到/tmp/common.sh
:
"provisioners": [
{
"type": "file",
"source": "scripts/common.sh",
"destination": "/tmp/common.sh"
}
{
"type": "shell",
"script": "scripts/scr.sh"
}
],
编辑:更新了实际回答问题的答案。
如何为供应商加载另一个通用脚本,例如
. scripts/common/import.sh
"provisioners": [
{
"type": "shell",
"script": "scripts/scr.sh",
}
],
使用file
上传常用脚本到/tmp/common.sh
:
"provisioners": [
{
"type": "file",
"source": "scripts/common.sh",
"destination": "/tmp/common.sh"
}
{
"type": "shell",
"script": "scripts/scr.sh"
}
],
编辑:更新了实际回答问题的答案。