Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pick directory Paths based on Build Agent Name in AzureDevops task #684

Open
vivuu1989 opened this issue Sep 24, 2023 · 2 comments
Open

Comments

@vivuu1989
Copy link

We have a requirement in Azuredevops task to pick the Tasks filesystem path (gradleHome), based on the agent.name as we have different kind of agents in the same pool.

I tried, below solution, but didn't work. It's not picking the gradleHome Pathas per the agent picked.

- task: Gradle@2
  displayName: 'Clean Project'
  inputs:
   workingDirectory: 'xxxx'
   gradleWrapperFile: '$(System.DefaultWorkingDirectory)/gradlew'
   javaHomeOption: 'JDKVersion'
   jdkVersionOption: '1.11'
   ${{ if startsWith(variables['Agent.Name'], 'mypool1')}}:
     tasks: 'clean <Commands> -Dgradle.user.home=/opt/gradle-8.0.2'
   ${{ if notIn(variables['Agent.Name'], 'azdevops-android-scaledjob')}}:
     tasks: 'clean <Commands> -Dgradle.user.home=/data/gradle'
@vivuu1989
Copy link
Author

Any method to achieve this using AzureDevops pipeline?

@surajshenoy
Copy link
Contributor

Hi @vivuu1989, this forum is available to discuss the concerns regarding Azuredevopslabs site and the content. Seems like your concern is not related to any of the labs. Please try finding the solution in the relevant forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants