-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bwc.checkout.align parameter support in gradle-check #451
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
pipeline { | ||
agent none | ||
stages { | ||
stage('gradle-check') { | ||
steps { | ||
script { | ||
runGradleCheck( | ||
gitRepoUrl: "https://github.com/opensearch-project/OpenSearch", | ||
gitReference: "main", | ||
bwcCheckoutAlign: "true" | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
RunGradleCheckBwcAlign_Jenkinsfile.run() | ||
RunGradleCheckBwcAlign_Jenkinsfile.pipeline(groovy.lang.Closure) | ||
RunGradleCheckBwcAlign_Jenkinsfile.echo(Executing on agent [label:none]) | ||
RunGradleCheckBwcAlign_Jenkinsfile.stage(gradle-check, groovy.lang.Closure) | ||
RunGradleCheckBwcAlign_Jenkinsfile.script(groovy.lang.Closure) | ||
RunGradleCheckBwcAlign_Jenkinsfile.runGradleCheck({gitRepoUrl=https://github.com/opensearch-project/OpenSearch, gitReference=main, bwcCheckoutAlign=true}) | ||
runGradleCheck.legacySCM(groovy.lang.Closure) | ||
runGradleCheck.library({identifier=jenkins@main, retriever=null}) | ||
runGradleCheck.usernamePassword({credentialsId=jenkins-gradle-check-s3-aws-credentials, usernameVariable=amazon_s3_access_key, passwordVariable=amazon_s3_secret_key}) | ||
runGradleCheck.usernamePassword({credentialsId=jenkins-gradle-check-s3-aws-resources, usernameVariable=amazon_s3_base_path, passwordVariable=amazon_s3_bucket}) | ||
runGradleCheck.withCredentials([[amazon_s3_access_key, amazon_s3_secret_key], [amazon_s3_base_path, amazon_s3_bucket]], groovy.lang.Closure) | ||
runGradleCheck.sh( | ||
#!/bin/bash | ||
|
||
set -e | ||
set +x | ||
|
||
echo "Git clone: https://github.com/opensearch-project/OpenSearch with ref: main" | ||
rm -rf search | ||
git clone https://github.com/opensearch-project/OpenSearch search | ||
cd search/ | ||
git checkout -f main | ||
git rev-parse HEAD | ||
|
||
echo "Get Major Version" | ||
OS_VERSION=`cat buildSrc/version.properties | grep opensearch | cut -d= -f2 | grep -oE '[0-9.]+'` | ||
JDK_MAJOR_VERSION=`cat buildSrc/version.properties | grep "bundled_jdk" | cut -d= -f2 | grep -oE '[0-9]+' | head -n 1` | ||
OS_MAJOR_VERSION=`echo $OS_VERSION | grep -oE '[0-9]+' | head -n 1` | ||
echo "Version: $OS_VERSION, Major Version: $OS_MAJOR_VERSION" | ||
|
||
echo "Using JAVA $JDK_MAJOR_VERSION" | ||
eval export JAVA_HOME='$JAVA'$JDK_MAJOR_VERSION'_HOME' | ||
|
||
env | grep JAVA | grep HOME | ||
|
||
echo "Gradle clean cache and stop existing gradledaemon" | ||
./gradlew --stop | ||
rm -rf ~/.gradle | ||
|
||
if command -v docker > /dev/null; then | ||
echo "Check existing dockercontainer" | ||
docker ps -a | ||
docker stop `docker ps -qa` > /dev/null 2>&1 || echo | ||
docker rm --force `docker ps -qa` > /dev/null 2>&1 || echo | ||
echo "Stop existing dockercontainer" | ||
docker ps -a | ||
|
||
echo "Check docker-compose version" | ||
docker-compose version | ||
fi | ||
|
||
echo "Check existing processes" | ||
ps -ef | grep [o]pensearch | wc -l | ||
echo "Cleanup existing processes" | ||
kill -9 `ps -ef | grep [o]pensearch | awk '{print $2}'` > /dev/null 2>&1 || echo | ||
ps -ef | grep [o]pensearch | wc -l | ||
|
||
echo "Start gradlecheck" | ||
GRADLE_CHECK_STATUS=0 | ||
./gradlew clean && ./gradlew check -Dtests.coverage=true -Dbwc.checkout.align=true --no-daemon --no-scan || GRADLE_CHECK_STATUS=1 | ||
|
||
if [ "$GRADLE_CHECK_STATUS" != 0 ]; then | ||
echo Gradle Check Failed! | ||
exit 1 | ||
fi | ||
|
||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the below suggestion make it less confusing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add it when it is set to false by default.
Honestly doesn't make any difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just in case the default value changes in OpenSearch repo, it will be easier to debug using the command in the gradle check run. Your call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like at the moment we can keep it removed if false, since it is the origin behavior unchanged.