Skip to content

Commit

Permalink
Handle a_ and b_ in incremental version numbers (#20)
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Jacomb <[email protected]>
  • Loading branch information
jglick and timja authored Dec 28, 2021
1 parent f9961b3 commit 7813981
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ module.exports = {
*/
getArchiveUrl: (build_url, hash) => {
let shortHash = hash.substring(0, 12);
return build_url + 'artifact/**/*' + shortHash + '*/*' + shortHash + '*/*zip*/archive.zip';
// https://github.com/jenkinsci/incrementals-tools/pull/24
let versionPattern = shortHash.replace(/[ab]/g, '$&*');
return build_url + 'artifact/**/*' + versionPattern + '*/*' + versionPattern + '*/*zip*/archive.zip';
}
};
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "incrementals-publisher",
"version": "1.4.1",
"version": "1.4.2",
"description": "",
"private": true,
"main": "index.js",
Expand Down
3 changes: 1 addition & 2 deletions test/pipeline-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ describe('The Pipeline helpers', () => {
it('should generate an archive.zip URL', () => {
let hash = 'acbd4';
const url = pipeline.getArchiveUrl(build_url, hash);
assert.ok(url);
assert.ok(url.match('archive.zip$'));
assert.strictEqual(url, 'https://ci.jenkins.io/job/structs-plugin/job/PR-36/3/artifact/**/*a*cb*d4*/*a*cb*d4*/*zip*/archive.zip');
});
});

Expand Down

0 comments on commit 7813981

Please sign in to comment.