Skip to content

Commit

Permalink
🧪 Check generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
polRk committed Oct 23, 2024
1 parent d69acca commit aff9830
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
15 changes: 6 additions & 9 deletions init/main.js

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions init/src/jobs/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,32 @@ import { exec } from '@actions/exec'
import { generateComposeFile, prometheusConfig, ydbConfig } from '../configs'

(async function main() {
let cwd = process.env['RUNNER_TEMP']!
saveState("CWD", process.env['RUNNER_TEMP']!)
debug(`CWD is now: ${cwd}`)

{
debug("Creating ydb cofnig...")
let configPath = path.join(cwd, "ydb.yaml")
let configPath = path.join(process.cwd(), ".configs", "ydb.yaml")
let configContent = ydbConfig
fs.writeFileSync(configPath, configContent, { encoding: "utf-8" })
debug(`Created config for ydb: ${configPath}`)
}

{
debug("Creating prometheus config...")
let configPath = path.join(cwd, "prometheus.yml")
let configPath = path.join(process.cwd(), ".cofnigs", "prometheus.yml")
let configContent = prometheusConfig
fs.writeFileSync(configPath, configContent, { encoding: "utf-8" })
debug(`Created config for prometheus: ${configPath}`)
}

{
debug("Creating compose config...")
let composePath = path.join(cwd, "compose.yaml")
let composePath = path.join(process.cwd(), ".configs", "compose.yaml")
let composeContent = generateComposeFile(parseInt(getInput("YDB_DATABASE_NODE_COUNT", { required: true })))
fs.writeFileSync(composePath, composeContent, { encoding: "utf-8" })
debug(`Created compose.yaml: ${composePath}`)
}

debug("Starting YDB...")
await exec(`docker`, [`compose`, `-f ${path.join(cwd, "compose.yaml")}`, `up`, `--quiet-pull`, `-d`], { cwd })
await exec(`docker`, [`compose`, `-f compose.yaml`, `up`, `--quiet-pull`, `-d`], { cwd: path.join(process.cwd(), ".configs") })

let start = new Date()
debug(`YDB started at ${start}`)
Expand Down

0 comments on commit aff9830

Please sign in to comment.