X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Fdistribution%2Fdistribution-macros.yaml;h=2e3ba043b449673ddaed4363ea73f5e29eae1515;hb=321d2beb638ea788003884f7aefdde104464c0cc;hp=3f5c447b114e88cb3a8b44f7cec6cda617960a5e;hpb=3d71eb64fefb6074ae485f9e35eeacded7a868c3;p=releng%2Fbuilder.git diff --git a/jjb/integration/distribution/distribution-macros.yaml b/jjb/integration/distribution/distribution-macros.yaml index 3f5c447b1..2e3ba043b 100644 --- a/jjb/integration/distribution/distribution-macros.yaml +++ b/jjb/integration/distribution/distribution-macros.yaml @@ -1,6 +1,5 @@ # JJB macros specific to Integration/Distribution ODL project --- - - builder: name: distribution-check-wipe # Step zero: Wipe file repositories up front. @@ -12,6 +11,16 @@ rm -rfv /tmp/n echo "wipe t: the transient repository used in some manipulations" rm -rfv /tmp/t + echo "create n: multithreaded execution might fail at creating it." + mkdir /tmp/n + echo "detecting distribution allowed projects" + # Some allowed projects cannot be detected in distribution because they do not produce features. + ALLOW_PROJECTS=(yangtools mdsal openflowjava) + ALLOW_PROJECTS+=(`grep 'org.opendaylight.' -Rh distribution \ + | sed -e 's%^[ \t]*org.opendaylight.%%' \ + | sed -e 's%%%' | sort -u`) + echo "Allowed projects are ${ALLOW_PROJECTS[@]}" + echo "ALLOW_PROJECTS=${ALLOW_PROJECTS[@]}" > allowed_projects.txt - builder: name: distribution-check-build-project @@ -21,12 +30,12 @@ # pom: Relative path to pom file to use. Typically '$GERRIT_PROJECT/pom.xml'. builders: - maven-target: - maven-version: 'mvn33' + maven-version: '{mvn-version}' pom: '{pom}' goals: | clean deploy dependency:tree -DoutputFile=dependency_tree.txt - -Pq + -Pq -Pmanaged -Punmanaged -DaltDeploymentRepository=fake-nexus::default::file:///tmp/n/ {mvn-opts} java-opts: @@ -46,6 +55,18 @@ # gerrit-project: Project name as nexus URI part. Typically '$GERRIT_PROJECT'. builders: - shell: | + echo "These are allowed projects: $ALLOW_PROJECTS" + echo "These are distribution pulled projects:" + EXIT_CODE="0" + for PROJECT in `ls /tmp/r/org/opendaylight`; do + echo "checking $PROJECT" + if [[ "$ALLOW_PROJECTS" != *"$PROJECT"* ]]; then + echo "ERROR: Not allowed project $PROJECT pulled" + EXIT_CODE="1" + fi + done + exit $EXIT_CODE + echo "verify project groupId" mkdir -p /tmp/t/org/opendaylight/{gerrit-project} mv /tmp/n/org/opendaylight/{gerrit-project}/* /tmp/t/org/opendaylight/{gerrit-project}/ test -z "`find /tmp/n/ -type f`" || ( echo "ERROR: Mismatched groupId detected (see above)." && false ) @@ -61,12 +82,12 @@ # dist-pom: Relative path to pom file to use. 'distribution/pom.xml' is recommended. builders: - maven-target: - maven-version: 'mvn33' + maven-version: '{mvn-version}' pom: '{dist-pom}' goals: | clean install dependency:tree -DoutputFile=dependency_tree.txt - -Pq + -Pq -Pmanaged -Punmanaged {mvn-opts} java-opts: - '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true' @@ -165,13 +186,13 @@ - shell: | cp -r /tmp/r /tmp/t - maven-target: - maven-version: 'mvn33' + maven-version: '{mvn-version}' pom: '{pom}' goals: | clean install dependency:tree -DoutputFile=dependency_tree.txt -s fake_remotes.xml - -Pq + -Pq -Pmanaged -Punmanaged {mvn-opts} java-opts: - '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true' @@ -191,15 +212,62 @@ # dist-pom: Relative path to pom file to use. 'distribution/pom.xml' is recommended. builders: - maven-target: - maven-version: 'mvn33' + maven-version: '{mvn-version}' pom: '{dist-pom}' goals: | clean install dependency:tree -DoutputFile=dependency_tree.txt -s fake_remotes.xml - -Pq + -Pq -Pmananaged -Punmanaged -Dsft.heap.max=4g -DskipTests=false {mvn-opts} java-opts: - '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true' + +- builder: + name: distribution-check-warn-9191 + # Detect ODL bundles referenced cross-project from features, store them to a file to be archived. + # Do not fail the build, this is just to inform interested contributors. + # TODO: Improve integration archiving macro so that it finds bug_9191 log without us crating it in $WORKSPACE/. + builders: + - shell: | + # No failure in this macro should affect the job result. + set +e + rm -f "$WORKSPACE/bug_9191.log" + pushd "$WORKSPACE/distribution/$KARAF_ARTIFACT/target/assembly/system/org/opendaylight" + for folder in `ls`; do + find "$folder" -name \*features.xml | xargs fgrep -n '' > bug_9191.0.log + fgrep org.opendaylight bug_9191.0.log | fgrep -v "org.opendaylight.$folder" >> "$WORKSPACE/bug_9191.log" + rm bug_9191.0.log + done + popd + +- builder: + name: distribution-check-warn-9192 + # Detect ODL bundles referenced from multiple features within a project, store them to a file to be archived. + # Current implementation will also include Bug 9191 violations, + # presenting an unified diff with lines marked to be removed, among unmarked lines to compare to. + # Do not fail the build, this is just to inform interested contributors. + # TODO: Improve integration archiving macro so that it finds bug_9192 log without us crating it in $WORKSPACE/. + builders: + - shell: | + # No failure in this macro should affect the job result. + set +e + pushd "$WORKSPACE/distribution/$KARAF_ARTIFACT/target/assembly/system/org/opendaylight" + find . -name \*features.xml | xargs fgrep -n '' > "$WORKSPACE/bug_9192.0.log" + popd + fgrep org.opendaylight bug_9192.0.log > "$WORKSPACE/bug_9192.1.log" + sort -s -t '<' -k 2 "$WORKSPACE/bug_9192.1.log" > "$WORKSPACE/bug_9192.2.log" + sort -u -s -t '<' -k 2 "$WORKSPACE/bug_9192.1.log" > "$WORKSPACE/bug_9192.3.log" + diff -U 999 -b -t -d "$WORKSPACE/bug_9192.2.log" "$WORKSPACE/bug_9192.3.log" > "$WORKSPACE/bug_9192.diff.log" + rm -f "$WORKSPACE"/bug_9192.?.log + +- builder: + name: distribution-check-bootup + # Operation: Locally deploy ODL with all fetures, check it is not broken. + # Required bash variables: + # KARAF_VERSION: 'karaf4' or 'karaf3'. + # Use distribution-karaf-version macro to customize. + builders: + - shell: !include-raw: distribution-check-bootup.sh