Azure Extension script for linux

前端 未结 2 654
野的像风
野的像风 2021-01-22 07:25

I am trying to execute multiple shell scripts by separating each command using \'&&\' using Azure Custom Extension script for Linux.

ARM templates is the deploy

相关标签:
2条回答
  • 2021-01-22 07:39

    ARM template Snippet

    cmdToExecute = script1.sh param1 param2 && script2.sh param1 param2 && script3.sh is passed as a string to a wrapper script like

    "commandToExecute" : "[concat('sh script_executor.sh \"', parameters('cmdToExecute') '\"')]"
    

    script_executor.sh -- takes all commands as parameters and executes each command

    0 讨论(0)
  • 2021-01-22 07:45

    If you have multiple scripts, you can author an entry point script that calls the dependent scripts, then upload the entry point script, dependent scripts and any other dependent binaries to the script location(Azure storage blob or GitHub). You can use following format to ensure multiple files are uploaded: “fileUris” : [“ScriptFileUri1”, “ScriptFileUri2”, "ScriptFileUri3"]

    More information please refer to this link.

    If you want to set script1.sh as the entry point script, you could edit you script such as below:

    ##script in scrpit1.sh
    echo "hello world" 
    ##call script2.sh
    ./script2.sh 
    
    ##call script3.sh
    ./script3.sh
    
    0 讨论(0)
提交回复
热议问题