Skip to main content

Command Palette

Search for a command to run...

AzureDevops : How to run the bash script as a task in a pipeline ?

Published
1 min read
AzureDevops : How to run the bash script as a task in a pipeline ?
S

I love learning about technology and sharing that with others

Introduction

my setup , azure devops hosted on prem, and windows server hosting all the agent.

How to Run the bash script using azure devops pipeline. ?

  1. Add a script and task is easier part.
  2. Make sure the bash script which is added to repository should be created by a linux system and have the permission to execute.
chmod +x test.sh
  • Sample bash Script :
#!/bin/bash
echo "-----------------------------------------------------"
git rev-list HEAD -1
git rev-list HEAD | wc -l
  1. Make sure Git bash is installed in the Windows Server where our Windows Agents are stored, also make sure the path of the git bash is added to the environment variable.

make sure to restart the agent after the path is update

  1. Now lets see how the bash task looks in the piplein

screenshot_61.png

Let me know if you guys faced any other issues, other than this mentioned in the blogpost. :)

119 views

More from this blog

H

hashcodehub

271 posts

Consistent, Passionate and Organized :)