set +e # Do not affect the build result if some part of archiving fails.
ARCHIVES_DIR="$JENKINS_HOSTNAME/$JOB_NAME/$BUILD_NUMBER"
-LOGS_SERVER="https://logs.opendaylight.org"
+[ "$LOGS_SERVER" ] || LOGS_SERVER="https://logs.opendaylight.org"
+[ "$LOGS_REPO_URL" ] || LOGS_REPO_URL="https://nexus.opendaylight.org/service/local/repositories/logs"
+
echo "Build logs: <a href=\"$LOGS_SERVER/$SILO/$ARCHIVES_DIR\">$LOGS_SERVER/$SILO/$ARCHIVES_DIR</a>"
mkdir .archives
</goals>
<configuration>
<serverId>opendaylight-log-archives</serverId>
- <repositoryUrl>https://nexus.opendaylight.org/service/local/repositories/logs/content-compressed</repositoryUrl>
+ <repositoryUrl>$LOGS_REPO_URL/content-compressed</repositoryUrl>
<file>archives.zip</file>
<repositoryPath>$SILO</repositoryPath>
</configuration>
shopt -u globstar # Disable globstar once archives are copied
popd
fi
+
+
# Ignore logging if archives doesn't exist
mv $WORKSPACE/archives/ $ARCHIVES_DIR > /dev/null 2>&1
touch $ARCHIVES_DIR/_build-details.txt
echo "build-url: ${{BUILD_URL}}" >> $ARCHIVES_DIR/_build-details.txt
env > $ARCHIVES_DIR/_build-enviroment-variables.txt
+# capture system info
+touch $ARCHIVES_DIR/_sys-info.txt
+{{
+ echo -e "uname -a:\n `uname -a` \n"
+ echo -e "df -h:\n `df -h` \n"
+ echo -e "free -m:\n `free -m` \n"
+ echo -e "nproc:\n `nproc` \n"
+ echo -e "lscpu:\n `lscpu` \n"
+ echo -e "ip addr:\n `/sbin/ip addr` \n"
+}} 2>&1 | tee -a $ARCHIVES_DIR/_sys-info.txt
+
# Magic string used to trim console logs at the appropriate level during wget
echo "-----END_OF_BUILD-----"
wget -O $ARCHIVES_DIR/_console-output.log ${{BUILD_URL}}consoleText