Skip to content

Commit f6f6263

Browse files
committed
[Build] Use latest commit of branch specified in .gitmodules file
This simplifies trying out changes in a submodule and their effect on the entire Eclipse-SDK in advance. Instead of always fetching the latest commit from the master branch of the specified remote, fetch the latest commit of the branch specified in '.gitmodules' from each submodule's remote (also specified in '.gitmodules'). On the CLI this can be archived by the following command: ''' git submodule update --remote ''' But since the Jenkins job is already configured to checkout the submodules this way, nothing actually has to be done and the corresponding stage can just be removed. In order to try out a change with the entire Eclipse-SDK, now one just has to update the affected submodules in the '.gitmodules' file to point to the git-repository and the branch providing the change(s). Before, one either had to push changes to the 'master' branch of the alternative repository providing a change or had to disable the fetch in this Jenkins pipeline and record the change's commit in this aggregator repository along with changing the of the remote in '.gitmodules'. Of course all of this had to be known. Additionally add a comment explaining how to archive the just built product with a Jenkins build.
1 parent d4149e3 commit f6f6263

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.gitmodules

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,48 @@
1-
# Touched, for Bug 398016 - [CBI] How to coordinate (or not) submodules with Git and EGit
21
[submodule "eclipse.jdt"]
32
path = eclipse.jdt
43
url = https://github.com/eclipse-jdt/eclipse.jdt.git
4+
branch = master
55
[submodule "eclipse.jdt.core"]
66
path = eclipse.jdt.core
77
url = https://github.com/eclipse-jdt/eclipse.jdt.core.git
8+
branch = master
89
[submodule "eclipse.jdt.core.binaries"]
910
path = eclipse.jdt.core.binaries
1011
url = https://github.com/eclipse-jdt/eclipse.jdt.core.binaries.git
12+
branch = master
1113
[submodule "eclipse.jdt.debug"]
1214
path = eclipse.jdt.debug
1315
url = https://github.com/eclipse-jdt/eclipse.jdt.debug.git
16+
branch = master
1417
[submodule "eclipse.jdt.ui"]
1518
path = eclipse.jdt.ui
1619
url = https://github.com/eclipse-jdt/eclipse.jdt.ui.git
20+
branch = master
1721
[submodule "eclipse.pde"]
1822
path = eclipse.pde
1923
url = https://github.com/eclipse-pde/eclipse.pde.git
24+
branch = master
2025
[submodule "eclipse.platform"]
2126
path = eclipse.platform
2227
url = https://github.com/eclipse-platform/eclipse.platform.git
28+
branch = master
2329
[submodule "eclipse.platform.swt"]
2430
path = eclipse.platform.swt
2531
url = https://github.com/eclipse-platform/eclipse.platform.swt.git
32+
branch = master
2633
[submodule "eclipse.platform.ui"]
2734
path = eclipse.platform.ui
2835
url = https://github.com/eclipse-platform/eclipse.platform.ui.git
36+
branch = master
2937
[submodule "equinox.binaries"]
3038
path = equinox.binaries
3139
url = https://github.com/eclipse-equinox/equinox.binaries.git
40+
branch = master
3241
[submodule "equinox"]
3342
path = equinox
3443
url = https://github.com/eclipse-equinox/equinox.git
44+
branch = master
3545
[submodule "equinox.p2"]
3646
path = equinox.p2
3747
url = https://github.com/eclipse-equinox/p2.git
48+
branch = master

Jenkinsfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ pipeline {
1616
MAVEN_OPTS = '-Xmx3800m'
1717
}
1818
stages {
19-
stage('Use master') {
20-
steps {
21-
sh 'git submodule foreach "git fetch origin master; git checkout FETCH_HEAD"'
22-
}
23-
}
2419
stage('Deploy parent-pom and SDK-target') {
2520
when {
2621
anyOf {
@@ -105,6 +100,7 @@ pipeline {
105100
*/tests/target/work/data/.metadata/.*log,\
106101
apiAnalyzer-workspace/.metadata/.*log,\
107102
eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/target/repository/*'
103+
// To archive the built products, add to above's list: eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/target/products/*
108104
}
109105
}
110106
}

0 commit comments

Comments
 (0)