source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/helpers/profile.rb | Ruby | bsd-3-clause | 94 | master | 2,166 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
module Helpers
module Profile
def profile_ref_prefix
"docker-volumeprofile-"
end
def profile_ref_name
"#{profile_ref_prefix}#{... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/helpers/backup.rb | Ruby | bsd-3-clause | 94 | master | 1,153 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
module Helpers
module Backup
def backup_ls
backups = []
s3s = bbapi.obj_store.list
s3s.each do |s3|
backups.concat bb_loo... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/helpers/docker_api.rb | Ruby | bsd-3-clause | 94 | master | 2,076 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
require 'docker'
module Helpers
module DockerApi
def docker_run(name, opts, force: false, noop: false)
begin
logger.debug "docker cr... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/helpers/volume.rb | Ruby | bsd-3-clause | 94 | master | 13,368 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
module Helpers
module Volume
def volume_env
@volume_env ||=
begin
env = {
"BB_MANUAL_MODE" => "1",
... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/helpers/sync.rb | Ruby | bsd-3-clause | 94 | master | 688 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
module Helpers
module Sync
def self.locks
@@locks ||= {}
end
def synchronize(&blk)
lock = Sync.locks[vol_name] ||= {
m... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/helpers/defs.rb | Ruby | bsd-3-clause | 94 | master | 4,143 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
module Helpers
module Defs
def blockbridge_root
ENV['BLOCKBRIDGE_ROOT'] || '/bb'
end
def volumes_root
@volumes_root ||= File.j... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/helpers/helpers.rb | Ruby | bsd-3-clause | 94 | master | 488 | # Copyright (c) 2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
module Helpers
module General
def symbolize(obj)
return obj.reduce({}) do |memo, (k, v)|
memo.tap { |m| m[k.to_sym] = symbolize(v) }
... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/helpers/cli.rb | Ruby | bsd-3-clause | 94 | master | 8,172 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
require 'hashie'
module Helpers
module Cli
def machine?
!!(ENV['BLOCKBRIDGE_MACHINE_FORMAT'].to_i != 0 || ARGV.index('--machine'))
end
... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/helpers/refs.rb | Ruby | bsd-3-clause | 94 | master | 2,580 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
module Helpers
module Refs
def vol_ref_path(name = nil)
File.join(vol_path(name), 'ref')
end
def mnt_ref_file(name = nil)
File... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/helpers/blockbridge_api.rb | Ruby | bsd-3-clause | 94 | master | 9,397 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
require 'blockbridge/api'
require 'moneta'
module Helpers
module BlockbridgeApi
def self.client
@@client ||= {}
end
def self.sessio... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/apis/docker_plugin.rb | Ruby | bsd-3-clause | 94 | master | 3,702 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
class API::DockerPlugin < Grape::API
#version 'v1', using: :header, vendor: 'docker.plugins'
before do
status 200
parse_params(params)
s... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/apis/backup.rb | Ruby | bsd-3-clause | 94 | master | 1,610 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
class API::Backup < Grape::API
prefix 'backup'
desc 'list backups'
params do
optional :profile, type: String, desc: 'list backups from S3 obje... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/apis/profile.rb | Ruby | bsd-3-clause | 94 | master | 1,415 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
class API::Profile < Grape::API
prefix 'profile'
desc 'Create a profile'
params do
requires :name, type: String, desc: 'profile name'... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/apis/volume.rb | Ruby | bsd-3-clause | 94 | master | 1,836 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
class API::Volume < Grape::API
prefix 'volume'
desc 'Create a volume'
params do
requires :name, type: String, desc: 'volume name'
... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/plugins/startup.rb | Ruby | bsd-3-clause | 94 | master | 496 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved. Use
# of this source code is governed by a BSD-style license, found in the LICENSE
# file.
module Blockbridge
class Startup
include Helpers
attr_reader :config
attr_reader :logger
attr_reader :status
def initialize(addre... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/plugins/monitor.rb | Ruby | bsd-3-clause | 94 | master | 4,184 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved. Use
# of this source code is governed by a BSD-style license, found in the LICENSE
# file.
module Blockbridge
class VolumeCacheMonitor
include Helpers
attr_reader :config
attr_reader :logger
attr_reader :status
attr_reade... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/plugins/config.rb | Ruby | bsd-3-clause | 94 | master | 1,242 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved. Use
# of this source code is governed by a BSD-style license, found in the LICENSE
# file.
module Blockbridge
class Config
include Helpers
attr_reader :config
attr_reader :logger
attr_reader :status
def self.access_token... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volume_driver/plugins/hostinfo.rb | Ruby | bsd-3-clause | 94 | master | 8,077 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved. Use
# of this source code is governed by a BSD-style license, found in the LICENSE
# file.
module Blockbridge
class VolumeHostinfo
include Helpers
attr_reader :config
attr_reader :logger
attr_reader :status
def initializ... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volumectl/view.rb | Ruby | bsd-3-clause | 94 | master | 9,422 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
require 'active_support/inflector'
require 'csv'
require 'io/console'
require 'jsonpath'
require 'hashie'
require 'volume_driver/helpers/errors'
require... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volumectl/cli.rb | Ruby | bsd-3-clause | 94 | master | 4,165 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
require 'blockbridge/util/tabular'
require 'facets/string/word_wrap'
require 'volumectl/view'
require 'volume_driver/helpers/errors'
require 'securerando... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volumectl/Gemfile | Ruby | bsd-3-clause | 94 | master | 599 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
#
# -*- mode: ruby -*-
source 'https://rubygems.org'
gem 'clamp', :git => '/usr/lib/clamp', :branch => 'bb'
gem 'blockbridge-util', :git => '/usr/lib/... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volumectl/views/volumectl_volume_ls.rb | Ruby | bsd-3-clause | 94 | master | 601 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
if data.length == 0
header "No volumes found."
return
end
table(sort_cols: %w(User Name)) do |t|
t.cols('Name', 'User', 'Capacity', 'Source')
d... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volumectl/views/exception_machine.rb | Ruby | bsd-3-clause | 94 | master | 476 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
e = data
case e
when Blockbridge::CLI::RuntimeSuccess
when Clamp::HelpWanted
raw render :exception_human, data, options
when Blockbridge::Api::Executi... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volumectl/views/volumectl_volume_inspect.rb | Ruby | bsd-3-clause | 94 | master | 718 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
unless data
header "No volume information found."
return
end
def info(vol)
fieldset("Volume: #{vol['name']}", heading: true) do
field 'type', ... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volumectl/views/volumectl_backup_ls.rb | Ruby | bsd-3-clause | 94 | master | 473 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
if data.length == 0
header "No backups found."
return
end
table(sort_cols: %w(User S3 Label ID), max_width: 250) do |t|
t.cols('Label', 'ID', 'Use... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volumectl/views/volumectl_profile_ls.rb | Ruby | bsd-3-clause | 94 | master | 589 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
if data.length == 0
header "No profiles found."
return
end
table(sort_cols: %w(User Name)) do |t|
t.cols('Name', 'User', 'Type', 'Capacity', 'Tran... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volumectl/views/volumectl_exception_human.rb | Ruby | bsd-3-clause | 94 | master | 1,797 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
e = data
case e
when RuntimeSuccess
msg = e.message.word_wrap(76)
puts msg.each_line { |line| puts " #{line}" }
when Clamp::UsageError
msg = e.m... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volumectl/views/volumectl_profile_inspect.rb | Ruby | bsd-3-clause | 94 | master | 650 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
unless data
header "No profile information found."
return
end
def info(pro)
fieldset("Profile: #{pro['name']}", heading: true) do
field 'type'... |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volumectl/views/volumectl_volume_backup.rb | Ruby | bsd-3-clause | 94 | master | 263 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
header "Volume backup initiated for #{opts[:cmd].volume} with backup id #{data['backup_id']}.." |
github | blockbridge/blockbridge-docker-volume | https://github.com/blockbridge/blockbridge-docker-volume | volumectl/views/volumectl_backup_info.rb | Ruby | bsd-3-clause | 94 | master | 824 | # Copyright (c) 2015-2017, Blockbridge Networks LLC. All rights reserved.
# Use of this source code is governed by a BSD-style license, found
# in the LICENSE file.
if data.length == 0
header "No Object stores found."
return
end
table(sort_cols: %w(Object-store), max_width: 135) do |t|
t.cols('Object-store', '... |
github | nov/itunes-receipt | https://github.com/nov/itunes-receipt | itunes-receipt.gemspec | Ruby | mit | 94 | master | 1,059 | # -*- encoding: utf-8 -*-
$:.push File.expand_path('../lib', __FILE__)
Gem::Specification.new do |s|
s.name = 'itunes-receipt'
s.description = %q{Handle iTunes In App Purchase Receipt Verification}
s.summary = %q{Handle iTunes In App Purchase Receipt Verification}
s.version = File.read(File.join... |
github | nov/itunes-receipt | https://github.com/nov/itunes-receipt | lib/itunes.rb | Ruby | mit | 94 | master | 699 | require 'json'
require 'active_support/all'
require 'restclient_with_cert'
module Itunes
ENDPOINT = {
:production => 'https://buy.itunes.apple.com/verifyReceipt',
:sandbox => 'https://sandbox.itunes.apple.com/verifyReceipt'
}
def self.endpoint
ENDPOINT[itunes_env]
end
def self.itunes_env
s... |
github | nov/itunes-receipt | https://github.com/nov/itunes-receipt | lib/itunes/receipt.rb | Ruby | mit | 94 | master | 5,981 | require 'itunes'
module Itunes
class Receipt
class VerificationFailed < StandardError
attr_reader :status
def initialize(attributes = {})
@status = attributes[:status]
super attributes[:exception]
end
end
class SandboxReceiptReceived < VerificationFailed; end;
clas... |
github | nov/itunes-receipt | https://github.com/nov/itunes-receipt | spec/spec_helper.rb | Ruby | mit | 94 | master | 229 | require 'simplecov'
SimpleCov.start do
add_filter 'spec'
end
require 'rspec'
require 'itunes/receipt'
require 'helpers/fake_json_helper'
def sandbox_mode(&block)
Itunes.sandbox!
yield
ensure
Itunes.sandbox = false
end |
github | nov/itunes-receipt | https://github.com/nov/itunes-receipt | spec/itunes_spec.rb | Ruby | mit | 94 | master | 583 | require 'spec_helper'
describe Itunes do
describe 'the module' do
before do
Itunes.shared_secret = nil
end
context 'sandbox' do
it 'should be production by default' do
Itunes.sandbox?.should == false
end
it 'should be settable' do
Itunes.sandbox!
Itunes.... |
github | nov/itunes-receipt | https://github.com/nov/itunes-receipt | spec/helpers/fake_json_helper.rb | Ruby | mit | 94 | master | 524 | require 'fakeweb'
module FakeJsonHelper
def fake_json(expected, options = {})
FakeWeb.register_uri(
:post,
Itunes.endpoint,
options.merge(
:body => File.read(File.join(File.dirname(__FILE__), '../fake_json', "#{expected}.json"))
)
)
end
def post_to(endpoint)
raise_er... |
github | nov/itunes-receipt | https://github.com/nov/itunes-receipt | spec/itunes/receipt_spec.rb | Ruby | mit | 94 | master | 9,434 | require 'spec_helper'
describe Itunes::Receipt do
describe '.verify!' do
it 'should support sandbox mode' do
sandbox_mode do
expect do
Itunes::Receipt.verify! 'receipt-data'
end.to post_to Itunes::ENDPOINT[:sandbox]
end
end
it 'should not pass along shared secret i... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | Rakefile | Ruby | apache-2.0 | 94 | main | 911 | # frozen_string_literal: true
require 'bundler'
require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings'
PuppetLint.configuration.send('dis... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | Gemfile | Ruby | apache-2.0 | 94 | main | 5,287 | source ENV['GEM_SOURCE'] || 'https://rubygems.org'
def location_for(place_or_version, fake_version = nil)
git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
file_url_regex = %r{\Afile:\/\/(?<path>.*)}
if place_or_version && (git_url = place_or_version.match(git_url_regex))
[fake_version, {... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | tasks/swarm_init.rb | Ruby | apache-2.0 | 94 | main | 1,787 | #!/opt/puppetlabs/puppet/bin/ruby
# frozen_string_literal: true
require 'json'
require 'open3'
require 'puppet'
def swarm_init(advertise_addr, autolock, cert_expiry, dispatcher_heartbeat, external_ca, force_new_cluster, listen_addr, max_snapshots, snapshot_interval)
cmd_string = 'docker swarm init'
cmd_string += ... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | tasks/node_rm.rb | Ruby | apache-2.0 | 94 | main | 620 | #!/opt/puppetlabs/puppet/bin/ruby
# frozen_string_literal: true
require 'json'
require 'open3'
require 'puppet'
def node_rm(force, node)
cmd_string = 'docker node rm'
cmd_string += ' --force' unless force.nil?
cmd_string += " #{node}" unless node.nil?
stdout, stderr, status = Open3.capture3(cmd_string)
rai... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | tasks/swarm_update.rb | Ruby | apache-2.0 | 94 | main | 410 | #!/opt/puppetlabs/puppet/bin/ruby
# frozen_string_literal: true
require 'json'
require 'open3'
require 'puppet'
params = JSON.parse($stdin.read)
image = params['image']
service = params['service']
begin
puts 'Deprecated: use docker::service_update instead'
result = service_update(image, service)
puts result
... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | tasks/swarm_token.rb | Ruby | apache-2.0 | 94 | main | 587 | #!/opt/puppetlabs/puppet/bin/ruby
# frozen_string_literal: true
require 'json'
require 'open3'
require 'puppet'
def swarm_token(node_role)
cmd_string = 'docker swarm join-token -q'
cmd_string += " #{node_role}" unless node_role.nil?
stdout, stderr, status = Open3.capture3(cmd_string)
raise Puppet::Error, "st... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | tasks/service_update.rb | Ruby | apache-2.0 | 94 | main | 1,072 | #!/opt/puppetlabs/puppet/bin/ruby
# frozen_string_literal: true
require 'json'
require 'open3'
require 'puppet'
def service_update(image, service, constraint_add, constraint_rm)
cmd_string = 'docker service update'
cmd_string += " --image #{image}" unless image.nil?
if constraint_add.is_a? Array
constraint... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | tasks/node_ls.rb | Ruby | apache-2.0 | 94 | main | 641 | #!/opt/puppetlabs/puppet/bin/ruby
# frozen_string_literal: true
require 'json'
require 'open3'
require 'puppet'
def node_ls(filter, quiet)
cmd_string = 'docker node ls'
cmd_string += " --filter=#{filter}" unless filter.nil?
cmd_string += ' --quiet' unless quiet.nil?
stdout, stderr, status = Open3.capture3(cm... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | tasks/service_scale.rb | Ruby | apache-2.0 | 94 | main | 740 | #!/opt/puppetlabs/puppet/bin/ruby
# frozen_string_literal: true
require 'json'
require 'open3'
require 'puppet'
def service_scale(service, scale, detach)
cmd_string = 'docker service scale'
cmd_string += " #{service}" unless service.nil?
cmd_string += "=#{scale}" unless scale.nil?
cmd_string += ' -d' unless d... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | tasks/service_rm.rb | Ruby | apache-2.0 | 94 | main | 564 | #!/opt/puppetlabs/puppet/bin/ruby
# frozen_string_literal: true
require 'json'
require 'open3'
require 'puppet'
def service_rm(service)
cmd_string = 'docker service rm'
cmd_string += " #{service}" unless service.nil?
stdout, stderr, status = Open3.capture3(cmd_string)
raise Puppet::Error, "stderr: '#{stderr}... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | tasks/swarm_leave.rb | Ruby | apache-2.0 | 94 | main | 549 | #!/opt/puppetlabs/puppet/bin/ruby
# frozen_string_literal: true
require 'json'
require 'open3'
require 'puppet'
def swarm_leave(force)
cmd_string = 'docker swarm leave '
cmd_string += ' -f' if force == 'true'
stdout, stderr, status = Open3.capture3(cmd_string)
raise Puppet::Error, "stderr: '#{stderr}'" if sta... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | tasks/swarm_join.rb | Ruby | apache-2.0 | 94 | main | 963 | #!/opt/puppetlabs/puppet/bin/ruby
# frozen_string_literal: true
require 'json'
require 'open3'
require 'puppet'
def swarm_join(advertise_addr, listen_addr, token, manager_ip)
cmd_string = 'docker swarm join'
cmd_string += " --advertise-addr=#{advertise_addr}" unless advertise_addr.nil?
cmd_string += " --listen-... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | tasks/node_update.rb | Ruby | apache-2.0 | 94 | main | 1,109 | #!/opt/puppetlabs/puppet/bin/ruby
# frozen_string_literal: true
require 'json'
require 'open3'
require 'puppet'
def node_update(availability, role, label_add, label_rm, node)
cmd_string = 'docker node update'
cmd_string += " --availability #{availability}" unless availability.nil?
cmd_string += " --role #{role}... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | tasks/service_create.rb | Ruby | apache-2.0 | 94 | main | 1,467 | #!/opt/puppetlabs/puppet/bin/ruby
# frozen_string_literal: true
require 'json'
require 'open3'
require 'puppet'
def service_create(image, replicas, expose, env, command, extra_params, service, detach)
cmd_string = 'docker service create'
if extra_params.is_a? Array
extra_params.each do |param|
cmd_strin... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples.rb | Ruby | apache-2.0 | 94 | main | 1,196 | # frozen_string_literal: true
require 'helper/get_defaults'
require 'helper/get_docker_exec_flags'
require 'helper/get_docker_plugin_enable_flags'
require 'helper/get_docker_plugin_install_flags'
require 'helper/get_docker_plugin_remove_flags'
require 'helper/get_docker_run_flags'
require 'helper/get_docker_secrets_fl... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/spec_helper_acceptance_local.rb | Ruby | apache-2.0 | 94 | main | 6,179 | # frozen_string_literal: true
require 'puppet_litmus'
require 'rspec/retry'
require 'tempfile'
include PuppetLitmus # rubocop:disable Style/MixinUsage
# This method allows a block to be passed in and if an exception is raised
# that matches the 'error_matcher' matcher, the block will wait a set number
# of seconds b... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/spec_helper.rb | Ruby | apache-2.0 | 94 | main | 2,722 | # frozen_string_literal: true
require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
require 'shared_examples'
require 'rspec-puppet'
require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb'))
include RspecPuppetFacts # rubocop:disable Style/MixinUs... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/classes/compose_spec.rb | Ruby | apache-2.0 | 94 | main | 1,019 | # frozen_string_literal: true
require 'spec_helper'
tests = {
'with default valus' => {},
'with ensure => absent' => {
'ensure' => 'absent'
},
'with version => 1.7.0' => {
'version' => '1.7.0'
}
}
describe 'docker::compose', type: :class do
on_supported_os.each do |os, os_facts|
##
## set... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/classes/init_spec.rb | Ruby | apache-2.0 | 94 | main | 10,185 | # frozen_string_literal: true
require 'spec_helper'
tests = {
'with default values' => {},
'with docker_users set' => {
'docker_users' => [
'some_random_user',
'foo',
'bar',
]
},
'with package_source set to docker-engine' => {
'package_source' => 'docker-engine'
},
'with pack... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/classes/plugins_spec.rb | Ruby | apache-2.0 | 94 | main | 1,813 | # frozen_string_literal: true
require 'spec_helper'
tests = {
'foo/enabled:latest' => {
'enabled' => true
},
'foo/disabled:latest' => {
'enabled' => false
}
}
describe 'docker::plugins', type: :class do
on_supported_os.each do |os, os_facts|
##
## set some needed facts
##
facts = if... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/classes/images_spec.rb | Ruby | apache-2.0 | 94 | main | 1,501 | # frozen_string_literal: true
require 'spec_helper'
tests = {
'with ensure => present' => {
'ensure' => 'present'
},
'with ensure => absent' => {
'ensure' => 'absent'
}
}
describe 'docker::images', type: :class do
on_supported_os.each do |os, os_facts|
##
## set some needed facts
##
... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/classes/machine_spec.rb | Ruby | apache-2.0 | 94 | main | 1,768 | # frozen_string_literal: true
require 'spec_helper'
# Need to write test casees here
tests = {
'with default value' => {}
}
describe 'docker::machine', type: :class do
on_supported_os.each do |os, os_facts|
##
## set some needed facts
##
facts = if os.include?('windows')
windows_fact... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/classes/networks_spec.rb | Ruby | apache-2.0 | 94 | main | 1,686 | # frozen_string_literal: true
require 'spec_helper'
tests = {
'network-present' => {
'ensure' => 'present',
'driver' => 'overlay',
'subnet' => '192.168.1.0/24',
'gateway' => '192.168.1.1',
'ip_range' => '192.168.1.4/32'
},
'network-absent' => {
'ensure' => 'absent',
'driver' => 'over... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/run.rb | Ruby | apache-2.0 | 94 | main | 17,834 | # frozen_string_literal: true
shared_examples 'run' do |title, params, facts, defaults|
# after = params['after']
# after_create = params['after_create']
# after_service = params['after_service']
# after_start = params['... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/params.rb | Ruby | apache-2.0 | 94 | main | 535 | # frozen_string_literal: true
shared_examples 'params' do |_facts|
case _facts[:os]['family']
when 'Debian'
it {
expect(subject).to contain_class('docker::params')
expect(subject).to contain_class('docker::systemd_reload')
expect(subject).to contain_exec('docker-systemd-reload').with(
... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/plugin.rb | Ruby | apache-2.0 | 94 | main | 3,144 | # frozen_string_literal: true
shared_examples 'plugin' do |_params, _facts, _defaults|
ensure_value = _params['ensure']
plugin_name = _params['plugin_name']
enabled = _params['enabled']
timeout = _params['timeout']
plugin_alias = _params['plugin_alias']... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/stack.rb | Ruby | apache-2.0 | 94 | main | 1,945 | # frozen_string_literal: true
shared_examples 'stack' do |_title, params, facts, defaults|
ensure_value = params['ensure']
stack_name = params['stack_name']
bundle_file = params['bundle_file']
compose_files = params['compose_files']
prune = params['prune']
with_regist... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/compose.rb | Ruby | apache-2.0 | 94 | main | 559 | # frozen_string_literal: true
shared_examples 'compose' do |_params, _facts|
ensure_value = _params['ensure']
version = _params['version']
if _params['manage_package']
ensure_value =
if _params['version'] != :undef && _params['ensure'] != 'absent'
_params['version']
else
_pa... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/image.rb | Ruby | apache-2.0 | 94 | main | 5,334 | # frozen_string_literal: true
shared_examples 'image' do |_params, _facts, _defaults|
docker_command = _defaults['docker_command']
docker_dir = _params['docker_dir']
docker_file = _params['docker_file']
docker_tar = _params['docker_tar']
ensure_value = _params['ensure']
force = _param... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/repos.rb | Ruby | apache-2.0 | 94 | main | 3,344 | # frozen_string_literal: true
shared_examples 'repos' do |params, facts|
it {
expect(subject).to contain_class('docker::repos')
}
values = get_values_init(params, facts)
location = values['package_location']
key_source = values['package_key_source']
key_check_source = values['package_ke... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/registry.rb | Ruby | apache-2.0 | 94 | main | 4,280 | # frozen_string_literal: true
shared_examples 'registry' do |title, params, facts, defaults|
server = params['server']
ensure_value = params['ensure']
username = params['username']
password = params['password']
pass_hash = params['pass_hash']
email = params['email']
local_user =... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/service.rb | Ruby | apache-2.0 | 94 | main | 4,556 | # frozen_string_literal: true
shared_examples 'service' do |params, facts|
# dns_array = [params['dns']]
# dns_search_array = [params['dns_search']]
# extra_parameters_array = [params['extra_parameters']]
# labels_array = [params['labels']]
# shell_values_array = [params['she... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/services.rb | Ruby | apache-2.0 | 94 | main | 4,150 | # frozen_string_literal: true
shared_examples 'services' do |title, params, facts, defaults|
command = params['command']
create = params['create']
detach = params['detach']
ensure_value = params['ensure']
env = params['env']
extra_params = params['extra_params']
... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/config.rb | Ruby | apache-2.0 | 94 | main | 584 | # frozen_string_literal: true
shared_examples 'config' do |_params, _facts|
docker_users = _params['docker_users']
it {
expect(subject).to contain_class('docker::config')
}
unless docker_users.empty?
docker_users.each do |user|
if _facts[:os]['family'].include?('windows')
it {
... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/system_user.rb | Ruby | apache-2.0 | 94 | main | 499 | # frozen_string_literal: true
shared_examples 'system_user' do |user, group|
docker_group = group
it {
expect(subject).to contain_user(user).with(
'ensure' => 'present',
).that_comes_before("Exec[docker-system-user-#{user}]")
}
it {
expect(subject).to contain_exec("docker-system-user-#{user... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/exec.rb | Ruby | apache-2.0 | 94 | main | 2,233 | # frozen_string_literal: true
shared_examples 'exec' do |_params, _facts, _defaults|
command = _params['command']
container = _params['container']
detach = _params['detach']
docker_command = _defaults['docker_command']
env = _params['env']
interactive = _params['interactiv... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/machine.rb | Ruby | apache-2.0 | 94 | main | 3,083 | # frozen_string_literal: true
shared_examples 'machine' do |_params, _facts, _defaults|
ensure_value = _params['ensure']
version = _params['version']
install_path = _params['install_path']
proxy = _params['proxy']
url = _params['url']
curl_ensure = _params['curl_ensure']
if _facts[... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/swarm.rb | Ruby | apache-2.0 | 94 | main | 3,929 | # frozen_string_literal: true
shared_examples 'swarm' do |_title, params, facts, defaults|
ensure_value = params['ensure']
init = params['init']
join = params['join']
advertise_addr = params['advertise_addr']
autolock ... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/install.rb | Ruby | apache-2.0 | 94 | main | 5,449 | # frozen_string_literal: true
shared_examples 'install' do |_params, _facts|
values = get_values_init(_params, _facts)
ensure_value = if _params['version'] != :undef && _params['ensure'] != 'absent'
_params['version']
else
_params['ensure']
e... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/shared_examples/secrets.rb | Ruby | apache-2.0 | 94 | main | 1,162 | # frozen_string_literal: true
shared_examples 'secrets' do |title, params, _facts, defaults|
ensure_value = params['ensure']
label = params['label']
secret_name = params['secret_name']
secret_path = params['secret_path']
docker_command = "#{defaults['docker_command']} secret"
if ensure_value == ... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/defines/image_spec.rb | Ruby | apache-2.0 | 94 | main | 5,643 | # frozen_string_literal: true
require 'spec_helper'
tests = {
'with default value' => {},
'with ensure => absent' => {
'ensure' => 'absent'
},
'with ensure => absent and force => true' => {
'ensure' => 'absent',
'force' => true
},
'with ensure => absent and image_tag => precise' => {
'ensu... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/defines/services_spec.rb | Ruby | apache-2.0 | 94 | main | 3,089 | # frozen_string_literal: true
require 'spec_helper'
tests = {
'with ensure => present and service create' => {
'create' => true,
'service_name' => 'foo',
'image' => 'foo:bar',
'publish' => '80:80',
'replicas' => '5',
'extra_params' => ['--update-delay 1m', '--restart-window 30s'],
'env' ... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/defines/plugin_spec.rb | Ruby | apache-2.0 | 94 | main | 1,672 | # frozen_string_literal: true
require 'spec_helper'
tests = {
'foo/setting:latest' => {
'settings' => [
'VAR1=test',
'VAR2=value',
]
},
'foo/disabled:latest' => {
'enabled' => false
},
'foo/force_remove:latest' => {
'ensure' => 'absent',
'force_remove' => true
}
}
describe... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/defines/exec_spec.rb | Ruby | apache-2.0 | 94 | main | 2,061 | # frozen_string_literal: true
require 'spec_helper'
tests = {
'with default values' => {},
'when running detached' => {
'detach' => true
},
'when running with tty' => {
'tty' => true
},
'when running with interactive' => {
'interactive' => true
},
'when running with onlyif "running"' => {
... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/defines/swarm_spec.rb | Ruby | apache-2.0 | 94 | main | 2,348 | # frozen_string_literal: true
require 'spec_helper'
tests = {
'with ensure => present and swarm init' => {
'init' => true,
'advertise_addr' => '192.168.1.1',
'listen_addr' => '192.168.1.1'
},
'with ensure => present and swarm init and default-addr-pool and default_addr_pool_mask_length' => {
'in... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/defines/registry_spec.rb | Ruby | apache-2.0 | 94 | main | 3,858 | # frozen_string_literal: true
require 'spec_helper'
tests = {
'with ensure => absent' => {
'ensure' => 'absent',
'version' => '17.06',
'pass_hash' => 'test1234',
'receipt' => false
},
'with ensure => present' => {
'ensure' => 'present',
'version' => '17.06',
'pass_hash' => 'test1234'... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/defines/stack_spec.rb | Ruby | apache-2.0 | 94 | main | 1,692 | # frozen_string_literal: true
require 'spec_helper'
tests = {
'create stack with compose file' => {
'stack_name' => 'foo',
'compose_files' => ['/tmp/docker-compose.yaml'],
'resolve_image' => 'always'
},
'create stack with multiple compose files' => {
'stack_name' => 'foo',
'compose_files' =>... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/defines/secrets_spec.rb | Ruby | apache-2.0 | 94 | main | 1,219 | # frozen_string_literal: true
require 'spec_helper'
tests = {
'with ensure present' => {
'secret_name' => 'test_secret',
'secret_path' => '/root/secret.txt',
'label' => ['test']
},
'with ensure absent' => {
'ensure' => 'absent',
'secret_name' => 'test_secret'
}
}
describe 'docker::secrets... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/defines/run_spec.rb | Ruby | apache-2.0 | 94 | main | 10,127 | # frozen_string_literal: true
require 'spec_helper'
tests = {
'default values' => {},
'when passing depends containers' => {
'depends' => [
'foo',
'bar',
'foo_bar/baz',
]
},
'when passing after containers' => {
'after' => [
'foo',
'bar',
'foo_bar/baz',
]
}... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/acceptance_swarm/swarm_spec.rb | Ruby | apache-2.0 | 94 | main | 5,620 | # frozen_string_literal: true
require 'spec_helper_acceptance'
if fact('osfamily') == 'windows'
docker_args = 'docker_ee => true'
test_docker_image = 'hello-seattle:nanoserver'
test_docker_command = 'cmd.exe /C "ping /t 8.8.8.8"'
else
docker_args = ''
test_docker_image = 'ubuntu:16.04'
test_docker_command... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/functions/env_spec.rb | Ruby | apache-2.0 | 94 | main | 453 | # frozen_string_literal: true
require 'spec_helper'
describe 'docker::env' do
it { is_expected.to run.with_params([4]).and_return([4]) }
it { is_expected.to run.with_params([4, 5, '3']).and_return([4, 5, '3']) }
it { is_expected.to run.with_params(2).and_raise_error(StandardError) }
it { is_expected.to run.wi... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/acceptance/stack_spec.rb | Ruby | apache-2.0 | 94 | main | 4,512 | # frozen_string_literal: true
require 'spec_helper_acceptance'
if os[:family] == 'windows'
docker_args = 'docker_ee => true'
tmp_path = 'C:\\tmp\\'
wait_for_container_seconds = 120
else
docker_args = ''
tmp_path = '/tmp/'
wait_for_container_seconds = 10
end
describe 'docker stack', :win_broken do
befor... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/acceptance/plugin_spec.rb | Ruby | apache-2.0 | 94 | main | 926 | # frozen_string_literal: true
require 'spec_helper_acceptance'
broken = false
command = 'docker'
plugin_name = 'vieux/sshfs'
if os[:family] == 'windows'
puts 'Not implemented on Windows'
broken = true
else
docker_args = ''
end
describe 'docker plugin', win_broken: broken do
before(:all) do
install_code ... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/acceptance/network_spec.rb | Ruby | apache-2.0 | 94 | main | 993 | # frozen_string_literal: true
require 'spec_helper_acceptance'
broken = false
command = 'docker'
network_name = 'test-network'
if os[:family] == 'windows'
puts 'Not implemented on Windows'
broken = true
docker_args = ''
end
describe 'docker network', win_broken: broken do
before(:all) do
install_pp = "c... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/acceptance/docker_full_spec.rb | Ruby | apache-2.0 | 94 | main | 33,432 | # frozen_string_literal: true
require 'spec_helper_acceptance'
if os[:kernel] == 'windows'
docker_args = 'docker_ee => true'
default_image = 'winamd64/hello-seattle'
default_image_tag = if os[:release][:major] == '2019' || os[:release][:major] == '2022'
'nanoserver'
... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/acceptance/docker_spec.rb | Ruby | apache-2.0 | 94 | main | 9,538 | # frozen_string_literal: true
require 'spec_helper_acceptance'
broken = false
registry_port = 5000
if os[:family] == 'windows'
result = run_shell("ipconfig | findstr /i 'ipv4'")
raise 'Could not retrieve ip address for Windows box' if result.exit_code != 0
ip = result.stdout.split("\n")[0].split(':')[1].stri... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/acceptance/docker_custom_source_spec.rb | Ruby | apache-2.0 | 94 | main | 3,213 | # frozen_string_literal: true
require 'spec_helper_acceptance'
if os[:family] == 'windows'
docker_args = 'docker_ee => true, docker_ee_source_location => "https://download.docker.com/components/engine/windows-server/17.06/docker-17.06.2-ee-14.zip"'
default_image = 'winamd64/hello-seattle'
# The default args are... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/acceptance/machine_spec.rb | Ruby | apache-2.0 | 94 | main | 2,233 | # frozen_string_literal: true
require 'spec_helper_acceptance'
describe 'docker::machine', :win_broken do
context 'with default parameters' do
pp = <<-EOS
include docker::machine
EOS
it 'applies with no errors' do
apply_manifest(pp, catch_failures: true)
end
it 'is idempotent' do
... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/acceptance/volume_spec.rb | Ruby | apache-2.0 | 94 | main | 1,077 | # frozen_string_literal: true
require 'spec_helper_acceptance'
volume_name = 'test-volume'
if os[:family] == 'windows'
docker_args = 'docker_ee => true'
command = '"/cygdrive/c/Program Files/Docker/docker"'
else
docker_args = ''
command = 'docker'
end
describe 'docker volume' do
before(:all) do
retry_... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/acceptance/docker_params_changed_spec.rb | Ruby | apache-2.0 | 94 | main | 4,941 | # frozen_string_literal: true
require 'spec_helper_acceptance'
if os[:family] == 'windows'
os_name = run_shell('systeminfo | findstr /R /C:"OS Name"')
raise 'Could not retrieve systeminfo for Windows box' if os_name.exit_code != 0
os_name = if os_name.stdout.split(%r{\s}).include?('2016')
'win-20... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/acceptance/compose_v3_spec.rb | Ruby | apache-2.0 | 94 | main | 4,634 | # frozen_string_literal: true
require 'spec_helper_acceptance'
tmp_path = '/tmp'
test_container = 'debian'
describe 'docker compose', :win_broken do
before(:all) do
retry_on_error_matching(60, 5, %r{connection failure running}) do
install_code = <<-CODE
class { 'docker': }
class { 'docker... |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/helper/get_docker_plugin_remove_flags.rb | Ruby | apache-2.0 | 94 | main | 270 | # frozen_string_literal: true
def get_docker_plugin_remove_flags(args)
flags = []
flags << '--force' if args['force_remove'] == true
flags << "'#{args['plugin_name']}'" if args['plugin_name'] && args['plugin_name'].to_s != 'undef'
flags.flatten.join(' ')
end |
github | puppetlabs/puppetlabs-docker | https://github.com/puppetlabs/puppetlabs-docker | spec/helper/get_docker_swarm_join_flags.rb | Ruby | apache-2.0 | 94 | main | 499 | # frozen_string_literal: true
def get_docker_swarm_join_flags(args)
flags = []
flags << 'join' if args['join'].to_s != 'false'
flags << "--advertise-addr '#{args['advertise_addr']}'" if args['advertise_addr'] && args['advertise_addr'].to_s != 'undef'
flags << "--listen-addr \"#{args['listen_addr']}\"" if ar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.