Sha256: e96e481760f9bab38981d1d6f47423ac93b4dc782a4d8b0a3f07905abb261f40

Contents?: true

Size: 713 Bytes

Versions: 11

Compression:

Stored size: 713 Bytes

Contents

module Vidar
  class Run
    class << self
      def docker(command)
        system("docker #{command}") || exit(1)
      end

      def docker_compose(command)
        args = %w[revision current_branch].map { |arg| "#{arg.upcase}=#{Config.get!(arg.to_sym)}" }
        system("#{args.join(' ')} docker-compose -f #{Config.get!(:compose_file)} #{command}") || exit(1)
      end

      def kubectl(command, namespace: Config.get!(:namespace))
        system("#{kubectl_envs_string}kubectl --namespace=#{namespace} #{command}") || exit(1)
      end

      def kubectl_envs_string
        https_proxy = Config.deploy_config.https_proxy
        "HTTPS_PROXY=#{https_proxy} " if https_proxy
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
vidar-1.12.1 lib/vidar/run.rb
vidar-1.12.0 lib/vidar/run.rb
vidar-1.11.0 lib/vidar/run.rb
vidar-1.10.0 lib/vidar/run.rb
vidar-1.9.4 lib/vidar/run.rb
vidar-1.9.3 lib/vidar/run.rb
vidar-1.9.2 lib/vidar/run.rb
vidar-1.9.1 lib/vidar/run.rb
vidar-1.9.0 lib/vidar/run.rb
vidar-1.8.0 lib/vidar/run.rb
vidar-1.8.0.rc4 lib/vidar/run.rb