Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
coutoPL committed Nov 20, 2023
2 parents 4d79442 + c0a8b03 commit 9b25c75
Show file tree
Hide file tree
Showing 911 changed files with 21,683 additions and 7,290 deletions.
8 changes: 1 addition & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
FROM openjdk:17.0.2-jdk

RUN microdnf install wget &&\
microdnf install unzip &&\
wget https://services.gradle.org/distributions/gradle-7.6.2-bin.zip &&\
unzip -d /opt/gradle gradle-7.6.2-bin.zip &&\
export PATH=$PATH:/opt/gradle/gradle-7.6.2/bin
FROM openjdk:21-jdk

COPY ./ /ror
WORKDIR /ror
Expand Down
14 changes: 5 additions & 9 deletions audit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,10 @@ dependencyCheck {
suppressionFiles = ["${project.rootDir}/supressions_cve.xml"]
}

compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}

compileScala {
sourceCompatibility = 1.8
targetCompatibility = 1.8
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

crossBuild {
Expand All @@ -68,7 +64,7 @@ crossBuild {
}

dependencies {
implementation group: 'org.json', name: 'json', version: '20230227'
implementation group: 'org.json', name: 'json', version: '20231013'
crossBuildV211Implementation group: 'org.scala-lang', name: 'scala-library', version: '2.11.12'
crossBuildV212Implementation group: 'org.scala-lang', name: 'scala-library', version: '2.12.17'
crossBuildV213Implementation group: 'org.scala-lang', name: 'scala-library', version: '2.13.11'
Expand Down
36 changes: 16 additions & 20 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ stages:
- script: |
echo ">> ALL BUILD* VARIABLES " && export | grep BUILD
echo "[CVE] executing ROR_TASK=$ROR_TASK"
bin/build.sh
bin/run-pipeline.sh
continueOnError: true
env:
ROR_TASK: cve_check
Expand All @@ -76,7 +76,7 @@ stages:
export aws_secret_access_key=$var_aws_secret_access_key
echo "[TEST] executing ROR_TASK = $ROR_TASK"
bin/build.sh
bin/run-pipeline.sh
env:
var_aws_access_key_id: $(aws_access_key_id)
var_aws_secret_access_key: $(aws_secret_access_key)
Expand Down Expand Up @@ -108,7 +108,7 @@ stages:
export aws_secret_access_key=$var_aws_secret_access_key
echo "[TEST] executing ROR_TASK = $ROR_TASK"
bin/build.sh
bin/run-pipeline.sh
env:
var_aws_access_key_id: $(aws_access_key_id)
var_aws_secret_access_key: $(aws_secret_access_key)
Expand All @@ -121,6 +121,8 @@ stages:
strategy:
maxParallel: 99
matrix:
IT_es811x:
ROR_TASK: integration_es811x
IT_es810x:
ROR_TASK: integration_es810x
IT_es89x:
Expand Down Expand Up @@ -156,7 +158,7 @@ stages:
export aws_secret_access_key=$var_aws_secret_access_key
echo "[TEST] executing ROR_TASK = $ROR_TASK"
bin/build.sh
bin/run-pipeline.sh
env:
var_aws_access_key_id: $(aws_access_key_id)
var_aws_secret_access_key: $(aws_secret_access_key)
Expand All @@ -169,8 +171,8 @@ stages:
strategy:
maxParallel: 99
matrix:
IT_es810x:
ROR_TASK: integration_es810x
IT_es811x:
ROR_TASK: integration_es811x
IT_es80x:
ROR_TASK: integration_es80x
- job:
Expand All @@ -187,7 +189,7 @@ stages:
export aws_secret_access_key=$var_aws_secret_access_key
echo "[TEST] executing ROR_TASK = $ROR_TASK"
bin/build.sh
bin/run-pipeline.sh
env:
var_aws_access_key_id: $(aws_access_key_id)
var_aws_secret_access_key: $(aws_secret_access_key)
Expand Down Expand Up @@ -252,7 +254,7 @@ stages:
export aws_secret_access_key=$var_aws_secret_access_key
echo "[TEST] executing ROR_TASK = $ROR_TASK"
bin/build.sh
bin/run-pipeline.sh
env:
var_aws_access_key_id: $(aws_access_key_id)
var_aws_secret_access_key: $(aws_secret_access_key)
Expand Down Expand Up @@ -296,7 +298,7 @@ stages:
export aws_secret_access_key=$var_aws_secret_access_key
echo "[BLD_TEST] executing ROR_TASK = $ROR_TASK"
echo ">>> ($ROR_TASK) Creating deliverables" && bin/build.sh
echo ">>> ($ROR_TASK) Creating deliverables" && bin/run-pipeline.sh
env:
var_aws_access_key_id: $(aws_access_key_id)
var_aws_secret_access_key: $(aws_secret_access_key)
Expand All @@ -320,7 +322,7 @@ stages:
export aws_secret_access_key=$var_aws_secret_access_key
echo "[BLD_TEST] executing ROR_TASK = $ROR_TASK"
echo ">>> ($ROR_TASK) Creating deliverables" && bin/build.sh
echo ">>> ($ROR_TASK) Creating deliverables" && bin/run-pipeline.sh
env:
var_aws_access_key_id: $(aws_access_key_id)
var_aws_secret_access_key: $(aws_secret_access_key)
Expand Down Expand Up @@ -354,11 +356,6 @@ stages:
sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
displayName: 'Install Sudo in container #HACK - See https://github.com/microsoft/azure-pipelines-agent/issues/2043'
- script: |
/tmp/docker exec -t -u 0 ci-container \
sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
displayName: 'Install Sudo in container #HACK - See https://github.com/microsoft/azure-pipelines-agent/issues/2043'
- task: Bash@3
inputs:
targetType: 'inline'
Expand All @@ -375,7 +372,7 @@ stages:
export aws_secret_access_key=$var_aws_secret_access_key
echo "[S3_UP] executing ROR_TASK = $ROR_TASK"
echo ">>> ($ROR_TASK) Creating deliverables to be published" && bin/build.sh
echo ">>> ($ROR_TASK) Creating deliverables to be published" && bin/run-pipeline.sh
echo ">>> ($ROR_TASK) Git tag and upload to S3" && ci/ci-deploy.sh
env:
var_aws_access_key_id: $(aws_access_key_id)
Expand All @@ -386,7 +383,6 @@ stages:
matrix:
PKG_es8xx:
ROR_TASK: package_es8xx

- job:
steps:
- checkout: self
Expand All @@ -404,7 +400,7 @@ stages:
echo ">> ALL BUILD* VARIABLES " && export | grep BUILD
echo "[S3_UP] executing ROR_TASK = $ROR_TASK"
echo ">>> ($ROR_TASK) Creating deliverables to be published" && bin/build.sh
echo ">>> ($ROR_TASK) Creating deliverables to be published" && bin/run-pipeline.sh
echo ">>> ($ROR_TASK) Tag and upload to S3" && ci/ci-deploy.sh
env:
var_aws_access_key_id: $(aws_access_key_id)
Expand All @@ -431,7 +427,7 @@ stages:
persistCredentials: true
- script: |
echo "[MVN_COMPILE] executing ROR_TASK = $ROR_TASK"
bin/build.sh
bin/run-pipeline.sh
env:
ROR_TASK: audit_compile
Expand Down Expand Up @@ -485,7 +481,7 @@ stages:
export MAVEN_STAGING_PROFILE_ID=$VAR_MAVEN_STAGING_PROFILE_ID
export GPG_KEY_ID=$VAR_GPG_KEY_ID
export GPG_PASSPHRASE=$VAR_GPG_PASSPHRASE
echo ">>> ($ROR_TASK) Publishing artifacts" && bin/build.sh
echo ">>> ($ROR_TASK) Publishing artifacts" && bin/run-pipeline.sh
env:
ROR_TASK: publish_artifacts
VAR_MAVEN_REPO_PASSWORD: $(MAVEN_REPO_PASSWORD)
Expand Down
32 changes: 8 additions & 24 deletions bin/build-ror-plugin.sh
Original file line number Diff line number Diff line change
@@ -1,36 +1,20 @@
#!/bin/bash
#!/bin/bash -e

if [[ $# -eq 0 ]] ; then
echo "Please pass to the script an ES version you'd like to build ROR for"
echo "Please pass to the script an ES version you\'d like to build ROR for"
exit 1
fi

version() {
echo "$@" | awk -F. '{ printf("%d%03d%03d\n", $1,$2,$3); }';
}
export -f version

vergte() {
[ $(version $1) -ge $(version $2) ]
}
export -f vergte
cd "$(dirname "$0")/.."

mkdir -p builds
rm -r builds/*
rm -r builds/* || true

for arg in "$@"; do
ES_VERSION=$arg
echo "Building ROR for ES_VERSION $ES_VERSION:"

ES_MODULE=$(ls | \
grep -Ei '^es[0-9]+x$' | \
sed "s/^es\([0-9]\)\([0-9]*\)x$/\1.\2.0 $ES_VERSION es\1\2x/" | \
sort -Vr | \
awk '{ if (system("vergte " $2 " " $1) == 0) { print $3 } }' | \
head -1)

echo "Building ROR for ES_VERSION: $ES_VERSION (using ES_MODULE: $ES_MODULE):"

./gradlew clean --stacktrace $ES_MODULE:ror '-PesVersion='$ES_VERSION
./gradlew clean --stacktrace --info buildRorPlugin '-PesVersion='"$ES_VERSION"

cp $ES_MODULE/build/distributions/readonlyrest-*es$ES_VERSION.zip* builds
done
cp es*/build/distributions/readonlyrest-*es"$ES_VERSION".zip* builds
done
Loading

0 comments on commit 9b25c75

Please sign in to comment.