Multibranch pipeline Workspace env var fix and refactoring the code #151
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.
Description
Previously, we had implemented a code that was functional for a "FreeStyle" type of pipeline, but when we attempted to run it on a "Multi Branch" pipeline, we encountered some issues. After some investigation, we discovered that the root cause of the problem was the "${WORKSPACE}" variable not being properly resolved during runtime for the multi-branch pipeline. We determined that we needed to explicitly add this environment variable to the pipeline to ensure it was correctly resolved. By doing so, we were able to resolve the issue and enable the code to function properly on both the "FreeStyle" and "Multi Branch" pipelines.
Error

Environment variables which don't contain the WORKSPACE

Fixed Plugin Console output

Relevant Jira
TS-2119 Unable to pack the windows project in multi-branch pipeline project in Jenkins