Skip to content
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

Check whether or not jenkins folder exists in backport branches #9280

Merged
merged 4 commits into from
Mar 6, 2024

Conversation

mrodm
Copy link
Contributor

@mrodm mrodm commented Mar 6, 2024

Proposed commit message

Do not run git add command if the .ci folder does not exist (Jenkins folder)

@mrodm mrodm self-assigned this Mar 6, 2024
@mrodm mrodm requested a review from a team as a code owner March 6, 2024 17:25
Comment on lines +112 to +125
echo "Commiting"
git add $BUILDKITE_FOLDER_PATH
if [ -d "${JENKINS_FOLDER_PATH}" ]; then
git add $JENKINS_FOLDER_PATH
fi
git add $PACKAGES_FOLDER_PATH/
git status

files_cached_num=$(git diff --name-only --cached | wc -l)
if [ "${files_cached_num}" -gt 0 ]; then
git commit -m "Add $BUILDKITE_FOLDER_PATH and $JENKINS_FOLDER_PATH to backport branch: $BACKPORT_BRANCH_NAME from the $SOURCE_BRANCH branch"
else
echo "Nothing to commit, skip."
fi
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run these steps also in DRY_RUN=true mode.

Comment on lines +187 to +189
if [ "${DRY_RUN}" == "true" ]; then
MSG="[DRY_RUN] ${MSG}."
fi
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add DRY_RUN tag to avoid misunderstandings.

@mrodm mrodm merged commit f0b47d0 into elastic:main Mar 6, 2024
2 of 3 checks passed
@mrodm mrodm deleted the fix_backport_branches branch March 6, 2024 17:57
@elasticmachine
Copy link

elasticmachine commented Mar 6, 2024

💔 Build Failed

Failed CI Steps

History

cc @mrodm

@elasticmachine
Copy link

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

Copy link

Quality Gate passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No Coverage information No data about Coverage
No Duplication information No data about Duplication

See analysis details on SonarQube

gizas pushed a commit that referenced this pull request Mar 13, 2024
Add safeguards when running backport branches pipeline, to avoid
errors if ".ci" (jenkins folder) does not exist or if there are no changes
in the stage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants