Files
herolib/examples/installers/base/redis.vsh
peternashaat eada09135c feat: migrate Redis installer and integrate into coordinator
- Created coordinator installer
- Migrated Redis installer to new modular pattern (_model.v, _actions.v, _factory_.v)
- Fixed Redis config template for 7.0.15 compatibility (commented out unsupported directives)
- Added Redis dependency check to coordinator installer
- Coordinator now auto-installs and starts Redis if not available
- Added progress indicators to coordinator build process
- Consolidated Redis example scripts
- All tests passing: Redis installation, coordinator build, and idempotency verified
2025-11-14 13:25:35 +00:00

40 lines
1.0 KiB
GLSL
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run
import incubaid.herolib.installers.base
import incubaid.herolib.osal.core as osal
import time
println('=== Redis Installer Example ===\n')
// Check if redis is already installed
if osal.cmd_exists_profile('redis-server') {
println(' redis-server is already installed')
// Check if it's running
if base.check(port: 6379) {
println(' Redis is running and responding')
} else {
println(' Redis is installed but not running, starting it...')
// Use systemctl to start redis
osal.exec(cmd: 'systemctl start redis-server')!
// Wait a moment for redis to start
time.sleep(1000)
if base.check(port: 6379) {
println(' Redis started successfully')
} else {
println(' Failed to start redis')
}
}
} else {
println('Redis not found, installing...')
// Install and start redis
base.redis_install(port: 6379, start: true)!
println(' Redis installed and started successfully')
}
println('\n Done!')