Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2021-04-30 04:01:44 -0400
committerEike Stepper2021-04-30 04:01:44 -0400
commitb9c349a165d4167063d5efaf1118334944c934ec (patch)
treeaf4118ba059d61425e79012d5ac60ee0864c2b57
parent5b321a456f5a0bb08699c5d9adf84a3289a02864 (diff)
downloadcdo.infrastructure-b9c349a165d4167063d5efaf1118334944c934ec.tar.gz
cdo.infrastructure-b9c349a165d4167063d5efaf1118334944c934ec.tar.xz
cdo.infrastructure-b9c349a165d4167063d5efaf1118334944c934ec.zip
First tests on JIRO
-rw-r--r--org.eclipse.emf.cdo.releng.promotion/config/promoter.properties5
-rw-r--r--org.eclipse.emf.cdo.releng.promotion/src/promoter/BuildCopier.java2
-rw-r--r--org.eclipse.emf.cdo.releng.promotion/src/promoter/Git.java53
-rw-r--r--org.eclipse.emf.cdo.releng.promotion/src/promoter/Promoter.java12
-rw-r--r--org.eclipse.emf.cdo.releng.promotion/src/promoter/PromoterConfig.java5
-rw-r--r--org.eclipse.emf.cdo.releng.promotion/src/promoter/ReleaseNotesGenerator.java2
-rw-r--r--org.eclipse.emf.cdo.releng.promotion/src/promoter/SourceCodeManager.java3
-rw-r--r--org.eclipse.emf.cdo.releng.promotion/src/promoter/Subversion.java7
8 files changed, 62 insertions, 27 deletions
diff --git a/org.eclipse.emf.cdo.releng.promotion/config/promoter.properties b/org.eclipse.emf.cdo.releng.promotion/config/promoter.properties
index 90b8b02..ddd5bb8 100644
--- a/org.eclipse.emf.cdo.releng.promotion/config/promoter.properties
+++ b/org.eclipse.emf.cdo.releng.promotion/config/promoter.properties
@@ -5,8 +5,9 @@ projectPath=modeling/emf/cdo/test
compositionPath=updates
compositionTempPath=temp
-# Path to the Git repository within the job workspace
-gitRepositoryPath=git
+# Path to the project Git repository (not the promotion repo!) within the job workspace
+gitRepositoryPath=gitcdo
+gitRepositoryURL=git://git.eclipse.org/gitroot/cdo/cdo.git
firstRelevantRevision=1494478feeb46fa6eff70887ea03f59a5a790683
# Global infra structure
diff --git a/org.eclipse.emf.cdo.releng.promotion/src/promoter/BuildCopier.java b/org.eclipse.emf.cdo.releng.promotion/src/promoter/BuildCopier.java
index 26bc9cf..70d0639 100644
--- a/org.eclipse.emf.cdo.releng.promotion/src/promoter/BuildCopier.java
+++ b/org.eclipse.emf.cdo.releng.promotion/src/promoter/BuildCopier.java
@@ -206,7 +206,7 @@ public class BuildCopier extends PromoterComponent
protected void setTag(BuildInfo buildInfo)
{
System.out.println();
- SourceCodeManager scm = getPromoter().createSourceCodeManager();
+ SourceCodeManager scm = getPromoter().getSourceCodeManager();
if (scm != null)
{
scm.setTag(buildInfo.getBranch(), buildInfo.getRevision(), buildInfo.getQualifier());
diff --git a/org.eclipse.emf.cdo.releng.promotion/src/promoter/Git.java b/org.eclipse.emf.cdo.releng.promotion/src/promoter/Git.java
index 0e377d2..14d2f25 100644
--- a/org.eclipse.emf.cdo.releng.promotion/src/promoter/Git.java
+++ b/org.eclipse.emf.cdo.releng.promotion/src/promoter/Git.java
@@ -23,11 +23,12 @@ import promoter.util.IO;
*/
public class Git extends SourceCodeManager
{
- public static final String CLONE = "cd " + PromoterConfig.INSTANCE.getProjectCloneLocation() + ";\n";
-
- public static final String GIT_BINARY = CLONE + PromoterConfig.INSTANCE.getGitExecutable();
+ private static final String GIT_COMMAND = //
+ "cd " + PromoterConfig.INSTANCE.getProjectCloneLocation() + ";\n" + //
+ PromoterConfig.INSTANCE.getGitExecutable();
// The symbolic name (alternatively: the URL) of the upstream (main) Git repository
+ @Deprecated
public static final String REMOTE_GIT = "origin";
// the following makes Git output
@@ -47,14 +48,39 @@ public class Git extends SourceCodeManager
{
}
- private void fetchIfNeeded(PrintStream stream)
+ private boolean cloneIfNeeded()
{
- if (!fetched)
+ File clone = PromoterConfig.INSTANCE.getProjectCloneLocation();
+ if (clone.exists())
{
- stream.println(GIT_BINARY + " fetch");
+ return false;
+ }
+
+ File parent = clone.getParentFile();
+ parent.mkdirs();
+
+ IO.executeProcess("/bin/bash", out -> {
+ PrintStream stream = new PrintStream(out);
+ stream.println(PromoterConfig.INSTANCE.getGitExecutable() + " clone --bare " + PromoterConfig.INSTANCE.getGitRepositoryURL() + " " + clone);
stream.flush();
+ });
+ return true;
+ }
+
+ private void fetchIfNeeded(PrintStream stream)
+ {
+ if (!fetched)
+ {
fetched = true;
+
+ if (cloneIfNeeded())
+ {
+ return;
+ }
+
+ stream.println(GIT_COMMAND + " fetch");
+ stream.flush();
}
}
@@ -85,7 +111,7 @@ public class Git extends SourceCodeManager
}
@Override
- public void handleLogEntries(final String branch, final String fromRevision, final String toRevision, final boolean withPaths, final LogEntryHandler handler)
+ public void handleLogEntries(String branch, String fromRevision, String toRevision, boolean withPaths, LogEntryHandler handler)
{
try
{
@@ -98,7 +124,7 @@ public class Git extends SourceCodeManager
String range = fromRevision + ".." + toRevision;
System.out.println("Getting log entries for " + branch + " (" + range + ")");
- String command = GIT_BINARY + " log " + (withPaths ? "--name-only " : "") + " --format=\"" + OUTPUT_FORMAT + "\" " + range + " > " + outFile;
+ String command = GIT_COMMAND + " log " + (withPaths ? "--name-only " : "") + " --format=\"" + OUTPUT_FORMAT + "\" " + range + " > " + outFile;
stream.println(command);
stream.flush();
});
@@ -179,6 +205,10 @@ public class Git extends SourceCodeManager
outFile.delete();
}
}
+ catch (RuntimeException ex)
+ {
+ throw ex;
+ }
catch (Exception ex)
{
throw new RuntimeException(ex);
@@ -192,12 +222,7 @@ public class Git extends SourceCodeManager
{
throw new IllegalStateException("Unexpected end of stream");
}
- return result;
- }
- @Override
- public void commit(String comment, File... checkouts)
- {
- throw new UnsupportedOperationException();
+ return result;
}
}
diff --git a/org.eclipse.emf.cdo.releng.promotion/src/promoter/Promoter.java b/org.eclipse.emf.cdo.releng.promotion/src/promoter/Promoter.java
index e336296..5e5e030 100644
--- a/org.eclipse.emf.cdo.releng.promotion/src/promoter/Promoter.java
+++ b/org.eclipse.emf.cdo.releng.promotion/src/promoter/Promoter.java
@@ -36,6 +36,8 @@ public class Promoter extends ComponentFactory
private final boolean skipGenerateReleaseNotes;
+ private SourceCodeManager scm;
+
public static void main(String[] args) throws Exception
{
boolean force = Boolean.getBoolean("forcedPromotion");
@@ -78,6 +80,16 @@ public class Promoter extends ComponentFactory
this.skipGenerateReleaseNotes = skipGenerateReleaseNotes;
}
+ public SourceCodeManager getSourceCodeManager()
+ {
+ if (scm == null)
+ {
+ scm = createSourceCodeManager();
+ }
+
+ return scm;
+ }
+
public void run()
{
System.out.println("----------------------------------------------------------------------------------------------------------");
diff --git a/org.eclipse.emf.cdo.releng.promotion/src/promoter/PromoterConfig.java b/org.eclipse.emf.cdo.releng.promotion/src/promoter/PromoterConfig.java
index e90f6bc..2ce2c10 100644
--- a/org.eclipse.emf.cdo.releng.promotion/src/promoter/PromoterConfig.java
+++ b/org.eclipse.emf.cdo.releng.promotion/src/promoter/PromoterConfig.java
@@ -38,6 +38,11 @@ public final class PromoterConfig extends Config
return getProperty("gitRepositoryPath");
}
+ public String getGitRepositoryURL()
+ {
+ return getProperty("gitRepositoryURL");
+ }
+
public File getProjectCloneLocation()
{
String gitRepositoryPath = getGitRepositoryPath();
diff --git a/org.eclipse.emf.cdo.releng.promotion/src/promoter/ReleaseNotesGenerator.java b/org.eclipse.emf.cdo.releng.promotion/src/promoter/ReleaseNotesGenerator.java
index 0279ec3..b52992f 100644
--- a/org.eclipse.emf.cdo.releng.promotion/src/promoter/ReleaseNotesGenerator.java
+++ b/org.eclipse.emf.cdo.releng.promotion/src/promoter/ReleaseNotesGenerator.java
@@ -42,7 +42,7 @@ public class ReleaseNotesGenerator extends PromoterComponent
public synchronized void generateReleaseNotes(List<BuildInfo> buildInfos)
{
- scm = getPromoter().createSourceCodeManager();
+ scm = getPromoter().getSourceCodeManager();
issueManager = getPromoter().createIssueManager();
for (ReleaseNotesStream stream : getStreams(buildInfos))
diff --git a/org.eclipse.emf.cdo.releng.promotion/src/promoter/SourceCodeManager.java b/org.eclipse.emf.cdo.releng.promotion/src/promoter/SourceCodeManager.java
index 26f7fa8..a0a4fce 100644
--- a/org.eclipse.emf.cdo.releng.promotion/src/promoter/SourceCodeManager.java
+++ b/org.eclipse.emf.cdo.releng.promotion/src/promoter/SourceCodeManager.java
@@ -10,7 +10,6 @@
*/
package promoter;
-import java.io.File;
import java.util.ArrayList;
import java.util.List;
@@ -27,8 +26,6 @@ public abstract class SourceCodeManager extends PromoterComponent
public abstract void handleLogEntries(String branch, String fromRevision, String toRevision, boolean withPaths, LogEntryHandler handler);
- public abstract void commit(String comment, File... checkouts);
-
/**
* @author Eike Stepper
*/
diff --git a/org.eclipse.emf.cdo.releng.promotion/src/promoter/Subversion.java b/org.eclipse.emf.cdo.releng.promotion/src/promoter/Subversion.java
index 21699c7..1c92413 100644
--- a/org.eclipse.emf.cdo.releng.promotion/src/promoter/Subversion.java
+++ b/org.eclipse.emf.cdo.releng.promotion/src/promoter/Subversion.java
@@ -23,6 +23,7 @@ import promoter.util.XML;
/**
* @author Eike Stepper
*/
+@Deprecated
public class Subversion extends SourceCodeManager
{
public static final String SVN_BINARY = "/usr/local/bin/svn";
@@ -134,10 +135,4 @@ public class Subversion extends SourceCodeManager
throw new RuntimeException(ex);
}
}
-
- @Override
- public void commit(String comment, File... checkouts)
- {
- throw new UnsupportedOperationException();
- }
}

Back to the top