Hi i am using bitbucket pipelines to deploy code to my website running in an azure linux vm. i have been through this link and its related all sources
https://bitbucket.org/microsoft/azure-vm-linux-script-deploy/src/master/
what i found and is confusing a bit is that it says it downloads and run a script in azure vm connected by secure principal.
My concern is that i have a script present the on linux server i want to run that script by logging in to my linux VM. is it possible that i can do that.
Any little help in this regard will be highly appreciated it a bit confusing point.
THANKS
Your pipeline file will look like this:
image: maven:3.3.9
pipelines:
custom:
default:
- step:
name: trigger script
script: # Modify the commands below to build your repository.
- pipe: microsoft/azure-vm-linux-script-deploy:1.0.1
variables:
AZURE_APP_ID: $AZURE_APP_ID
AZURE_PASSWORD: $AZURE_PASSWORD
AZURE_TENANT_ID: $AZURE_TENANT_ID
AZURE_RESOURCE_GROUP: $AZURE_RESOURCE_GROUP
AZURE_VM_NAME: $AZURE_VM_NAME
AZURE_EXTENSION_COMMAND: './reposcript.sh'
AZURE_EXTENSION_FILES: 'reposcript.sh'
AZURE_FORCE_UPDATE: 'true'
AZURE_NO_WAIT: 'true'
AZURE_CLEANUP: 'true'
DEBUG: 'true'
You can call your script on machine from reposcript.sh
#!/bin/bash
cd /home/mydir
./myscript.sh
echo 'my script is called on vm'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
one small thing which is a concern is it necessary to use the image mentioned? or i can use my working image.
Referring to this line
image: maven:3.3.9
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If script is not executed then set azure_no_wait to false. By doing this your reposcript will wait for your myscript to finish before deleting reposcript from storage container.
In my case, reposcript was gettign deleted from temporary storage account before executing instructions in it. Took a while to figure it out. Hope this helps.
AZURE_NO_WAIT: 'false'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.