rake_ci_tools 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +3 -13
- data/lib/rake_ci_tools/runners/calabash.rb +0 -17
- data/lib/rake_ci_tools/runners/sh.rb +0 -17
- data/lib/rake_ci_tools/runners/vagrant.rb +0 -57
- data/lib/rake_ci_tools/runners/xcode.rb +0 -26
- data/lib/rake_ci_tools/tasks/calabash_task.rb +0 -24
- data/lib/rake_ci_tools/tasks/cucumber_task.rb +0 -25
- data/lib/rake_ci_tools/tasks/deploy_tasks.rb +0 -6
- data/lib/rake_ci_tools/tasks/vagrant_task.rb +0 -19
- data/lib/rake_ci_tools/tasks/xcode_task.rb +0 -17
- data/lib/rake_ci_tools.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efec3b25900f23305d3388d4054379387145d3a1
|
4
|
+
data.tar.gz: 06a235b08365b86a32ca2f1dc04e581aae46a866
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45aab7ce20e24d33338a494dd8e310db89c06a2d5219d028a1f541056fd3aa67e43a19656a46ab5f1afc3d06af9b663e99ec1813922a04aa12c7edc40d7f4491
|
7
|
+
data.tar.gz: 386cee55084f41a76c0e63fc5e72c9d483b9b3c034bee2085242b36b30bd4985d3d626f9c9c0a7013ab1f960e3aab261a94f2ee6a44a835e1702514196bee783
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake_ci_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- chris griffiths
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -130,17 +130,7 @@ email:
|
|
130
130
|
executables: []
|
131
131
|
extensions: []
|
132
132
|
extra_rdoc_files: []
|
133
|
-
files:
|
134
|
-
- lib/rake_ci_tools.rb
|
135
|
-
- lib/rake_ci_tools/runners/calabash.rb
|
136
|
-
- lib/rake_ci_tools/runners/sh.rb
|
137
|
-
- lib/rake_ci_tools/runners/vagrant.rb
|
138
|
-
- lib/rake_ci_tools/runners/xcode.rb
|
139
|
-
- lib/rake_ci_tools/tasks/calabash_task.rb
|
140
|
-
- lib/rake_ci_tools/tasks/cucumber_task.rb
|
141
|
-
- lib/rake_ci_tools/tasks/deploy_tasks.rb
|
142
|
-
- lib/rake_ci_tools/tasks/vagrant_task.rb
|
143
|
-
- lib/rake_ci_tools/tasks/xcode_task.rb
|
133
|
+
files: []
|
144
134
|
homepage: https://github.com/ChrisGriffiths/rake_ci_tools
|
145
135
|
licenses:
|
146
136
|
- MIT
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Calabash_Runner
|
2
|
-
def self.enable_accessibility
|
3
|
-
sh 'calabash-ios sim acc'
|
4
|
-
end
|
5
|
-
|
6
|
-
def self.reset_simulator
|
7
|
-
sh 'calabash-ios sim reset'
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.sim_location(bundle_id)
|
11
|
-
sh "calabash-ios sim location on #{bundle_id}"
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.close_simulator
|
15
|
-
sh "/usr/bin/osascript -e 'tell app \"iPhone Simulator\" to quit'"
|
16
|
-
end
|
17
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Kernel
|
2
|
-
#Define sh runner
|
3
|
-
def sh(*cmd, &block)
|
4
|
-
if Hash === cmd.last then
|
5
|
-
options = cmd.pop
|
6
|
-
else
|
7
|
-
options = {}
|
8
|
-
end
|
9
|
-
unless block_given?
|
10
|
-
block = lambda { |ok, status|
|
11
|
-
ok or fail "Command failed with status (#{status.exitstatus}): [#{cmd.join(" ")}]"
|
12
|
-
}
|
13
|
-
end
|
14
|
-
res = system(*cmd)
|
15
|
-
block.call(res, $?)
|
16
|
-
end
|
17
|
-
end
|
@@ -1,57 +0,0 @@
|
|
1
|
-
module Vagrant
|
2
|
-
def self.task(tasks=[], project_location='./')
|
3
|
-
begin
|
4
|
-
puts "Creating Vagrantbox for Process ID: $$"
|
5
|
-
create_box('default')
|
6
|
-
copy_file_to_guest(project_location)
|
7
|
-
tasks.each { |task| command(task) }
|
8
|
-
ensure
|
9
|
-
destroy_box('default')
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.remoteLocation
|
14
|
-
ENV['VAGANT_REMOTE_DEST'] || 'vagrant_build'
|
15
|
-
end
|
16
|
-
|
17
|
-
#ALL BELOW UNTESTED REFACTOR
|
18
|
-
def self.create_box(boxName)
|
19
|
-
sh "vagrant up #{boxName} --provision"
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.destroy_box(boxName)
|
23
|
-
puts "Destorying: #{boxName}"
|
24
|
-
begin
|
25
|
-
get_file_from_guest('./',"#{remoteLocation}/ci-artifacts",boxName)
|
26
|
-
ensure
|
27
|
-
sh "vagrant destroy -f #{boxName}"
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.command(command)
|
32
|
-
sh "vagrant ssh --command \"cd #{remoteLocation} && #{command}\""
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.copy_file_to_guest(localLocation, boxName = "")
|
36
|
-
serverIp = get_ssh_details(/(?<=HostName ).*/, boxName)
|
37
|
-
scp(localLocation,"vagrant@#{serverIp}:#{remoteLocation}", boxName)
|
38
|
-
end
|
39
|
-
|
40
|
-
def self.get_file_from_guest(localLocation, boxName = "")
|
41
|
-
serverIp = get_ssh_details(/(?<=HostName ).*/,boxName)
|
42
|
-
scp("vagrant@#{serverIp}:#{remoteLocation}",localLocation,boxName)
|
43
|
-
end
|
44
|
-
|
45
|
-
def self.scp(from, to, boxName="")
|
46
|
-
portNum = get_ssh_details(/(?<=Port ).*/,boxName)
|
47
|
-
keyPath = get_ssh_details(/(?<=IdentityFile ).*/,boxName)
|
48
|
-
|
49
|
-
puts "PortNum: #{portNum}"
|
50
|
-
sh "scp -o 'StrictHostKeyChecking no' -i #{keyPath} -P #{portNum} -r #{from} #{to}"
|
51
|
-
end
|
52
|
-
|
53
|
-
def self.get_ssh_details(regex, boxName="")
|
54
|
-
response = `vagrant ssh-config #{boxName}`
|
55
|
-
return response.match(regex)
|
56
|
-
end
|
57
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module XCode
|
2
|
-
def self.build(workspace, scheme, configuration, sdk, build_dir)
|
3
|
-
if workspace.nil? || scheme.nil? || configuration.nil? || sdk.nil? || build_dir.nil?
|
4
|
-
raise(ArgumentError, "parameters can't be nil")
|
5
|
-
end
|
6
|
-
|
7
|
-
sh "xcodebuild -workspace '#{workspace}' -scheme '#{scheme}' -configuration '#{configuration}' -sdk '#{sdk}' CONFIGURATION_BUILD_DIR=#{build_dir}"
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.build_and_test(workspace, scheme, configuration, destination)
|
11
|
-
if workspace.nil? || scheme.nil? || configuration.nil? || destination.nil?
|
12
|
-
raise(ArgumentError, "parameters can't be nil")
|
13
|
-
end
|
14
|
-
|
15
|
-
sh "xcodebuild test -workspace '#{workspace}' -scheme '#{scheme}' -configuration '#{configuration}' -destination '#{destination}'"
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.archive(workspace, scheme, configuration, sdk, provisioning_profile, build_dir)
|
19
|
-
if workspace.nil? || scheme.nil? || provisioning_profile.nil? || configuration.nil? || build_dir.nil?
|
20
|
-
raise(ArgumentError, "parameters can't be nil")
|
21
|
-
end
|
22
|
-
|
23
|
-
build(workspace, scheme, configuration, sdk, build_dir)
|
24
|
-
sh "/usr/bin/xcrun -sdk iphoneos PackageApplication -v '#{build_dir}/#{scheme}.app' -o '#{build_dir}/#{scheme}.ipa' --embed '#{provisioning_profile}'"
|
25
|
-
end
|
26
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'calabash-cucumber'
|
2
|
-
|
3
|
-
namespace :calabash do
|
4
|
-
|
5
|
-
desc "Reset Simulator Content and Settings"
|
6
|
-
task :reset_simulator do
|
7
|
-
Calabash_Runner::reset_simulator
|
8
|
-
end
|
9
|
-
|
10
|
-
desc "Enable Accessibility On Simulator"
|
11
|
-
task :enable_accessibility do
|
12
|
-
Calabash_Runner::enable_accessibility
|
13
|
-
end
|
14
|
-
|
15
|
-
desc "Disable Location Dialog On Simulator"
|
16
|
-
task :disable_location_dialog , :bundle_id do |_,args|
|
17
|
-
Calabash_Runner::sim_location(args[:bundle_id])
|
18
|
-
end
|
19
|
-
|
20
|
-
desc "Close the Simulator"
|
21
|
-
task :close_simulator do
|
22
|
-
Calabash_Runner::close_simulator
|
23
|
-
end
|
24
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'cucumber'
|
2
|
-
require 'cucumber/rake/task'
|
3
|
-
|
4
|
-
namespace :cucumber do
|
5
|
-
desc "Run Cucumber Tests"
|
6
|
-
task :run, [:features] do |_ , args|
|
7
|
-
args.with_defaults(:features=>nil)
|
8
|
-
Cucumber::Rake::Task.new do |t|
|
9
|
-
t.fork = false
|
10
|
-
t.cucumber_opts = args[:features] unless args[:features].nil?
|
11
|
-
t.runner.run
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
desc "Run Cucumber with profile"
|
16
|
-
task :profile, [:profile,:features] do |_ , args|
|
17
|
-
raise(ArgumentError, "Profile must be defined") if args[:profile].nil?
|
18
|
-
Cucumber::Rake::Task.new do |t|
|
19
|
-
t.fork = false
|
20
|
-
t.cucumber_opts = args[:features] unless args[:features].nil?
|
21
|
-
t.profile = args[:profile]
|
22
|
-
t.runner.run
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
namespace :vagrant do
|
2
|
-
task :ios_cucumber_tests do
|
3
|
-
|
4
|
-
task_list = []
|
5
|
-
task_list << 'bundle'
|
6
|
-
task_list << 'rake setup'
|
7
|
-
task_list << 'rake build'
|
8
|
-
|
9
|
-
feature_list = ENV['FEATURE_LIST'] || ''
|
10
|
-
|
11
|
-
if feature_list.empty?
|
12
|
-
task_list << "rake cucumber:profile['ios']"
|
13
|
-
else
|
14
|
-
task_list << "rake cucumber:profile['ios','#{feature_list}']"
|
15
|
-
end
|
16
|
-
|
17
|
-
Vagrant::task(task_list)
|
18
|
-
end
|
19
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
namespace :xcode do
|
2
|
-
desc "Xcode Build"
|
3
|
-
task :build, [:workspace, :scheme, :configuration, :sdk, :buildDir] do |_, args|
|
4
|
-
args.with_defaults(:sdk => 'iphonesimulator', :buildDir => 'ci-artifacts')
|
5
|
-
XCode::build(args[:workspace],args[:scheme],args[:configuration],args[:sdk],args[:buildDir])
|
6
|
-
end
|
7
|
-
|
8
|
-
desc "Xcode Test"
|
9
|
-
task :build_test, [:workspace, :scheme, :configuration, :destinations] do |_ , args|
|
10
|
-
XCode::build_and_test(args[:workspace],args[:scheme],args[:configuration],args[:destinations])
|
11
|
-
end
|
12
|
-
|
13
|
-
desc "Achieve ipa"
|
14
|
-
task :archive, [:workspace, :scheme, :configuration, :sdk, :provisioning_profile, :destinations] do |_ , args|
|
15
|
-
XCode::archive(args[:workspace],args[:scheme],args[:configuration],args[:sdk],args[:provisioning_profile],args[:destinations])
|
16
|
-
end
|
17
|
-
end
|
data/lib/rake_ci_tools.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
base_path = File.join(File.dirname(__FILE__),'rake_ci_tools')
|
2
|
-
|
3
|
-
require 'rake'
|
4
|
-
|
5
|
-
require File.join(base_path, 'tasks', 'cucumber_task')
|
6
|
-
require File.join(base_path, 'tasks', 'xcode_task')
|
7
|
-
require File.join(base_path, 'tasks', 'vagrant_task')
|
8
|
-
require File.join(base_path, 'tasks', 'calabash_task')
|
9
|
-
# require File.join(base_path, 'tasks', 'deploy_tasks')
|
10
|
-
|
11
|
-
require File.join(base_path, 'runners', 'sh')
|
12
|
-
require File.join(base_path, 'runners', 'xcode')
|
13
|
-
require File.join(base_path, 'runners', 'vagrant')
|
14
|
-
require File.join(base_path, 'runners', 'calabash')
|
15
|
-
# require File.join(base_path, 'runners', 'deploy')
|