forked from projectatomic/vagrant-service-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue projectatomic#195 Adding travis support
- Loading branch information
1 parent
4021187
commit 75de634
Showing
6 changed files
with
84 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
.ruby-version | ||
.ruby-gemset | ||
pkg | ||
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
language: ruby | ||
|
||
before_install: | ||
- sudo apt-get update -qq | ||
- sudo apt-get install -qq bsdtar libvirt-dev libvirt-bin qemu-kvm qemu | ||
|
||
rvm: | ||
- 2.0 | ||
|
||
env: | ||
global: | ||
- VAGRANT_SPEC_BOX="file://$TRAVIS_BUILD_DIR/tmp/cdk.box" | ||
- secure: "XO8175zGTqCfKfofkQhn2RonCdBOkoPic0TophmUmhNW2UKmdodo+JyX4pgC+sIT+X4BM37OPQz3mNNi+94h4l14KcU5VaNk2dkpxM25eQE7i0Znwff9fhFI74QAMfywTEwsLU+Fn1JfzqTrfvspSSKfGkkF+qVGeOjoIZ3VgEo0GOkYQpX8CaL/IXC2+h4cdEPlF3fTAZShA9UODsmplJ2q7lwFbpqDxVq2m3IkAGmGdC0+6+LN4uUUfnipiBgDCHGUpBWAVheKaZd9iL7J5SzzYd/PAsmC+OwCyrArmN3nu1RIUSrzCjLEkcGE3aCOCXbX9V60o4NnhwQbh7WuOMcgM8iMx1rAumlHI7BEaZDz8b+irkDgi4YAMxG6JwfRSkxZ/XvNXFgDXAXPl4RFfux4jhiHQAy0WPjyBanY+h33go6t60AKmLmILo6OtAU+yuWhiavpuiNeheXBuJ3ZWvyeVD+JKXEQ741DwHjYTDiKVXvlk+F/+iTX2v9ndxOrn+jgcYyNnTXadjRS78YYKkz2bu39MNtlJNWIzWQawjBer7zZkh4kHICA+DyDrWO13eHFwoLEH+bRcVHMNdu58Hkpdrk0MDfk8kCOI1/L5r81t3YA/U/H/3iGuTfmGnSWKX0E6G8PwMORReU3W0qHdu+RXxAMxGxtb3xqivrrv+E=" | ||
- secure: "fbUYIxRO3PIderFD/VigPtF7DgckHlNFMZnAsP3v7rLGLlG9ljy0LKmvF16uW9xTAsRF2sgSNFItzXraZnFOKoRtZQ7j4rA7dBmJQzVMWZ5t6fxZC9OZAgM/9yj6GtU7PpshDJjCa7uErTpe4KaMe80lNIawH8bwnWltEyaBoV/fqGMrDeWaXPGrA+d79w6nEprBSBjrosX6xts0zfEJRqiD1jcQ5lIp9OWo8Tv034EG0YKxKW6t+caRtXNK3Zv5g9KQ13O3xYn8zKg86HuBdi0394D4RHWRHF3IjFu7Wto6ZwbqZpX5L+zbI30x1IZYueCA2WT9rAc+rz9d2V5eJF/b7YULNPJYkDoxGPIEWfWMjfZC+saD3aJS2L1CMPRaF0CiS6dMd98nfd2I6xVUZR1Xl2+KhHU8Q6a84ry714eAp/xKXlidyEUpUTIooCkjryJ6HoU5d7zAOHgpDuHfaOZaGYIeUsX+NCAd8O0UG0UzpU4DA4M+ymx1fEvKPRhfUAE1AiK29+TxXvNBh3dMEnzaWn7caf/fLug9JTTtCrc3GoeM9umRyaQH6GK/lZ+qarPWc9bh1hFnhyQZfc40hSmGdVkGBfAU2HgaIg6pIo0VJ8k5oNa1I7nOmLKhc/UEtGbpX5rZgABOPQrYqCctkvMZnxOhY8YA/SskVKibI30=" | ||
|
||
cache: | ||
directories: | ||
- $TRAVIS_BUILD_DIR/tmp | ||
|
||
# uncomment this line if your project needs to run something other than `rake`: | ||
script: | ||
- export rvmsudo_secure_path=1 | ||
- rvmsudo ruby --version | ||
- rvmsudo gem --version | ||
- rvmsudo bundle --version | ||
- rvmsudo bundle exec rake getbox acceptance['libvirt'] | ||
- grep '0 failures' spec.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,53 @@ | ||
require "bundler/gem_tasks" | ||
require 'bundler/gem_tasks' | ||
require 'rake/clean' | ||
require 'mechanize' | ||
require 'fileutils' | ||
|
||
CLOBBER.include('pkg/*') | ||
|
||
desc 'Download Vagrant box' | ||
task :getbox do | ||
puts "Downloading box for #{ENV['REDHAT_USER']}" | ||
agent = Mechanize.new | ||
agent.follow_meta_refresh = true | ||
agent.get('https://access.redhat.com/downloads/content/293/ver=2/rhel---7/2.0.0/x86_64/product-software') do |page| | ||
|
||
# Submit first form which is the redirect to login page form | ||
login_page = page.forms.first.submit | ||
|
||
# Submit the login form | ||
after_login = login_page.form_with(:name => 'login_form') do |f| | ||
username_field = f.field_with(:id => 'username') | ||
username_field.value = ENV['REDHAT_USER'] | ||
password_field = f.field_with(:id => 'password') | ||
password_field.value = ENV['REDHAT_PASSWORD'] | ||
end.click_button | ||
|
||
# There is one more redirect afte successful login | ||
download_page = after_login.forms.first.submit | ||
|
||
download_page.links.each do |link| | ||
if link.href =~ /rhel-cdk-kubernetes-7.2-23.x86_64.vagrant-libvirt.box/ | ||
download_dir = File.join(File.dirname(__FILE__), 'tmp') | ||
unless File.directory?(download_dir) | ||
FileUtils.mkdir_p(download_dir) | ||
end | ||
agent.pluggable_parser.default = Mechanize::Download | ||
agent.get(link.href).save(File.join(download_dir, 'cdk.box')) | ||
end | ||
end | ||
end | ||
end | ||
|
||
desc 'Run acceptance specs using vagrant-spec' | ||
task :acceptance, [:provider] do |t, args| | ||
if args[:provider].nil? | ||
provider='virtualbox' | ||
provider='virtualbox' | ||
else | ||
provider=args[:provider] | ||
provider=args[:provider] | ||
end | ||
components = %w( | ||
cdk | ||
).map{|s| "provider/#{provider}/#{s}" } | ||
sh "export VAGRANT_SPEC_PROVIDER=#{provider} && bundle exec vagrant-spec test --components=#{components.join(' ')}" | ||
sh "export VAGRANT_SPEC_PROVIDER=#{provider} && bundle exec vagrant-spec test --components=#{components.join(' ')} | tee spec.log" | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters