Update
ci/woodpecker/push/woodpecker Pipeline was successful
Podrobnosti
ci/woodpecker/push/woodpecker Pipeline was successful
Podrobnosti
This commit is contained in:
rodič
2fb93c6671
revize
2ad67fc507
|
@ -1,3 +1,4 @@
|
||||||
node_modules
|
node_modules
|
||||||
.DS_Store
|
.DS_Store
|
||||||
build
|
build
|
||||||
|
.env
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hapi/hapi": "^20.2.2"
|
"@hapi/hapi": "^20.2.2",
|
||||||
|
"dotenv": "^16.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@hapi/accept": {
|
"node_modules/@hapi/accept": {
|
||||||
|
@ -299,6 +300,14 @@
|
||||||
"@hapi/hoek": "9.x.x"
|
"@hapi/hoek": "9.x.x"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/dotenv": {
|
||||||
|
"version": "16.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
|
||||||
|
"integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/mime-db": {
|
"node_modules/mime-db": {
|
||||||
"version": "1.52.0",
|
"version": "1.52.0",
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||||
|
@ -584,6 +593,11 @@
|
||||||
"@hapi/hoek": "9.x.x"
|
"@hapi/hoek": "9.x.x"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"dotenv": {
|
||||||
|
"version": "16.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
|
||||||
|
"integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ=="
|
||||||
|
},
|
||||||
"mime-db": {
|
"mime-db": {
|
||||||
"version": "1.52.0",
|
"version": "1.52.0",
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
"": {
|
"": {
|
||||||
"name": "gweicz-services",
|
"name": "gweicz-services",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"dotenv": "^16.0.3",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"jsonata": "^1.8.6",
|
"jsonata": "^1.8.6",
|
||||||
"node-fetch": "^3.2.10"
|
"node-fetch": "^3.2.10"
|
||||||
|
@ -33,6 +34,14 @@
|
||||||
"node": ">= 12"
|
"node": ">= 12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/dotenv": {
|
||||||
|
"version": "16.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
|
||||||
|
"integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/fetch-blob": {
|
"node_modules/fetch-blob": {
|
||||||
"version": "3.2.0",
|
"version": "3.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
|
||||||
|
@ -146,6 +155,11 @@
|
||||||
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz",
|
||||||
"integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA=="
|
"integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA=="
|
||||||
},
|
},
|
||||||
|
"dotenv": {
|
||||||
|
"version": "16.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
|
||||||
|
"integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ=="
|
||||||
|
},
|
||||||
"fetch-blob": {
|
"fetch-blob": {
|
||||||
"version": "3.2.0",
|
"version": "3.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
"bun-types": "^0.1.0"
|
"bun-types": "^0.1.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"dotenv": "^16.0.3",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"jsonata": "^1.8.6",
|
"jsonata": "^1.8.6",
|
||||||
"node-fetch": "^3.2.10"
|
"node-fetch": "^3.2.10"
|
||||||
|
|
|
@ -3,13 +3,26 @@ import fs from 'fs'
|
||||||
import jsonata from 'jsonata'
|
import jsonata from 'jsonata'
|
||||||
import fetch from 'node-fetch'
|
import fetch from 'node-fetch'
|
||||||
|
|
||||||
|
import * as dotenv from 'dotenv'
|
||||||
|
dotenv.config()
|
||||||
|
|
||||||
const SOURCE_FILE = process.env.GWEICZ_SYSINFO_SPEC || './spec/services.yaml'
|
const SOURCE_FILE = process.env.GWEICZ_SYSINFO_SPEC || './spec/services.yaml'
|
||||||
|
|
||||||
const outputFn = 'build/spec.json'
|
const outputFn = 'build/spec.json'
|
||||||
|
|
||||||
|
function defaultOptions(conf) {
|
||||||
|
const opts = {}
|
||||||
|
if (conf.auth && conf.auth.type === 'basic') {
|
||||||
|
opts.headers = {
|
||||||
|
Authorization: `Basic ${Buffer.from(process.env[conf.auth.env]).toString('base64')}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return opts
|
||||||
|
}
|
||||||
|
|
||||||
const strategies = {
|
const strategies = {
|
||||||
async default (conf, all) {
|
async default (conf, all) {
|
||||||
const req = await fetch(conf.url)
|
const req = await fetch(conf.url, defaultOptions(conf))
|
||||||
const resp = await req.json()
|
const resp = await req.json()
|
||||||
return jsonata(conf.query).evaluate(resp)
|
return jsonata(conf.query).evaluate(resp)
|
||||||
},
|
},
|
||||||
|
|
|
@ -164,4 +164,27 @@ services:
|
||||||
- name: Woodpecker CI
|
- name: Woodpecker CI
|
||||||
host: ci.gwei.cz
|
host: ci.gwei.cz
|
||||||
server: frontier
|
server: frontier
|
||||||
|
repo: woodpecker-ci/woodpecker
|
||||||
monitor: 4
|
monitor: 4
|
||||||
|
version_conf:
|
||||||
|
from:
|
||||||
|
strategy: html
|
||||||
|
url: https://ci.gwei.cz/
|
||||||
|
to:
|
||||||
|
strategy: github
|
||||||
|
|
||||||
|
- name: frp server
|
||||||
|
host: frp.gwei.cz
|
||||||
|
server: metropolis
|
||||||
|
repo: fatedier/frp
|
||||||
|
monitor: 40
|
||||||
|
version_conf:
|
||||||
|
from:
|
||||||
|
auth:
|
||||||
|
type: basic
|
||||||
|
env: GWEICZ_FRP_AUTH
|
||||||
|
url: https://frp.gwei.cz/api/serverinfo
|
||||||
|
query: version
|
||||||
|
to:
|
||||||
|
strategy: github
|
||||||
|
|
||||||
|
|
Načítá se…
Odkázat v novém úkolu