jenkinsci / azure-cli-plugin

A Jenkins plugin to use Azure CLI for managing Azure resources.
https://plugins.jenkins.io/azure-cli/
MIT License
5 stars 18 forks source link

pipeline is executed on master #6

Open amkartashov opened 6 years ago

amkartashov commented 6 years ago

Hello,

I have jenkins slave node with az tool installed, but my pipeline is not working until I install az onto master node. Console output states that pipeline is executed on slave, while I clearly see related processes running on master (with ps | grep az).

Jenkins version 2.107.1 Azure CLI version 0.7

torosent commented 6 years ago

Correct. It runs on the master. I can add an option to run on the slave.

amkartashov commented 6 years ago

thanks @torosent ! This would be great.

ghost commented 6 years ago

Hey @torosent I'm hugely interested in this improvement, what's the latest on it? What help is required?

torosent commented 6 years ago

Hi @lengland, I currently don't have the capacity to work on it. It would be great if somebody can pick it up and do a PR.

darkedges commented 5 years ago

@torosent Any quick hints on how to achieve this? Will work on adding this support, but just need some pointers in the right direction.

Current workaround

node(label) {
     stage('Build with azure') {

       container(name: 'azure', shell: '/bin/bash') {

           withCredentials([azureServicePrincipal('azsrvprincipal')]) {
                sh 'az login --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET -t $AZURE_TENANT_ID'
                sh 'az account list-locations'
                sh 'az logout'
            }

           # The following only runs on the master node at present
           # azureCLI commands: [[exportVariablesString: '', script: 'az account list-locations']], principalCredentialId: 'azsrvprincipal'
       }
     }
rnkhouse commented 5 years ago

@torosent Is this being implemented? How can we run azureCLI on the slave machine?