Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Python Script to Git Clone each Apelon-VA ISAAC + OCHRE Framework
#! /usr/bin/python
# Pull each Apelon-VA Repo
import subprocess
import os
def git(*args):
return subprocess.Popen(['git'] + list(args), shell=True, stdout=subprocess.PIPE).communicate()[0]
projects = ['va-isaac-parent', 'va-ochre', 'va-isaac-metadata', 'va-isaac-mojo', 'va-newtons-cradle', 'va-logic', 'va-query-service', 'va-solor-goods', 'va-isaac-gui', 'va-expression-service']
for project in projects:
repoUrl = "" + project + ".git"
gitArgs = ['git', 'clone', repoUrl]
print("Attempting to clone: " + repoUrl)
print("GIT Command: ")
output = subprocess.Popen(gitArgs, shell=True, stdout=subprocess.PIPE).communicate()[0]
# output = git("clone", repoUrl)
# TODO: What is printed when a Git Clone fails, add that to L21
if "usage: git [--version]" in output:
print("GIT COMMAND PROBLEM. Fix the Git Command")
elif "git error" in output:
print("GIT ERROR")
print("GIT ERROR!")
if output:
raise Exception("GIT ERROR!")
print("GIT SUCCESS!")
output = None
# Add a hook at the end of the loop to manually create a Eclipse Project in the .project file and import these repos... dope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.