vagrant-gpii-ci 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +21 -0
- data/README.md +94 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/envs/default.json +20 -0
- data/lib/envs/linux-desktop.json +22 -0
- data/lib/envs/production.yml +33 -0
- data/lib/provisioning/base-playbook.yml +16 -0
- data/lib/provisioning/couchdb-playbook.yml +11 -0
- data/lib/provisioning/couchdb-requirements.yml +5 -0
- data/lib/provisioning/couchdb-vagrant-vars.yml +1 -0
- data/lib/provisioning/gpii-linux-playbook.yml +11 -0
- data/lib/provisioning/gpii-linux-requirements.yml +6 -0
- data/lib/provisioning/gpii-linux-vagrant-vars.yml +23 -0
- data/lib/provisioning/nodejs-playbook.yml +12 -0
- data/lib/provisioning/nodejs-requirements.yml +7 -0
- data/lib/provisioning/nodejs-vagrant-vars.yml +11 -0
- data/lib/provisioning/preferences-playbook.yml +13 -0
- data/lib/provisioning/preferences-requirements.yml +9 -0
- data/lib/provisioning/preferences-vagrant-vars.yml +5 -0
- data/lib/vagrant-gpii-ci/action/init_environment.rb +24 -0
- data/lib/vagrant-gpii-ci/action.rb +122 -0
- data/lib/vagrant-gpii-ci/command/base.rb +19 -0
- data/lib/vagrant-gpii-ci/command/init.rb +28 -0
- data/lib/vagrant-gpii-ci/command/test.rb +65 -0
- data/lib/vagrant-gpii-ci/config/config_folders.rb +17 -0
- data/lib/vagrant-gpii-ci/config/config_network.rb +69 -0
- data/lib/vagrant-gpii-ci/config/config_provider.rb +40 -0
- data/lib/vagrant-gpii-ci/config/config_provision.rb +50 -0
- data/lib/vagrant-gpii-ci/plugin.rb +59 -0
- data/lib/vagrant-gpii-ci/version.rb +5 -0
- data/lib/vagrant-gpii-ci.rb +18 -0
- data/qi.yml.template +56 -0
- data/samples/README.md +12 -0
- data/samples/gpii-linux/.qi.yml +22 -0
- data/samples/gpii-linux-production/.qi.yml +41 -0
- data/samples/gpii-nexus/.qi.yml +24 -0
- data/samples/gpii-universal/.qi.yml +27 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/vagrant/cienv_spec.rb +11 -0
- data/vagrant-cienv.gemspec +33 -0
- metadata +137 -0
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
|
3
|
+
module VagrantPlugins
|
4
|
+
module Cienv
|
5
|
+
module Command
|
6
|
+
class Root < Vagrant.plugin("2", :command)
|
7
|
+
def self.synopsis
|
8
|
+
"Manages QI environments"
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(argv, env)
|
12
|
+
super
|
13
|
+
|
14
|
+
@main_args, @sub_command, @sub_args = split_main_and_subcommand(argv)
|
15
|
+
|
16
|
+
@subcommands = Vagrant::Registry.new
|
17
|
+
@subcommands.register(:init) do
|
18
|
+
require_relative "init"
|
19
|
+
InitEnvironment
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def execute
|
24
|
+
if @main_args.include?("-h") || @main_args.include?("--help")
|
25
|
+
# Print the help for all the sub-commands.
|
26
|
+
puts "Help not completed yet"
|
27
|
+
return help
|
28
|
+
end
|
29
|
+
|
30
|
+
# If we reached this far then we must have a subcommand. If not,
|
31
|
+
# then we also just print the help and exit.
|
32
|
+
command_class = @subcommands.get(@sub_command.to_sym) if @sub_command
|
33
|
+
return help if !command_class || !@sub_command
|
34
|
+
@logger.debug("Invoking command class: #{command_class} #{@sub_args.inspect}")
|
35
|
+
|
36
|
+
# Initialize and execute the command class
|
37
|
+
command_class.new(@sub_args, @env).execute
|
38
|
+
end
|
39
|
+
|
40
|
+
# Prints the help out for this command
|
41
|
+
def help
|
42
|
+
opts = OptionParser.new do |o|
|
43
|
+
o.banner = "Usage: vagrant test [<args>]"
|
44
|
+
o.separator ""
|
45
|
+
o.separator "Available subcommands:"
|
46
|
+
|
47
|
+
# Add the available subcommands as separators in order to print them
|
48
|
+
# out as well.
|
49
|
+
keys = []
|
50
|
+
@subcommands.each { |key, value| keys << key.to_s }
|
51
|
+
|
52
|
+
keys.sort.each do |key|
|
53
|
+
o.separator " #{key}"
|
54
|
+
end
|
55
|
+
|
56
|
+
o.separator ""
|
57
|
+
o.separator "For help on any individual command run `vagrant test -h`"
|
58
|
+
end
|
59
|
+
|
60
|
+
@env.ui.info(opts.help, prefix: false)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
def config_folders(instance, vm_id, apps, vagrant_ci_path)
|
5
|
+
|
6
|
+
instance.vm.synced_folder ".", "/vagrant" # Always needed by the provisioning
|
7
|
+
instance.vm.synced_folder vagrant_ci_path + "/provisioning", "/provisioning" # Always needed by the provisioning
|
8
|
+
|
9
|
+
# Share folder if the "src" variable is set
|
10
|
+
apps.each do |config|
|
11
|
+
if config["run_in"] == vm_id and config["folder"] and config["folder"]["src"] then
|
12
|
+
instance.vm.synced_folder config["folder"]["src"], config["folder"]["dest"]
|
13
|
+
end
|
14
|
+
end if apps
|
15
|
+
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
# Builds a file with the list of pairs IP address: hostname which will be read
|
5
|
+
# by Ansible to setup the hosts file in each VM
|
6
|
+
# Params:
|
7
|
+
# +env_vms+: object with the definition of the virtual machines
|
8
|
+
|
9
|
+
def build_hosts_list(env_vms)
|
10
|
+
|
11
|
+
int_id = 10
|
12
|
+
|
13
|
+
first = true
|
14
|
+
env_vms.each do |vm, vmconfig|
|
15
|
+
vmconfig["networks"].each do |name, netcfg|
|
16
|
+
if netcfg["type"] == "private" then
|
17
|
+
if netcfg['ip'].nil? then
|
18
|
+
netcfg['ip'] = "192.168.50." + int_id.to_s
|
19
|
+
#add the default IP to the environment definnition
|
20
|
+
env_vms[vm]["networks"][name]["ip"] = "192.168.50." + int_id.to_s
|
21
|
+
int_id += 1
|
22
|
+
end
|
23
|
+
if first then
|
24
|
+
$base_vars = "vms_hosts={"
|
25
|
+
$base_vars << "\"#{netcfg['ip']}\":\"#{vm}\""
|
26
|
+
first = false
|
27
|
+
elsif
|
28
|
+
$base_vars << ",\"#{netcfg['ip']}\":\"#{vm}\""
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end if vmconfig["networks"]
|
32
|
+
end
|
33
|
+
$base_vars << "}" if $base_vars
|
34
|
+
end
|
35
|
+
|
36
|
+
# Configure the network section of a virtual machine. You can set the type of
|
37
|
+
# the network, the ip address if needed and a list of forwarded ports.
|
38
|
+
# Params:
|
39
|
+
# +instance+: The instance of the VM to configure
|
40
|
+
# +vm_config+: the definition of the VM. There are to type of networks: private
|
41
|
+
# - where the IP setting is available, and public - where virtualbox will set
|
42
|
+
# the interface as an external NIC.
|
43
|
+
|
44
|
+
def config_network(instance, vm_config)
|
45
|
+
|
46
|
+
vm_config["networks"].each do |network, config|
|
47
|
+
if config["type"] == "private" then
|
48
|
+
if config["ip"] then
|
49
|
+
instance.vm.network :private_network, ip: config["ip"]
|
50
|
+
end
|
51
|
+
elsif config["type"] == "public" then
|
52
|
+
instance.vm.network :public_network
|
53
|
+
end
|
54
|
+
end if vm_config["networks"]
|
55
|
+
|
56
|
+
vm_config["ports"].each do |port, config|
|
57
|
+
|
58
|
+
raise "At least the guest port is needed in 'guest_port' variable" \
|
59
|
+
if config["guest_port"].nil?
|
60
|
+
|
61
|
+
instance.vm.network "forwarded_port",
|
62
|
+
guest: config["guest_port"],
|
63
|
+
host: config["host_port"] || config["guest_port"],
|
64
|
+
protocol: config["protocol"] || "tcp",
|
65
|
+
auto_correct: config["auto_correct"] || true
|
66
|
+
end if vm_config["ports"]
|
67
|
+
|
68
|
+
end
|
69
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
def config_provider(instance, vm_config, global_config)
|
5
|
+
|
6
|
+
if global_config["provider"] == "virtualbox" then
|
7
|
+
|
8
|
+
instance.vm.provider :virtualbox do |vm|
|
9
|
+
|
10
|
+
vm.linked_clone = vm_config["clone"] || global_config["clone"] || false
|
11
|
+
|
12
|
+
vm.customize ["modifyvm", :id, "--memory", vm_config["memory"] || global_config["memory"] ]
|
13
|
+
vm.customize ["modifyvm", :id, "--cpus", vm_config["cpu"] || global_config["cpu"] ]
|
14
|
+
|
15
|
+
if vm_config["gui"] == true then
|
16
|
+
vm.customize ["modifyvm", :id, "--vram", "128"]
|
17
|
+
vm.customize ["modifyvm", :id, "--accelerate3d", "on"]
|
18
|
+
end
|
19
|
+
|
20
|
+
if vm_config["sound"] == true then
|
21
|
+
vm.customize ["modifyvm", :id, "--audio", "null", "--audiocontroller", "ac97"]
|
22
|
+
end
|
23
|
+
|
24
|
+
vm.customize ["modifyvm", :id, "--ioapic", "on"]
|
25
|
+
vm.customize ["setextradata", "global", "GUI/SuppressMessages", "all"]
|
26
|
+
|
27
|
+
vm.gui = vm_config["gui"] || global_config["gui"] || false
|
28
|
+
end
|
29
|
+
|
30
|
+
instance.vm.box = vm_config["box"]
|
31
|
+
|
32
|
+
elsif global_config["provider"] == "libvirt" then
|
33
|
+
raise "Not supported yet"
|
34
|
+
else
|
35
|
+
raise "Provider not defined in global configuration" unless global_config.include?('provider')
|
36
|
+
raise "Provider #{global_config['provider']} not supported"
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
def config_provision(instance, vm_config, vm_id, apps, vagrant_ci_path)
|
7
|
+
|
8
|
+
|
9
|
+
apps.each do |config|
|
10
|
+
if config["run_in"] == vm_id then
|
11
|
+
if ARGV[0] == "up" then
|
12
|
+
app = config["app_name"] #app_name
|
13
|
+
stack = config["software_stack"]
|
14
|
+
|
15
|
+
#check if every file is in place
|
16
|
+
raise "File vagrant/provisioning/#{stack}-requirements.yml doesn't exist"\
|
17
|
+
unless File.file?(vagrant_ci_path + "/provisioning/#{stack}-requirements.yml")
|
18
|
+
raise "File vagrant/provisioning/#{stack}-vars.yml doesn't exist"\
|
19
|
+
unless File.file?(vagrant_ci_path + "/provisioning/#{stack}-vagrant-vars.yml")
|
20
|
+
raise "File vagrant/provisioning/#{stack}-playbook.yml doesn't exist"\
|
21
|
+
unless File.file?(vagrant_ci_path + "/provisioning/#{stack}-playbook.yml")
|
22
|
+
raise "File vagrant/provisioning/base-playbook.yml doesn't exist"\
|
23
|
+
unless File.file?(vagrant_ci_path + "/provisioning/base-playbook.yml")
|
24
|
+
|
25
|
+
qi_vars = JSON.dump(YAML::load(config.to_yaml))
|
26
|
+
|
27
|
+
basecmd = "sudo PYTHONUNBUFFERED=1 VM_HOSTNAME=#{vm_id} "\
|
28
|
+
"ansible-playbook --extra-vars='#$base_vars' /provisioning/base-playbook.yml"
|
29
|
+
instance.vm.provision "shell", inline: basecmd
|
30
|
+
|
31
|
+
cmds = \
|
32
|
+
"sudo ansible-galaxy install -fr /provisioning/#{stack}-requirements.yml \n"\
|
33
|
+
"sudo VARS_FILE=#{stack}-vagrant-vars.yml PYTHONUNBUFFERED=1 \\\n"
|
34
|
+
if config["deploy"] then
|
35
|
+
cmds << "ansible-playbook --tags='install,configure,deploy' --extra-vars='#{qi_vars}' /provisioning/#{stack}-playbook.yml"
|
36
|
+
else
|
37
|
+
cmds << "ansible-playbook --tags='install,configure' --extra-vars='#{qi_vars}' /provisioning/#{stack}-playbook.yml"
|
38
|
+
end
|
39
|
+
instance.vm.provision "shell", inline: cmds
|
40
|
+
|
41
|
+
elsif ARGV[0] == "provision" and config["test_cmds"] and config["folder"] and config["folder"]["dest"] then
|
42
|
+
test_cmds = "cd #{config['folder']['dest']} \n"
|
43
|
+
config["test_cmds"].each do |cmd|
|
44
|
+
test_cmds << "DISPLAY=:0 " + cmd + "\n"
|
45
|
+
end unless config["test_cmds"].nil?
|
46
|
+
instance.vm.provision "shell", privileged: false, inline: test_cmds
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end if apps
|
50
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
begin
|
2
|
+
require "vagrant"
|
3
|
+
rescue LoadError
|
4
|
+
raise "The Vagrant QI plugin must be run within Vagrant."
|
5
|
+
end
|
6
|
+
|
7
|
+
# This is a sanity check to make sure no one is attempting to install
|
8
|
+
# this into an early Vagrant version.
|
9
|
+
if Vagrant::VERSION < "1.8.0"
|
10
|
+
raise "The Vagrant QI plugin is only compatible with Vagrant 1.8+"
|
11
|
+
end
|
12
|
+
|
13
|
+
module VagrantPlugins
|
14
|
+
module Cienv
|
15
|
+
class Plugin < Vagrant.plugin("2")
|
16
|
+
name "Cienv"
|
17
|
+
description "This plugin enabled Vagrant to work with QI QI environments"
|
18
|
+
|
19
|
+
action_hook(:build_config, :environment_load) do |hook|
|
20
|
+
hook.prepend(VagrantPlugins::Cienv::Action::BuildVagrantfile)
|
21
|
+
end
|
22
|
+
command("test") do
|
23
|
+
require File.expand_path("../command/test", __FILE__)
|
24
|
+
Command::Test
|
25
|
+
end
|
26
|
+
|
27
|
+
# This sets up our log level to be whatever VAGRANT_LOG is.
|
28
|
+
def self.setup_logging
|
29
|
+
require "log4r"
|
30
|
+
|
31
|
+
level = nil
|
32
|
+
begin
|
33
|
+
level = Log4r.const_get(ENV["VAGRANT_LOG"].upcase)
|
34
|
+
rescue NameError
|
35
|
+
# This means that the logging constant wasn't found,
|
36
|
+
# which is fine. We just keep `level` as `nil`. But
|
37
|
+
# we tell the user.
|
38
|
+
level = nil
|
39
|
+
end
|
40
|
+
|
41
|
+
# Some constants, such as "true" resolve to booleans, so the
|
42
|
+
# above error checking doesn't catch it. This will check to make
|
43
|
+
# sure that the log level is an integer, as Log4r requires.
|
44
|
+
level = nil if !level.is_a?(Integer)
|
45
|
+
|
46
|
+
# Set the logging level on all "vagrant" namespaced
|
47
|
+
# logs as long as we have a valid level.
|
48
|
+
if level
|
49
|
+
logger = Log4r::Logger.new("vagrant_cienv")
|
50
|
+
logger.outputters = Log4r::Outputter.stderr
|
51
|
+
logger.level = level
|
52
|
+
logger = nil
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
require 'vagrant-gpii-ci/plugin'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require "pathname"
|
2
|
+
|
3
|
+
require "vagrant-gpii-ci/plugin"
|
4
|
+
|
5
|
+
module VagrantPlugins
|
6
|
+
module Cienv
|
7
|
+
lib_path = Pathname.new(File.expand_path("../vagrant-gpii-ci", __FILE__))
|
8
|
+
autoload :Action, lib_path.join("action")
|
9
|
+
autoload :Errors, lib_path.join("errors")
|
10
|
+
|
11
|
+
# This returns the path to the source of this plugin.
|
12
|
+
#
|
13
|
+
# @return [Pathname]
|
14
|
+
def self.source_root
|
15
|
+
@source_root ||= Pathname.new(File.expand_path("../../", __FILE__))
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/qi.yml.template
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
|
3
|
+
# This is a template .qi.yml file. It shows the available variables to setup the
|
4
|
+
# applications that will run in the VM enviroment. More examples are available
|
5
|
+
# in the 'samples' directory.
|
6
|
+
|
7
|
+
email: anonymous@testdomain.org
|
8
|
+
# env_runtime variable set the VM enviroment that will be used to run the
|
9
|
+
# applications below. You can see the available environments in 'env' directory
|
10
|
+
env_runtime: linux-desktop
|
11
|
+
|
12
|
+
# The apps variable lists the applications that must be installed. The
|
13
|
+
# properties of each application define the source of the code, the way that are
|
14
|
+
# deployed and how should run
|
15
|
+
|
16
|
+
apps:
|
17
|
+
# The app_name variable set an unique identifier that can be used to create the
|
18
|
+
# instances of the running applications, or to name a directory where all the
|
19
|
+
# files related to the application will be stored.
|
20
|
+
- app_name: name-of-application
|
21
|
+
# the git_repository variable is used to retrieve the source code of the
|
22
|
+
# application if the code is not available through a shared folder. You can also
|
23
|
+
# set a git_branch variable to set the branch,tag,commit or pull request to
|
24
|
+
# retrieve.
|
25
|
+
git_repository: https://github.com/user/repo.git
|
26
|
+
git_branch: pr/1
|
27
|
+
# The software_stack variable set the software applicance that will be installed
|
28
|
+
# in the vm. The avaliable software stacks are in the provisioning directory.
|
29
|
+
software_stack: [nodejs | couchdb]
|
30
|
+
# The deploy variable notifies to the stack that this application will be
|
31
|
+
# launched as a service. Note that the stack must know how to launch this
|
32
|
+
# application.
|
33
|
+
deploy: false
|
34
|
+
# The 'run_in' variable indicates which VM of the environment will contain the
|
35
|
+
# application. To know the name of the VMs see the environment files found in
|
36
|
+
# the 'env' directory.
|
37
|
+
run_in: fedora
|
38
|
+
# The setup variable list the command that will be executed after the
|
39
|
+
# provisioning of the software_stack is finished.
|
40
|
+
setup:
|
41
|
+
- command 1
|
42
|
+
- command 2
|
43
|
+
# The test_cmds variable list the commands that will be executed on every
|
44
|
+
# 'vagrant provision' command. This list usually have the commands that test the
|
45
|
+
# application, so every time you run 'vagrant provision' all these commands
|
46
|
+
# will run the tests of your application.
|
47
|
+
test_cmds:
|
48
|
+
- test command 1
|
49
|
+
- test command 2
|
50
|
+
# The folder variable sets the installation folder of the application. The
|
51
|
+
# 'dest' child variable is the destination folder where the application will be
|
52
|
+
# installed. If you add a 'src' child variable Vagrant will map that path from
|
53
|
+
# the host to the 'dest' path in the VM. Vagrant will create a shared folder
|
54
|
+
# using this information.
|
55
|
+
folder:
|
56
|
+
dest: "/app/{{ app_name }}"
|
data/samples/README.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
Examples
|
2
|
+
-------
|
3
|
+
|
4
|
+
This folder contains several examples of how to use the vagrant-gpii-ci plugin. To
|
5
|
+
run any of these examples:
|
6
|
+
|
7
|
+
1. Copy the directory in some place
|
8
|
+
2. Go to that directory
|
9
|
+
2. Install the plugin
|
10
|
+
`vagrant plugin install vagrant-gpii-ci`
|
11
|
+
3. Run vagrant:
|
12
|
+
`vagrant up && vagrant test`
|
@@ -0,0 +1,22 @@
|
|
1
|
+
---
|
2
|
+
|
3
|
+
email: anonymous@testdomain.org
|
4
|
+
env_runtime: linux-desktop
|
5
|
+
|
6
|
+
apps:
|
7
|
+
- app_name: gpii-linux
|
8
|
+
git_repository: https://github.com/GPII/linux.git
|
9
|
+
software_stack: gpii-linux
|
10
|
+
folder:
|
11
|
+
dest: /app/gpii-linux
|
12
|
+
run_in: fedora
|
13
|
+
deploy: false
|
14
|
+
setup:
|
15
|
+
- npm install
|
16
|
+
- sudo npm install -g grunt-cli node-gyp
|
17
|
+
- grunt --force build
|
18
|
+
test_cmds:
|
19
|
+
- "find -name \\*.sh -exec chmod +x '{}' \\;"
|
20
|
+
- node tests/AcceptanceTests.js
|
21
|
+
- cd tests && bash UnitTests.sh
|
22
|
+
|
@@ -0,0 +1,41 @@
|
|
1
|
+
---
|
2
|
+
|
3
|
+
# This sample will spin up two VMs, one server without desktop interface, and
|
4
|
+
# another one with a desktop interface called 'fedora', both are provided by the
|
5
|
+
# file 'production.json'. Then 3 applications will be installed, gpii-linux will
|
6
|
+
# be installed in the 'fedora' VM and couchdb and preferences will be installed
|
7
|
+
# in then 'server' VM. The commands listed in the 'setup' variable will run at
|
8
|
+
# 'vagrant up' time, and the commands listed in the 'test_cmds' variable will be
|
9
|
+
# run using the 'vagrant provision' command.
|
10
|
+
|
11
|
+
email: anonymous@testdomain.org
|
12
|
+
env_runtime: production
|
13
|
+
|
14
|
+
apps:
|
15
|
+
- app_name: gpii-linux
|
16
|
+
git_repository: https://github.com/GPII/linux.git
|
17
|
+
software_stack: gpii-linux
|
18
|
+
folder:
|
19
|
+
dest: /app/gpii-linux
|
20
|
+
run_in: fedora
|
21
|
+
deploy: false
|
22
|
+
setup:
|
23
|
+
- npm install
|
24
|
+
- sudo npm install -g grunt-cli node-gyp
|
25
|
+
- grunt --force build
|
26
|
+
test_cmds:
|
27
|
+
- "find -name \\*.sh -exec chmod +x '{}' \\;"
|
28
|
+
- node tests/AcceptanceTests.js
|
29
|
+
- cd tests && bash UnitTests.sh
|
30
|
+
|
31
|
+
- app_name: couchdb
|
32
|
+
software_stack: couchdb
|
33
|
+
run_in: server
|
34
|
+
deploy: true
|
35
|
+
|
36
|
+
- app_name: preferences
|
37
|
+
software_stack: preferences
|
38
|
+
run_in: server
|
39
|
+
deploy: true
|
40
|
+
folder:
|
41
|
+
dest: "/app/{{ app_name }}"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
---
|
2
|
+
|
3
|
+
# This sample fetchs the Pull Request #1 of the GPII/nexus repository, spin up a
|
4
|
+
# fedora VM an run the tests when 'vagrant provision' command is run.
|
5
|
+
|
6
|
+
email: anonymous@testdomain.org
|
7
|
+
env_runtime: linux-desktop
|
8
|
+
|
9
|
+
apps:
|
10
|
+
- app_name: gpii-nexus
|
11
|
+
git_repository: https://github.com/GPII/nexus.git
|
12
|
+
git_branch: pr/1
|
13
|
+
software_stack: nodejs
|
14
|
+
folder:
|
15
|
+
dest: /app/gpii-nexus
|
16
|
+
run_in: fedora
|
17
|
+
deploy: false
|
18
|
+
setup:
|
19
|
+
- npm install
|
20
|
+
- sudo npm install -g grunt-cli node-gyp
|
21
|
+
- grunt --force build
|
22
|
+
test_cmds:
|
23
|
+
- node tests/all-tests.js
|
24
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
---
|
2
|
+
|
3
|
+
# This sample will spin up one VM with the desktop interface (linux-desktop
|
4
|
+
# environment). Then will deploy an application named 'gpii-universal' which is
|
5
|
+
# a clone of the repository https://github.com/GPII/universal.git. It will exec
|
6
|
+
# the commands listed in the 'setup' variable at 'vagrant up' time, and the
|
7
|
+
# 'test_cmds' commands will be executed with 'vagrant provision'.
|
8
|
+
|
9
|
+
email: anonymous@testdomain.org
|
10
|
+
env_runtime: linux-desktop
|
11
|
+
|
12
|
+
apps:
|
13
|
+
- app_name: gpii-universal
|
14
|
+
git_repository: https://github.com/GPII/universal.git
|
15
|
+
software_stack: nodejs
|
16
|
+
folder:
|
17
|
+
dest: /app/gpii-universal
|
18
|
+
run_in: fedora
|
19
|
+
setup:
|
20
|
+
- npm install
|
21
|
+
- "sudo npm install -g testem"
|
22
|
+
- "git clone {{ git_repository }} /app/gpii-universal/node_modules/universal"
|
23
|
+
test_cmds:
|
24
|
+
- "npm test"
|
25
|
+
- "testem ci --file tests/web/testem_qi.json"
|
26
|
+
- "node tests/ProductionConfigTests.js"
|
27
|
+
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'vagrant-gpii-ci/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "vagrant-gpii-ci"
|
8
|
+
spec.version = VagrantPlugins::Cienv::VERSION
|
9
|
+
spec.authors = ["Alfredo Matas"]
|
10
|
+
spec.email = ["amatas@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Vagrant CI environment builder}
|
13
|
+
spec.description = %q{Vagrant CI environment builder}
|
14
|
+
spec.homepage = "http://github.com/amatas/vagrant-gpii-ci.git"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
18
|
+
# delete this section to allow pushing this gem to any host.
|
19
|
+
# if spec.respond_to?(:metadata)
|
20
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
+
# else
|
22
|
+
# raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
23
|
+
# end
|
24
|
+
|
25
|
+
spec.files = `git ls-files`.split($\)
|
26
|
+
spec.executables = spec.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
27
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
28
|
+
spec.require_paths = ["lib"]
|
29
|
+
|
30
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
31
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
32
|
+
spec.add_development_dependency "method_source", "~> 0.8.2"
|
33
|
+
end
|