1

We have a need to retrieve all metadata and apex classes from a salesforce org and push to a git hub repository hosted on bitbucket using ant. I have used the ant migration tool which helps to retrieve all metadata and apex from the sandbox. I am struggling to create an ant task which would retrieve files from a github repository and commit to it. Do you guys have sample ant build files which can retrieve from github, push, commit and where do we store the login information for github? Thanks Buyan

  • 2
    Is there any specific reason you aren't doing this using a GUI like SourceTree? Just curious. – cricketlang Feb 24 '16 at 2:19
  • I need an automated way to create ant script so that i can build continous integration in our environment. – buyan kumar Feb 24 '16 at 3:32
1

Setup an SSH key to avoid storing the password, then use the sshexec task:

<target name="pull" description="Git pull">
  <sshexec host="${host}"
         username="${user}"
         keyfile="c:\paul\testkey"
         trust="true"
         command="git pull"/>
</target>

References

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.