Find your content:

Search form

You are here

Automating snapshots with ANT migration tool and GIT

 
Share

How can I automate the process or retrieving a snapshot of my code and configuration and committing it to git?

We have a ton of development happening in my org, and I'm currently saving daily snapshots in git, to keep a handle on our expanding configuration and code.

I'm currently using Ant and EGit, both from within Eclipse. A downside is that I have to manually run the ANT retrieve macro and then commit to git each day. I'd love to automate this process, but I'm not sure how to.


Attribution to: Benj

Possible Suggestion/Solution #1

If you can use the command-line versions of these tools, then you could wrap all of this up with a script and set it to run on a schedule (cron or other). I didn't test this, but this would be a bash (OSX, Linux, Unix) version of what you could do...

#!/bin/bash

# clear out existing code
# this is important to capture deletes
rm -rf src/*

# run ant
ant retrieve

# do a git snapshot
git add .
git commit -m "daily snapshot"
git push

Attribution to: Kevin O'Hara
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/5561

My Block Status

My Block Content