Skip to content

Commit

Permalink
Support git hash in [nexus] SNAPSHOT version (#6369)
Browse files Browse the repository at this point in the history
* support nexus SNAPSHOT with hash

* lowercase hashes
  • Loading branch information
seglo authored Apr 9, 2021
1 parent b1fc492 commit 99b676a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion services/nexus/nexus-version.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

function isSnapshotVersion(version) {
const pattern = /(\d+\.)*\d-SNAPSHOT/
const pattern = /(\d+\.)*[0-9a-f]-SNAPSHOT/
return version && version.match(pattern)
}

Expand Down
16 changes: 16 additions & 0 deletions services/nexus/nexus.tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,22 @@ t.create('Nexus 2 - snapshot version with + in version')
message: isVersion,
})

t.create('Nexus 2 - snapshot version with + and hex hash in version')
.get(
'/s/com.typesafe.akka/akka-stream-kafka_2.13.json?server=https://repository.jboss.org/nexus'
)
.intercept(nock =>
nock('https://repository.jboss.org/nexus')
.get('/service/local/lucene/search')
.query({ g: 'com.typesafe.akka', a: 'akka-stream-kafka_2.13' })
.reply(200, { data: [{ version: '2.1.0-M1+58-f25047fc-SNAPSHOT' }] })
)
.expectBadge({
label: 'nexus',
color: 'orange',
message: isVersion,
})

t.create('Nexus 2 - search snapshot version not in latestSnapshot')
.get(
'/s/com.progress.fuse/fusehq.json?server=https://repository.jboss.org/nexus'
Expand Down

0 comments on commit 99b676a

Please sign in to comment.