diff --git a/.gitignore b/.gitignore index 3e89b93..d4cfb7e 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,10 @@ hs_err_pid* /.classpath /.cproject /cache/ +/*.class +/.settings +/.project +/.classpath +/.cproject +/cache/ /*.class \ No newline at end of file diff --git a/LabCodeRepoSetupMain.groovy b/LabCodeRepoSetupMain.groovy index 81961a4..6af53d5 100644 --- a/LabCodeRepoSetupMain.groovy +++ b/LabCodeRepoSetupMain.groovy @@ -62,7 +62,7 @@ public void start() throws Exception { HashSet allStudents = new HashSet<>(); - String teamAssignmentsFile = ScriptingEngine.gitScriptRun("https://github.com/WPIRoboticsEngineering/LabCodeRepoSetup.git", "getFile.groovy") + String teamAssignmentsFile = ScriptingEngine.gitScriptRun("https://github.com/BancroftRoboDogs/LabCodeRepoSetup.git", "getFile.groovy") println "Loading file "+teamAssignmentsFile GitHub github = LabCodeRepoSetupMain.getGithub(); @@ -144,7 +144,11 @@ throws IOException { } for (GHUser f : toRemove) { System.out.println("Removing " + f.getLogin() + " from " + dest.getName()); + try{ dest.remove(f); + }catch(Exception ex){ + ex.printStackTrace() + } } } @@ -169,8 +173,8 @@ throws IOException { } catch (Exception ex) { System.out.println("Inviting " + u.getLogin() + " to " + hwTeam); } - myTeam.add(repositorie, GHOrganization.Permission.ADMIN); - teachTeam.add(repositorie, GHOrganization.Permission.ADMIN); + myTeam.add(repositorie, GHOrganization.Permission.PUSH); + teachTeam.add(repositorie, GHOrganization.Permission.PUSH); } } @@ -227,9 +231,9 @@ throws IOException, InterruptedException, Exception { teamString, repoFullName); } if (team == null) { - team = dest.createTeam(teamnameString, GHOrganization.Permission.ADMIN, myTeamRepo); + team = dest.createTeam(teamnameString, GHOrganization.Permission.PUSH, myTeamRepo); } - team.add(myTeamRepo, GHOrganization.Permission.ADMIN); + team.add(myTeamRepo, GHOrganization.Permission.PUSH); for (String member : members) { try { GHUser memberGH = github.getUser(member); @@ -274,7 +278,7 @@ private static GHRepository createTeamRepo(HashMap> te String sourceURL; GHRepository myTeamRepo; System.out.println("Missing Repo, creating " + repoFullName); - myTeamRepo = createRepository(dest, repoFullName, "RBE Class team repo for team " + teamString); + myTeamRepo = createRepository(dest, repoFullName, " " + teamString); def URLOfStudentRepo="https://github.com/" + projectDestBaseName + "/" + repoFullName + ".git" while (dest.getRepository(repoFullName) == null) { System.out.println("Waiting for the creation of " + repoFullName); diff --git a/getFile.groovy b/getFile.groovy index 002b146..05a58a1 100644 --- a/getFile.groovy +++ b/getFile.groovy @@ -98,7 +98,7 @@ public static String getTeamAssignmentFile(String[] a) { String teamAssignmentsFile; if (a.length == 0) { String p = new FileSelectionFactory().GetFile( - ScriptingEngine.getRepositoryCloneDirectory("https://github.com/WPIRoboticsEngineering/LabCodeRepoSetup.git"), + ScriptingEngine.getRepositoryCloneDirectory("https://github.com/BancroftRoboDogs/LabCodeRepoSetup.git"), new ExtensionFilter("json file", "*.JSON", "*.json") ).getAbsolutePath(); teamAssignmentsFile = p; diff --git a/teams.json b/teams.json new file mode 100644 index 0000000..7788ead --- /dev/null +++ b/teams.json @@ -0,0 +1,9 @@ +{ +"homework":["false"], +"projectName":["BancroftRoboDogs"], +"repoDestBaseNames":["RobodogsCode_2025_26_"], +"teamDestBaseName":["RobodogsTeam"], +"numberOfTeams":["4"], +"01":["NoahS1111","carolinec25","estyrrytg","kimsseTheWolf","rebelOoO","kccc-1004"] + +}