How to deploy my website with one click using Git Bash on windows and a scripted command

545 Views Asked by At

I have a html/css/js website which is stored in GitHub and developed on my Windows 10 machine using Visual Studio 2019.

Currently I'm deploying it using the Git Bash console and then running a git ftp command to push any deltas to the server.

Specifically:

  1. I have pinned shortcut on the task bar which opens Git Bash in the root directory of the website. enter image description here
  2. Once the console has opened, I execute the following command to push to the server: "git ftp -v -u "frankray" push"

A two click deployment is no big deal, but I'd really like to do this in one click from the task bar (as a prelude to automating the CI).

Problem: I cannot for the life of me workout how to pass in the git ftp command into the console and run it, say from a batch file or perhaps directly calling git-bash.exe with the command passed in as a parameter.

I can't imagine it's hard to do, but I haven't worked out what I've been doing wrong. Please help.

1

There are 1 best solutions below

0
On BEST ANSWER

Posting my comment as an answer

Unfortunately there isn't a list of command line options for git-bash. This superuser question may provide some more info.


A possible solution (verified by OP) is passing the -c parameter (command to be executed) to the target like so;

"C:\Program Files\Git\git-bash.exe" --cd="C:\Users\frank\Documents\Professional\Contracting\5. Frank Ray & Associates Ltd\Website\frankray.net" -c 'git ftp -v -u "frankray" push ; read -p "Press any key to continue"'