Skip to content

Commit

Permalink
more log4j and sonar nonsense preping docker
Browse files Browse the repository at this point in the history
  • Loading branch information
mubaldino committed Dec 31, 2021
1 parent 8b2e79c commit 5291040
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
4 changes: 4 additions & 0 deletions Examples/Docker/Dockerfile.offline
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ RUN cd ./Core && mvn -o install -Dmaven.repo.local=$LOCAL_REPO
RUN mvn -o -Dopensextant.solr=./xponents-solr/solr7 \
-Dmaven.repo.local=$LOCAL_REPO clean package dependency:copy-dependencies

# 1a. Log4J cleanup
RUN for log4jdir in `find $LOCAL_REPO -type d | grep log4j | grep "2.11"`; do rm -rf $log4jdir; done


# 2. Copy built items and metadata from install to final runtime CLASSPATH ./lib
RUN cp ./target/*jar ./lib/

Expand Down
17 changes: 11 additions & 6 deletions script/dist-docker-offline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ VERSION="3.5"
script=`dirname $0;`
basedir=`cd -P $script/..; echo $PWD`


run_sonar=0
SONAR_URL=http://localhost:9000
if [ -n "$1" ]; then
SONAR_URL=$1
if [ -n "$2" ] ; then
SONAR_TOKEN=$2
# run sonar only if command line args are given
run_sonar=1
else
echo "Usage: $0 SONAR_URL SONAR_TOKEN"
echo
Expand Down Expand Up @@ -62,7 +66,7 @@ echo "++++++++++++++++ EXAMPLES ++++++++++++++++"


# Code scan using Sonarqube:
if [ -n "$SONAR_TOKEN" ]; then
if [ $run_sonar -eq 1 ]; then

git init
git add .gitignore pom.xml Core/pom.xml Core/src src script python
Expand All @@ -89,11 +93,6 @@ if [ -n "$SONAR_TOKEN" ]; then
fi


# Log4J cleanup
for log4jdir in `find ./maven-repo -type d | grep log4j | grep "2.11"`; do
echo "Remove $log4jdir"
rm -rf $log4jdir
done

# One last time: go-offline
# -- Remove cache files from any Internet downloads
Expand All @@ -102,6 +101,12 @@ find ./$REPO -name "*.sha1" -exec rm {} \;
find ./$REPO -name "*.repositories" -exec rm {} \;
mvn dependency:go-offline -Dmaven.repo.local=$REPO

# Log4J cleanup
for log4jdir in `find ./maven-repo -type d | grep log4j | grep "2.11"`; do
echo "Remove $log4jdir"
rm -rf $log4jdir
done


# Docker
echo "++++++++++++++++ DOCKER / Maven Offline ++++++++++++++++"
Expand Down
2 changes: 1 addition & 1 deletion script/dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ rm -r $REL/xponents-solr/retired
rm -r $REL/xponents-solr/script/__pycache__
rm -f $REL/xponents-solr/solr7-dist/licenses/log4j*2.11*

cp -r $basedir/dev.env $basedir/Examples/Docker/* $REL/
cp -r $basedir/.gitignore $basedir/dev.env $basedir/Examples/Docker/* $REL/
rm -r $REL/Sonarqube

# Distro has API docs in JAR files.
Expand Down

0 comments on commit 5291040

Please sign in to comment.