1 # JJB macros specific to Integration/Distribution ODL project
4 name: distribution-check-wipe
5 # Step zero: Wipe file repositories up front.
7 - shell: !include-raw-escape: distribution-check-wipe.sh
10 name: distribution-check-build-project
11 # Step one: Online build of the project, using local repository /tmp/r/ and deploying artifacts to /tmp/n/.
12 # Ordinary SingleFeatureTest failures are detected in the verify job, so we can use "q" profile here.
14 # pom: Relative path to pom file to use. Typically '$GERRIT_PROJECT/pom.xml'.
17 maven-version: "{mvn-version}"
21 dependency:tree -DoutputFile=dependency_tree.txt
23 -DaltDeploymentRepository=fake-nexus::default::file:///tmp/n/
26 - "-Xmx4096m -Dmaven.compile.fork=true"
27 settings: "integration-settings"
29 global-settings: "global-settings"
30 global-settings-type: cfp
33 name: distribution-check-verify-groupid
34 # Step two: Verify all deployed artifacts belong to the project's groupId.
35 # This is done by moving the allowed directories out of /tmp/n and checking no files remained there.
36 # The correct directory is derived from $GERRIT_PROJECT.
37 # TODO: Verify all deployed artifacts are snapshots.
39 # gerrit-project: Project name as nexus URI part. Typically '$GERRIT_PROJECT'.
41 - shell: !include-raw-escape: distribution-check-verify-groupid.sh
44 name: distribution-check-download-deps
45 # Step three: Online build of integration distribution.
46 # This step is mainly used for downloading other project artifacts.
47 # Running SingleFeaturesTest here does not seem to be required, so -Pq is used again.
49 # dist-pom: Relative path to pom file to use. 'distribution/pom.xml' is recommended.
52 maven-version: "{mvn-version}"
56 dependency:tree -DoutputFile=dependency_tree.txt
60 - "-Xmx1024m -Dmaven.compile.fork=true"
61 settings: "integration-settings"
63 global-settings: "global-settings"
64 global-settings-type: cfp
67 name: distribution-check-delete-snapshots
68 # Step four: Delete snapshot artifacts from the local repository.
69 # This is critical to detect orphaned artifacts or missing project-internal dependency declarations.
70 # Also other files related to maven repository resolution are removed,
71 # and then empty directories are removed, in order to simplify debugging.
73 - shell: !include-raw-escape: distribution-delete-snaphot-artifacts.sh
76 name: distribution-check-configure-remotes
77 # Now the ugly part. It seems that the only way to tell Maven 2+
78 # which remote repositories to use is via settings.xml file.
79 # So we create such a file here, but it needs most of odlparent:settings.xml
83 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
84 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
85 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
86 https://maven.apache.org/xsd/settings-1.0.0.xsd">
89 <id>opendaylight-release</id>
92 <id>opendaylight-mirror</id>
93 <name>opendaylight</name>
94 <url>https://nexus.opendaylight.org/content/repositories/public/</url>
95 <releases><updatePolicy>never</updatePolicy></releases>
96 <snapshots><enabled>false</enabled></snapshots>
101 <id>opendaylight-plugin-mirror</id>
102 <name>opendaylight-plugin</name>
103 <url>https://nexus.opendaylight.org/content/repositories/public/</url>
104 <releases><updatePolicy>never</updatePolicy></releases>
105 <snapshots><enabled>false</enabled></snapshots>
107 </pluginRepositories>
110 <id>file-snapshots</id>
113 <id>file-snapshots</id>
115 <url>file:///tmp/n/</url>
116 <releases><enabled>false</enabled></releases>
121 <id>file-plugin-snapshots</id>
122 <name>file-plugin</name>
123 <url>file:///tmp/n/</url>
124 <releases><enabled>false</enabled></releases>
126 </pluginRepositories>
130 <activeProfile>file-snapshots</activeProfile>
131 <activeProfile>opendaylight-release</activeProfile>
135 # Notes: The settings are minimal in order to detect breakage scenarios,
136 # while allowing for the following quirks:
137 # * Some plugins seem to have hardcoded repos, for example check-license looks at repository.apache.org
138 # * Some plugin artifacts (related to surefire) are not downloaded when tests are skipped.
139 # * populate-local-repo looks at oss.sonatype.org and does not store things (like guava) to /tmp/r
142 name: distribution-check-repeat-project-build
143 # Step five: Repeat the project build but with the new settings.
144 # Here, only the project snapshot artifacts deployed to /tmp/n are available,
145 # which faithfully reproduces conditions in later verify-like job runs.
146 # We cannot use --offline, because: "Cannot access file (file:///tmp/n) in offline mode".
147 # SingleFeatureTest is still skipped, as we expect the same results as in the verify job.
148 # Current content of /tmp/r is restored afterwards to not affect the next step.
149 # TODO: Could there be missing dependencies which would only affect SFT here?
151 # pom: Relative path to pom file to use. Typically '$GERRIT_PROJECT/pom.xml'.
156 maven-version: "{mvn-version}"
160 dependency:tree -DoutputFile=dependency_tree.txt
165 - "-Xmx4096m -Dmaven.compile.fork=true"
171 name: distribution-check-repeat-distro-build
172 # Step six: Repeat the distribution build but with the new settings.
173 # Here, only the project snapshot artifacts deployed to /tmp/n are available,
174 # which faithfully reproduces conditions in later verify-like job runs.
175 # We cannot use --offline, because: "Cannot access file (file:///tmp/n) in offline mode".
176 # This is where SingleFeatureTest is not skipped.
177 # TODO: Lower -Dsft.heap.max to 3g or lower when Bug 9218 is fixed.
179 # dist-pom: Relative path to pom file to use. 'distribution/pom.xml' is recommended.
182 maven-version: "{mvn-version}"
186 dependency:tree -DoutputFile=dependency_tree.txt
193 - "-Xmx1024m -Dmaven.compile.fork=true"
196 name: distribution-check-warn-9191
197 # Detect ODL bundles referenced cross-project from features, store them to a file to be archived.
198 # Do not fail the build, this is just to inform interested contributors.
199 # TODO: Improve integration archiving macro so that it finds bug_9191 log without us crating it in $WORKSPACE/.
202 # No failure in this macro should affect the job result.
204 rm -f "$WORKSPACE/bug_9191.log"
205 pushd "$WORKSPACE/distribution/$KARAF_ARTIFACT/target/assembly/system/org/opendaylight"
206 for folder in `ls`; do
207 find "$folder" -name \*features.xml | xargs fgrep -n '<bundle>' > bug_9191.0.log
208 fgrep org.opendaylight bug_9191.0.log | fgrep -v "org.opendaylight.$folder" >> "$WORKSPACE/bug_9191.log"
214 name: distribution-check-warn-9192
215 # Detect ODL bundles referenced from multiple features within a project, store them to a file to be archived.
216 # Current implementation will also include Bug 9191 violations,
217 # presenting an unified diff with lines marked to be removed, among unmarked lines to compare to.
218 # Do not fail the build, this is just to inform interested contributors.
219 # TODO: Improve integration archiving macro so that it finds bug_9192 log without us crating it in $WORKSPACE/.
222 # No failure in this macro should affect the job result.
224 pushd "$WORKSPACE/distribution/$KARAF_ARTIFACT/target/assembly/system/org/opendaylight"
225 find . -name \*features.xml | xargs fgrep -n '<bundle>' > "$WORKSPACE/bug_9192.0.log"
227 fgrep org.opendaylight bug_9192.0.log > "$WORKSPACE/bug_9192.1.log"
228 sort -s -t '<' -k 2 "$WORKSPACE/bug_9192.1.log" > "$WORKSPACE/bug_9192.2.log"
229 sort -u -s -t '<' -k 2 "$WORKSPACE/bug_9192.1.log" > "$WORKSPACE/bug_9192.3.log"
230 diff -U 999 -b -t -d "$WORKSPACE/bug_9192.2.log" "$WORKSPACE/bug_9192.3.log" > "$WORKSPACE/bug_9192.diff.log"
231 rm -f "$WORKSPACE"/bug_9192.?.log
234 name: distribution-check-bootup
235 # Operation: Locally deploy ODL with all fetures, check it is not broken.
236 # Required bash variables:
237 # KARAF_VERSION: 'karaf4' or 'karaf3'.
238 # Use distribution-karaf-version macro to customize.
240 - shell: !include-raw-escape: distribution-check-bootup.sh