-
Notifications
You must be signed in to change notification settings - Fork 1
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 template for compare xml job #3
base: master
Are you sure you want to change the base?
Conversation
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 was thinking on doing that comparison a bit differently.
Instead working in the same workdir with two different commits, we just checkout the same repo twice into two different subfolders.
destinationBranch to dest/ and PR to pr/ and then run tox two times in exh of the subfolders.
The trade-off is that we need to checkout the same repo twice, but then it will simplify the bash logic a lot and we get much cleaner logic in the end.
Well, I just ported stuff we had before. |
1166eb1
to
d9d7e58
Compare
This patch adds template and couple of useful macro for performing xml comparisements of JJ changes
virtualenv venv | ||
source venv/bin/activate | ||
pip install pip --upgrade | ||
pip install tox |
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.
IMHO: this is node configuration and it is not responsibility of this script.
mv "./output/${ENV##*/}" "./output/jobs/new/${ENV##*/}" | ||
done | ||
|
||
compare_xml() { |
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.
the function declaration break flow of main logic, and it is hard to read this script.
It would be better to move this function in top of file or just remove it, because there is only one place where this function is called.
@@ -0,0 +1,67 @@ | |||
- job-template: |
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.
IMHO: this job is related to stash and its name or location should reflect this fact.
host: '{host}' | ||
username: '{username}' | ||
password: '{password}' | ||
credentials-id: '{credentials-id}' |
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.
no newline at end of file.
password: '' | ||
|
||
jobs: | ||
- library/compare-xml |
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.
no newline at end of file.
ADDED="[added]<br>" | ||
REMOVED="[removed]<br>" | ||
|
||
DIFF=$(diff -q -r -u "${OUT_DIR}/old" "${OUT_DIR}/new" &>"${LOGFILE}"; echo "${?}") |
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.
The layout of output folder is out of scope of the compare+xml function. Thus instead of ${OUT_DIR}
, ${OUT_DIR}/old
and ${OUT_DIR}/old
we should have FROM_DIR
and $TO_DIR
or A_DIR and B_DIR as diff usually uses this naming.
I would also move comparison function to a separate utils/compare.sh script. And call it in the JJB step as ./utils/compare.sh output/new output/old > report.html
This patch adds template and couple of useful macro
for performing xml comparisements of JJ changes