2021-12-12 07:10:03 +03:00
|
|
|
const { logger, db } = require('../core')
|
|
|
|
|
|
|
|
async function main() {
|
2022-02-07 06:11:40 +03:00
|
|
|
await db.streams.load()
|
|
|
|
const docs = await db.streams.find({}).sort({ cluster_id: 1 })
|
2021-12-12 07:10:03 +03:00
|
|
|
const cluster_id = docs.reduce((acc, curr) => {
|
|
|
|
if (!acc.includes(curr.cluster_id)) acc.push(curr.cluster_id)
|
|
|
|
return acc
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
const matrix = { cluster_id }
|
|
|
|
const output = `::set-output name=matrix::${JSON.stringify(matrix)}`
|
|
|
|
logger.info(output)
|
|
|
|
}
|
|
|
|
|
|
|
|
main()
|