Class: Build47

Inherits:
Object
  • Object
show all
Defined in:
lib/build_47.rb

Instance Method Summary collapse

Constructor Details

#initialize(account_token) ⇒ Build47

Returns a new instance of Build47.



5
6
7
# File 'lib/build_47.rb', line 5

def initialize()
  @token = 
end

Instance Method Details

#push(app_id, platform, env, file_path, release_notes) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/build_47.rb', line 9

def push(app_id, platform, env, file_path, release_notes)
  build_doc = { 
   build: { 
     platform: platform, 
     environment: env, 
     upload: File.new(file_path), 
     build_file: file_path.split('/')[-1], 
     release_notes: release_notes,
     make_active: true
     }
  }
  response = RestClient.post  "https://cirrus.app47.com/api/apps/#{app_id}/builds", build_doc, {"X-Token"=> @token, accept: :json}
  puts "response code: #{response.code}"
end