Skip to content
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6c74c1d
feat: add uploadPackages function skeleton
mattdibi Sep 9, 2025
18f1b9c
debug: always upload to debug pipeline
mattdibi Sep 9, 2025
7f111fe
fix: avoid using findFiles
mattdibi Sep 9, 2025
e86cd2b
fix: missing }
mattdibi Sep 9, 2025
17b8de7
fix: avoid using missing plugin
mattdibi Sep 9, 2025
0131441
fix: remove unnecessary step
mattdibi Sep 9, 2025
d2ac577
fix: maven metadata read
mattdibi Sep 9, 2025
c99b604
fix: distrib module retrieval
mattdibi Sep 9, 2025
9906f99
fix: again
mattdibi Sep 9, 2025
c1dfe1c
fix: (-..-)
mattdibi Sep 9, 2025
0fe222d
fix: hardcode distribution and module
mattdibi Sep 9, 2025
883aee3
debug: add print log
mattdibi Sep 9, 2025
8457138
fix: variable interpolation
mattdibi Sep 9, 2025
f7dd094
fix: remove unnecessary stuff
mattdibi Sep 9, 2025
8303cb9
fix: remove unnecessary check for files
mattdibi Sep 11, 2025
6ac1186
feat: restore distrib and module autodetection
mattdibi Sep 11, 2025
f014541
fix: escaping
mattdibi Sep 11, 2025
ba33e15
fix: switch back
mattdibi Sep 11, 2025
a645455
fix: get last line only
mattdibi Sep 11, 2025
efc6ed3
fix: grab last line
mattdibi Sep 11, 2025
9dc276e
docs: add explaination
mattdibi Sep 11, 2025
b08d328
refactor: readability
mattdibi Sep 11, 2025
bde97c9
refactor: use "Pipeline Utility Steps" plugin
mattdibi Oct 2, 2025
6d2accb
fix: use correct dev repository
mattdibi Oct 10, 2025
6244378
fix: fail the job if upload fails
mattdibi Oct 10, 2025
ce86b90
fix: syntax error
mattdibi Oct 10, 2025
0c0b9b1
fix: retrieve actual status
mattdibi Oct 10, 2025
82e4365
fix: scope
mattdibi Oct 10, 2025
ddd78b6
fix: correct expectation
mattdibi Oct 10, 2025
240309b
fix: production setup
mattdibi Oct 10, 2025
bccdc73
Update vars/uploadPackages.groovy
mattdibi Oct 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions vars/continuousIntegrationPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,23 @@ def call(Map pipelineParams = [:]) {
}
}

stage ("Deploy on Nexus Repository") {
// Call uploadPackages only if we are on the default branch,
// if we have DEB packages to upload and if the user has set the pushArtifacts parameter to true
if (env.BRANCH_IS_PRIMARY && pipelineParams.pushArtifacts) {
echo "Uploading DEB packages..."

def distribPom = readMavenPom file: 'workdir/distrib/pom.xml'

def repoDistribution = distribPom.properties['kura.repo.distribution']
def repoModule = distribPom.properties['kura.repo.module']

uploadPackages(repoDistribution, repoModule)
} else {
echo "Skipping DEB packages upload."
Utils.markStageSkippedForConditional(STAGE_NAME)
}
}

stage ("Archive artifacts") {
dir("workdir") {
Expand Down
50 changes: 50 additions & 0 deletions vars/uploadPackages.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
def call(String repoDistribution, String repoModule, Boolean setupPromotion = false) {
stage ("Upload packages parameters check") {
echo "Distribution: ${repoDistribution}"
echo "Module: ${repoModule}"

// Check "distribution" parameter is set and valid
assert repoDistribution instanceof String
assert repoDistribution ==~ /kura-\d+/

// Check "module" parameter is set and valid
def valid_modules = [
"base"
]

assert repoModule instanceof String
assert valid_modules.contains(repoModule)
}

stage("Upload .deb packages to Artifactory") {
Comment thread
mattdibi marked this conversation as resolved.
Outdated
def debFiles = findFiles(glob: 'workdir/**/*.deb')

if (debFiles.size() == 0) {
error("No .deb files found to upload")
}

debFiles.each {
withCredentials([usernameColonPassword(credentialsId: 'repo.eclipse.org-bot-account', variable: 'USERPASS')]) {
def status = sh(
script: """
curl -u \"\$USERPASS\" \
-w '%{http_code}' \
-H \"Content-Type: multipart/form-data\" \
--data-binary \"@./${it}\" \
\"https://repo3.eclipse.org/repository/kura-apt-dev/\" \
-o /dev/null
""",
returnStdout: true
).trim()

if (status != "201") {
error("Returned status code = $status")
}
}
}

if (setupPromotion) {
// TODO
}
}
}