-
Notifications
You must be signed in to change notification settings - Fork 0
feat: upload DEP packages on Kura APT repository #6
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
Merged
Merged
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 18f1b9c
debug: always upload to debug pipeline
mattdibi 7f111fe
fix: avoid using findFiles
mattdibi e86cd2b
fix: missing }
mattdibi 17b8de7
fix: avoid using missing plugin
mattdibi 0131441
fix: remove unnecessary step
mattdibi d2ac577
fix: maven metadata read
mattdibi c99b604
fix: distrib module retrieval
mattdibi 9906f99
fix: again
mattdibi c1dfe1c
fix: (-..-)
mattdibi 0fe222d
fix: hardcode distribution and module
mattdibi 883aee3
debug: add print log
mattdibi 8457138
fix: variable interpolation
mattdibi f7dd094
fix: remove unnecessary stuff
mattdibi 8303cb9
fix: remove unnecessary check for files
mattdibi 6ac1186
feat: restore distrib and module autodetection
mattdibi f014541
fix: escaping
mattdibi ba33e15
fix: switch back
mattdibi a645455
fix: get last line only
mattdibi efc6ed3
fix: grab last line
mattdibi 9dc276e
docs: add explaination
mattdibi b08d328
refactor: readability
mattdibi bde97c9
refactor: use "Pipeline Utility Steps" plugin
mattdibi 6d2accb
fix: use correct dev repository
mattdibi 6244378
fix: fail the job if upload fails
mattdibi ce86b90
fix: syntax error
mattdibi 0c0b9b1
fix: retrieve actual status
mattdibi 82e4365
fix: scope
mattdibi ddd78b6
fix: correct expectation
mattdibi 240309b
fix: production setup
mattdibi bccdc73
Update vars/uploadPackages.groovy
mattdibi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") { | ||
| 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 | ||
| } | ||
| } | ||
| } | ||
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.
Uh oh!
There was an error while loading. Please reload this page.