Can I trigger a commit via the command line?
yantis
Posts: 5 New member
I would like to be able to schedule source control commits on a daily basis.
Tagged:
Answers
Your question seems similar to the one below.
https://forum.red-gate.com/discussion/79770/auto-scheduled-commits
Product Manager
Redgate Software
In that case, can you please vote for this suggestion on our user voice forum?
Tianjiao Li | Redgate Software
Have you visited our Help Center?
If you want to achieve this, it should be possible, but you will need to write the scripts yourself. The good news is that it is trivially simple using the SQL Compare command line.
Which version control tool do you use? These come with command lines, eg svn.exe, git.exe, etc.
All you need to do is to use a scheduler (windows scheduler, an Agent Job, or even a CI tool - it doesn't matter) to run a script periodically. This script will do something like this:
sqlcompare.exe /server1:<yourserver> /database1:<yourdb> /scripts2:<a_folder_location> /f
(you will need to use any command line switches to take into account any comparison options you want. See the docs for more details)
This means that the folder <a_folder_location>, which must be placed in your VCS working folder, will be constantly updated with the latest schema. The rest of the script depends on your VCS command line. If using git it will be something like this:
git stage .
git commit -m "scheduled schema backup"
git push origin master
Product Manager
Redgate Software
This should be fairly simple. I found this page via a Google search that seems to cover all the SVN.exe commands.
Let us know whether this solves the problem for you!
Product Manager
Redgate Software