1 # JJB macros specific to Integration/Distribution ODL project
5 name: distribution-check-wipe
6 # Step zero: Wipe file repositories up front.
9 echo "wipe r: the local Maven repository"
11 echo "wipe n: the fake remote (Nexus) repository"
13 echo "wipe t: the transient repository used in some manipulations"
17 name: distribution-check-build-project
18 # Step one: Online build of the project, using local repository /tmp/r/ and deploying artifacts to /tmp/n/.
19 # Ordinary SingleFeatureTest failures are detected in the verify job, so we can use "q" profile here.
21 # pom: Relative path to pom file to use. Typically '$GERRIT_PROJECT/pom.xml'.
24 maven-version: 'mvn33'
28 dependency:tree -DoutputFile=dependency_tree.txt
30 -DaltDeploymentRepository=fake-nexus::default::file:///tmp/n/
33 - '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
34 settings: 'integration-settings'
36 global-settings: 'global-settings'
37 global-settings-type: cfp
40 name: distribution-check-verify-groupid
41 # Step two: Verify all deployed artifacts belong to the project's groupId.
42 # This is done by moving the allowed directories out of /tmp/n and checking no files remained there.
43 # The correct directory is derived from $GERRIT_PROJECT.
44 # TODO: Verify all deployed artifacts are snapshots.
46 # gerrit-project: Project name as nexus URI part. Typically '$GERRIT_PROJECT'.
49 mkdir -p /tmp/t/org/opendaylight/{gerrit-project}
50 mv /tmp/n/org/opendaylight/{gerrit-project}/* /tmp/t/org/opendaylight/{gerrit-project}/
51 test -z "`find /tmp/n/ -type f`" || ( echo "ERROR: Mismatched groupId detected (see above)." && false )
56 name: distribution-check-download-deps
57 # Step three: Online build of integration distribution.
58 # This step is mainly used for downloading other project artifacts.
59 # Running SingleFeaturesTest here does not seem to be required, so -Pq is used again.
61 # dist-pom: Relative path to pom file to use. 'distribution/pom.xml' is recommended.
64 maven-version: 'mvn33'
68 dependency:tree -DoutputFile=dependency_tree.txt
72 - '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
73 settings: 'integration-settings'
75 global-settings: 'global-settings'
76 global-settings-type: cfp
79 name: distribution-check-delete-snapshots
80 # Step four: Delete snapshot artifacts from the local repository.
81 # This is critical to detect orphaned artifacts or missing project-internal dependency declarations.
82 # Also other files related to maven repository resolution are removed,
83 # and then empty directories are removed, in order to simplify debugging.
85 - shell: !include-raw-escape: distribution-delete-snaphot-artifacts.sh
88 name: distribution-check-configure-remotes
89 # Now the ugly part. It seems that the only way to tell Maven 2+
90 # which remote repositories to use is via settings.xml file.
91 # So we create such a file here, but it needs most of odlparent:settings.xml
95 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
96 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
97 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
98 https://maven.apache.org/xsd/settings-1.0.0.xsd">
101 <id>opendaylight-release</id>
104 <id>opendaylight-mirror</id>
105 <name>opendaylight</name>
106 <url>https://nexus.opendaylight.org/content/repositories/public/</url>
107 <releases><updatePolicy>never</updatePolicy></releases>
108 <snapshots><enabled>false</enabled></snapshots>
113 <id>opendaylight-plugin-mirror</id>
114 <name>opendaylight-plugin</name>
115 <url>https://nexus.opendaylight.org/content/repositories/public/</url>
116 <releases><updatePolicy>never</updatePolicy></releases>
117 <snapshots><enabled>false</enabled></snapshots>
119 </pluginRepositories>
122 <id>file-snapshots</id>
125 <id>file-snapshots</id>
127 <url>file:///tmp/n/</url>
128 <releases><enabled>false</enabled></releases>
133 <id>file-plugin-snapshots</id>
134 <name>file-plugin</name>
135 <url>file:///tmp/n/</url>
136 <releases><enabled>false</enabled></releases>
138 </pluginRepositories>
142 <activeProfile>file-snapshots</activeProfile>
143 <activeProfile>opendaylight-release</activeProfile>
147 # Notes: The settings are minimal in order to detect breakage scenarios,
148 # while allowing for the following quirks:
149 # * Some plugins seem to have hardcoded repos, for example check-license looks at repository.apache.org
150 # * Some plugin artifacts (related to surefire) are not downloaded when tests are skipped.
151 # * populate-local-repo looks at oss.sonatype.org and does not store things (like guava) to /tmp/r
154 name: distribution-check-repeat-project-build
155 # Step five: Repeat the project build but with the new settings.
156 # Here, only the project snapshot artifacts deployed to /tmp/n are available,
157 # which faithfully reproduces conditions in later verify-like job runs.
158 # We cannot use --offline, because: "Cannot access file (file:///tmp/n) in offline mode".
159 # SingleFeatureTest is still skipped, as we expect the same results as in the verify job.
160 # Current content of /tmp/r is restored afterwards to not affect the next step.
161 # TODO: Could there be missing dependencies which would only affect SFT here?
163 # pom: Relative path to pom file to use. Typically '$GERRIT_PROJECT/pom.xml'.
168 maven-version: 'mvn33'
172 dependency:tree -DoutputFile=dependency_tree.txt
177 - '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
183 name: distribution-check-repeat-distro-build
184 # Step six: Repeat the distribution build but with the new settings.
185 # Here, only the project snapshot artifacts deployed to /tmp/n are available,
186 # which faithfully reproduces conditions in later verify-like job runs.
187 # We cannot use --offline, because: "Cannot access file (file:///tmp/n) in offline mode".
188 # This is where SingleFeatureTest is not skipped.
189 # TODO: Lower -Dsft.heap.max to 3g or lower when Bug 9218 is fixed.
191 # dist-pom: Relative path to pom file to use. 'distribution/pom.xml' is recommended.
194 maven-version: 'mvn33'
198 dependency:tree -DoutputFile=dependency_tree.txt
205 - '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'