|
49 | 49 | def configurations = readJSON(file: "${WORKSPACE}/JenkinsJobs/buildConfigurations.json") |
50 | 50 | BUILD = configurations["${BUILD_TYPE}"] |
51 | 51 | assignEnvVariable('BUILD_TYPE_NAME', BUILD.typeName) |
52 | | - assignEnvVariable('PATCH_OR_BRANCH_LABEL', BUILD.branchLabel) |
| 52 | + assignEnvVariable('GIT_SUBMODULE_BRANCHES', BUILD.branches ? BUILD.branches.collect{ name, branch -> "${name}:${branch}" }.join(',') : '') |
53 | 53 | assignEnvVariable('TEST_NAME_PREFIX', "ep${matcher.group('major')}${matcher.group('minor')}${BUILD_TYPE}-unit") |
54 | 54 | assignEnvVariable('TEST_CONFIGURATIONS_EXPECTED', BUILD.tests.collect{ c -> |
55 | 55 | "${TEST_NAME_PREFIX}-${c.os}-${c.arch}-java${c.javaVersion}_${c.os}.${c.ws}.${c.arch}_${c.javaVersion}" |
@@ -82,12 +82,21 @@ spec: |
82 | 82 | git config --global user.name 'Eclipse Releng Bot' |
83 | 83 |
|
84 | 84 | # Clone this repo and all submodules into the 'AGG_DIR' directory |
85 | | - git clone --branch=$BRANCH --recursive \ |
| 85 | + git clone --branch=$BRANCH --recurse-submodules --remote-submodules \ |
86 | 86 | [email protected]:eclipse-platform/eclipse.platform.releng.aggregator.git "$CJE_ROOT/$AGG_DIR" |
87 | 87 |
|
88 | 88 | cd "$CJE_ROOT/$AGG_DIR" |
89 | 89 |
|
90 | | - git submodule foreach 'git fetch; SUBMODULE_BRANCH=$(grep $name: $CJE_ROOT/streams/repositories_$PATCH_OR_BRANCH_LABEL.txt | cut -f2 -d\\ ); SUBMODULE_BRANCH=${SUBMODULE_BRANCH:-$BRANCH}; echo Checking out $SUBMODULE_BRANCH; git checkout $SUBMODULE_BRANCH; git pull' |
| 90 | + if [ -n "${GIT_SUBMODULE_BRANCHES}" ]; then |
| 91 | + for submodule in ${GIT_SUBMODULE_BRANCHES//,/ }; do |
| 92 | + path=$(echo "$submodule" | cut -d: -f1) |
| 93 | + branch=$(echo "$submodule" | cut -d: -f2) |
| 94 | + pushd "${path}" |
| 95 | + git checkout ${branch} |
| 96 | + git pull |
| 97 | + popd |
| 98 | + done |
| 99 | + fi |
91 | 100 |
|
92 | 101 | # Create 'Build input' commit (considering commits potentially submitted to the aggregator BRANCH in the meantime) |
93 | 102 | git checkout $BRANCH |
@@ -133,14 +142,14 @@ spec: |
133 | 142 | sshagent (['github-bot-ssh']) { |
134 | 143 | sh '''#!/bin/bash -xe |
135 | 144 | source $CJE_ROOT/buildproperties.shsource |
136 | | - function toPushRepo() { |
137 | | - from="$1" |
138 | | - echo $(sed --expression 's,https://github.com/, [email protected]:,' <<< $from) |
| 145 | + function tagAndPush { |
| 146 | + git tag ${BUILD_ID} HEAD |
| 147 | + pushURL=$(git config remote.origin.url | sed --expression 's,https://github.com/, [email protected]:,') |
| 148 | + git push "${pushURL}" tag ${BUILD_ID} |
139 | 149 | } |
140 | | - export -f toPushRepo |
141 | | - git submodule foreach 'if grep "^${name}:" $CJE_ROOT/streams/repositories_$PATCH_OR_BRANCH_LABEL.txt > /dev/null; then git tag $BUILD_ID; PUSH_URL="$(toPushRepo $(git config --get remote.origin.url))"; git push --verbose $PUSH_URL $BUILD_ID; else echo Skipping $name; fi || :' |
142 | | - git tag $BUILD_ID |
143 | | - git push --verbose origin $BUILD_ID |
| 150 | + export -f tagAndPush |
| 151 | + git submodule foreach 'tagAndPush' |
| 152 | + tagAndPush |
144 | 153 | ''' |
145 | 154 | } |
146 | 155 | // Git log creation |
|
0 commit comments