Update
ci/woodpecker/push/woodpecker Pipeline was successful
Podrobnosti
ci/woodpecker/push/woodpecker Pipeline was successful
Podrobnosti
This commit is contained in:
rodič
cfd52dfca3
revize
47a995783b
|
@ -25,6 +25,16 @@ function defaultOptions(conf) {
|
|||
return opts
|
||||
}
|
||||
|
||||
async function ghRequest (url, conf, all) {
|
||||
const req = await fetch('https://api.github.com/'+url, {
|
||||
headers: {
|
||||
Authorization: `Token ${process.env.GWEICZ_GH_TOKEN}`
|
||||
}
|
||||
})
|
||||
const resp = await req.json()
|
||||
return resp
|
||||
}
|
||||
|
||||
const strategies = {
|
||||
async default (conf, all) {
|
||||
const options = conf.options || {}
|
||||
|
@ -33,13 +43,17 @@ const strategies = {
|
|||
return jsonata(conf.query).evaluate(resp)
|
||||
},
|
||||
async github (conf, all) {
|
||||
const req = await fetch('https://api.github.com/repos/@@/releases/latest'.replace(/@@/, all.repo), {
|
||||
headers: {
|
||||
Authorization: `Token ${process.env.GWEICZ_GH_TOKEN}`
|
||||
const resp = await ghRequest('repos/@@/releases/latest'.replace(/@@/, all.repo), conf, all)
|
||||
return jsonata('$match(tag_name,/^v(ersion\/|)(.+)/)[0].groups[1]').evaluate(resp)
|
||||
},
|
||||
async github_tags (conf, all) {
|
||||
const resp = await ghRequest('repos/@@/tags'.replace(/@@/, all.repo), conf, all)
|
||||
for (const t of resp) {
|
||||
let match = t.name.match(/^v(.+)/)
|
||||
if (match) {
|
||||
return match[1]
|
||||
}
|
||||
})
|
||||
const resp = await req.json()
|
||||
return jsonata('$match(tag_name,/^v(.+)/)[0].groups[0]').evaluate(resp)
|
||||
}
|
||||
},
|
||||
async html (conf, all) {
|
||||
const req = await fetch(conf.url)
|
||||
|
|
|
@ -104,7 +104,7 @@ services:
|
|||
url: https://forum.gwei.cz
|
||||
query: 'content="Discourse ([^\s]+) -'
|
||||
to:
|
||||
strategy: github
|
||||
strategy: github_tags
|
||||
|
||||
- name: Discourse (dCZK)
|
||||
host: forum.dczk.cz
|
||||
|
@ -117,7 +117,7 @@ services:
|
|||
url: https://forum.dczk.cz
|
||||
query: 'content="Discourse ([^\s]+) -'
|
||||
to:
|
||||
strategy: github
|
||||
strategy: github_tags
|
||||
|
||||
- name: SFTPGo
|
||||
host: sftpgo.gwei.cz
|
||||
|
@ -142,8 +142,7 @@ services:
|
|||
url: https://auth.gwei.cz/api/v3/admin/version/
|
||||
query: 'version_current'
|
||||
to:
|
||||
url: https://auth.gwei.cz/api/v3/admin/version/
|
||||
query: 'version_latest'
|
||||
strategy: github
|
||||
|
||||
- name: Jitsi
|
||||
host: meet.gwei.cz
|
||||
|
@ -235,7 +234,7 @@ services:
|
|||
env: GWEICZ_PRETIX_TOKEN
|
||||
query: pretix
|
||||
to:
|
||||
strategy: github
|
||||
strategy: github_tags
|
||||
|
||||
- name: Plausible
|
||||
host: analytics.gwei.cz
|
||||
|
@ -246,4 +245,4 @@ services:
|
|||
strategy: html
|
||||
url: http://analytics.gwei.cz/
|
||||
to:
|
||||
strategy: github
|
||||
strategy: github_tags
|
||||
|
|
Načítá se…
Odkázat v novém úkolu