Class: DPL::Provider::Boxfuse

Inherits:
DPL::Provider show all
Defined in:
lib/dpl/provider/boxfuse.rb

Instance Attribute Summary

Attributes inherited from DPL::Provider

#context, #options

Instance Method Summary collapse

Methods inherited from DPL::Provider

apt_get, #check_app, #cleanup, #commit_msg, context, #create_key, #default_text_charset, #default_text_charset?, deprecated, #detect_encoding?, #encoding_for, #error, experimental, #initialize, #log, #needs_key?, new, npm_g, #option, pip, requires, #run, #setup_git_credentials, #setup_git_ssh, #sha, shell, #uncleanup, #user_agent, #warn

Constructor Details

This class inherits a constructor from DPL::Provider

Instance Method Details

#deployObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/dpl/provider/boxfuse.rb', line 5

def deploy
  @user = options[:user]
  @secret = options[:secret]
  @configfile = options[:configfile]
  @payload = options[:payload]
  @image = options[:image]
  @env = options[:env]
  @extra_args = options[:extra_args]

  @param_user = ''
  if @user.to_s != ''
    @param_user = " -user=" + @user
  end

  @param_secret = ''
  if @secret.to_s != ''
    @param_secret = " -secret=" + @secret
  end

  @param_configfile = ''
  if @configfile.to_s != ''
    @param_configfile = ' "-configfile=' + @configfile + '"'
  end

  @param_payload = ''
  if @payload.to_s != ''
    @param_payload = ' "' + @payload + '"'
  end

  @param_image = ''
  if @image.to_s != ''
    @param_image = " -image=" + @image
  end

  @param_env = ' -env=test'
  if @env.to_s != ''
    @param_env = " -env=" + @env
  end

  @param_extra_args = ''
  if @extra_args.to_s != ''
    @param_extra_args = " " + @extra_args
  end

  context.shell "curl -L https://files.boxfuse.com/com/boxfuse/client/boxfuse-commandline/latest/boxfuse-commandline-latest-linux-x64.tar.gz | tar xz"

  @command = "boxfuse/boxfuse run" + @param_user + @param_secret + @param_configfile + @param_payload + @param_image + @param_env + @param_extra_args
  context.fold("Deploying application") { context.shell @command }
end