Sha256: 886deee9a2698a0cba34e8bba9b41eb262c298f106effac18d498c77560308bb
Contents?: true
Size: 1.47 KB
Versions: 6
Compression:
Stored size: 1.47 KB
Contents
module Cluster class Runner @@dc = system("docker compose version", out: "/dev/null", err: "/dev/null") ? "docker compose" : "docker-compose" def run command, options = {} begin if !system command, options raise command.red end rescue Interrupt # user pressed Ctrl+C, do nothing end end def dc command, options = {} run "#{@@dc} -f ~/development/spend-cloud/docker-compose.yml #{command}", options end def start args, options if options.pull dc "pull" end if options.build dc "build #{options.pull ? "--pull" : ""}" end run "docker container prune -f" dc "up --detach --remove-orphans --force-recreate --always-recreate-deps" if options.pull or options.build system "docker image prune -f" end UI.success("\nāļø You can visit your environment at š https://spend-cloud.dev.spend.cloud š") end def stop dc "down --remove-orphans" end def delete dc "down --remove-orphans -v" end def reset args, options delete start args, options end def status dc "ps" end def logs args, options command = "logs" command << " --follow" if options.f or options.follow command << " --timestamps" if options.t or options.timestamps command << " --tail #{options.tail}" if options.tail dc "#{command} #{args.join " "}" end end end
Version data entries
6 entries across 6 versions & 1 rubygems