Skip to content

Commit

Permalink
feat(TCOMP-2554): Restore extraBuildParams in release script (#814)
Browse files Browse the repository at this point in the history
https://jirRestore extraBuildParams in release script
https://jira.talendforge.org/browse/TCOMP-2554

Why this PR is needed?
The CI was using env var to pass args to the release script.
After CI evolution this env var was not accessible anymore, this PR restore the functionality using script parameter instead of env var.

What does this PR adds (design/code thoughts)?
Add parameter to release.sha.talendforge.org/browse/TCOMP-2554
  • Loading branch information
acatoire committed Oct 25, 2023
1 parent 621f79f commit 085ced8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions .jenkins/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ set -xe
# Parameters:
# $1: Branch
# $2: current version
# $3: extra build args for all mvn cmd
main() {
local branch="${1?Missing branch}"
local currentVersion="${2?Missing project version}"
local extraBuildParams="${3}"


local release="${currentVersion/-SNAPSHOT/}"
local tag=component-runtime-"${release}"
# bump
Expand Down Expand Up @@ -58,15 +62,15 @@ main() {
--define developmentVersion="${dev_version}" \
--define arguments="-DskipTests -DskipITs" \
--activate-profiles ossrh,release,gpg2 \
${EXTRA_BUILD_ARGS} \
${extraBuildParams} \
--settings .jenkins/settings.xml
echo ">> Maven perform release $release"
mvn release:perform \
--batch-mode \
--errors \
--define arguments="-DskipTests -DskipITs" \
--activate-profiles ossrh,release,gpg2 \
${EXTRA_BUILD_ARGS} \
${extraBuildParams} \
--settings .jenkins/settings.xml
###
echo ">> Reset repo"
Expand All @@ -84,7 +88,7 @@ main() {
echo ">> Rebuilding ${branch} and updating it (doc) for next iteration"
git reset --hard
git checkout "${branch}"
mvn clean install -DskipTests -Dinvoker.skip=true ${EXTRA_BUILD_ARGS} || true
mvn clean install -DskipTests -Dinvoker.skip=true ${extraBuildParams} || true
git commit -a -m ">> Updating doc for next iteration" || true
git push -u origin "${branch}" || true
###
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ pipeline {
configFileProvider([configFile(fileId: 'maven-settings-nexus-zl', variable: 'MAVEN_SETTINGS')]) {
sh """\
#!/usr/bin/env bash
bash .jenkins/scripts/release.sh $branch_name $finalVersion
bash .jenkins/scripts/release.sh $branch_name $finalVersion $extraBuildParams
""".stripIndent()
}
}
Expand Down

0 comments on commit 085ced8

Please sign in to comment.