GitHubContribute in GitHub: Edit online

IBM Quantum Safe Explorer CLI scan Jenkins file sample


# Clone CLI Project 
git clone https://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@github.ibm.com/quantum-safe-engineering/quantum-safe-read-repos.git

#Clone First Project (master branch)
git clone https://github.com/Password4j/password4j-jca.git -b master

# Build First Project & Copy Dependencies
mvn -f password4j-jca/ clean install && mvn -f password4j-jca/ dependency:copy-dependencies

export dependency_path=target/dependency
export class_path=target/classes

# Execute Explorer Scan On First Project
pwd
cwd=$(pwd)
cd quantum-safe-read-repos/CLI
chmod 777 *
./cli.sh -i $cwd/password4j-jca -l .java -da -cf "./$class_path;$cwd/password4j-jca/$dependency_path;" -ef src/test
cd ../..

# Clone Second Project (master branch)
git clone https://github.com/NeilMadden/salty-coffee.git -b master

# Build Second Project & Copy Dependencies
mvn -f salty-coffee/ clean install -DskipTests && mvn -f salty-coffee/ dependency:copy-dependencies

#Read Project Dependencies From Config File
cd quantum-safe-read-repos/CLI
n=1; while IFS= read -r "line$n"; do
  n=$((n + 1))
done < dependency_config.txt
echo $line1

#Validate The Dependent Project and Dependency Location
export dependency_exists=false

if test -d $cwd/$line1; then
  echo "Project Directory Exists."
  if test -d $cwd/$line1/$dependency_path; then
  echo "Project Dependency Exists."
  dependency_exists=true
  fi
fi

# Execute Explorer Scan On Second Project
if $dependency_exists; then
./cli.sh -i $cwd/salty-coffee -l .java -da -cf "./$class_path;$cwd/salty-coffee/$dependency_path;$cwd/$line1/$dependency_path;" -ef src/test
else
echo "Project Dependency Does Not Exist. Scan will Exit"
fi