Class: Opsk::DeployBintray

Inherits:
Thor::Group
  • Object
show all
Includes:
Thorable, Thor::Actions
Defined in:
lib/opskeleton/deploy_bintray.rb

Instance Method Summary collapse

Methods included from Thorable

#artifact, #artifact_path, #check_root, included, #machines, #meta, #name, #type_of

Instance Method Details

#uploadObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/opskeleton/deploy_bintray.rb', line 15

def upload
	require 'bintray_deploy'
	pkg = Opsk::Package.new
	tar =  "#{pkg.artifact_path}.tar.gz"
	base = File.basename(tar)
	if(File.exists?(tar))
	  begin
 BintrayDeploy::Actions.new.deploy(repo, "#{pkg.meta.name}-sandbox", pkg.meta.version, tar)
 say("deployed #{base} to http://dl.bintray.com/#{C.user}/#{repo}/#{base}")
	  rescue Exception => e
      say("failed to deploy due to #{e}")
	  end
	else
	  say('package is missing please run opsk package first')
	  exit(1)
	end
end

#validateObject



10
11
12
# File 'lib/opskeleton/deploy_bintray.rb', line 10

def validate
	check_root
end