Question

We have a git repo on a IIS server (git installed) and when test.com/updateRepo is hit it should CD into a particular dir and execute git pull --rebase origin master (or execute a batch file)

How do we go about this?

Need it be a .aspx page that will call that batch file?
Can IIS run it directly?

Was it helpful?

Solution

  1. Open the root folder of your website (Example: C:\inetpub\wwwroot)
  2. Create a text file with extension .aspx (Exampe: run.aspx)
  3. Add the following script
<script language="c#" runat="server">

public void Page_Load(object sender, EventArgs e)    
{
  System.Diagnostics.Process.Start(@"C:\inetpub\wwwroot\run.bat");    
  Response.Write("OK");
}

< /script>

(You will need to remove the space i addeed for the < /script>, Stackoverflow doesnt allow me to add script tags the correct way.)

Then call the file /run.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top