vagrant-gpii-ci 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c18cb8461cb2c1d40fee507d112b8849d9e4dd55
4
- data.tar.gz: 1084314c7f12dbf7e22b4e342196b747c15c10dc
3
+ metadata.gz: 5f4961a92e8881a6fbf78ca95adb2de0263288b3
4
+ data.tar.gz: 14235567b7194116ca55a46dc46cb43f6373432d
5
5
  SHA512:
6
- metadata.gz: 540511175a240cb005ddb242262bfe20ca3bfe67075d0e3ff197932fca347425f8f8087073aa0c55a7dbefc2de7b71b94b28c614de93a5e5239f11bcf97ecbe2
7
- data.tar.gz: c4ba518fb112510ed4e54bfcdcdcc2e8f6a4a7be99bb41e804fd8e29c168fcba09b58e7bfec7a21483090aa3f4313ad111d85ad558a3c07636cb1e1cdacfa5ba
6
+ metadata.gz: 94d6fd40f82dbda8c84d7e769ba6d02fba62ee6a3bb18e401499b076b925859ace03cd72992a6c78764f49b646c89889f311c39eacaf93a2ef83d29b5b49f92e
7
+ data.tar.gz: 56046a9a44230f405ca79893e8ca66d06ae7ed77d82bf323e574624d33af2c6cf6f1bef3388c8ccc989781d24b11fcfc8c094bb34ffe881c27440ab2c999a88a
data/README.md CHANGED
@@ -1,12 +1,16 @@
1
1
  Vagrant-GPII-CI
2
2
  =============
3
3
 
4
- Vagrant-GPII-CI is a vagrant plugin that is used to simplify the configuration stored in a Vagrantfile. It uses virtual machine definitions to spin up complete
5
- enviroments where you can run tests or run your code.
4
+ Scope
5
+ -----
6
+
7
+ Vagrant-GPII-CI is a vagrant plugin that is used to simplify the definition of a Vagrantfile. It uses virtual machine and scripts definitions to spin up complete enviroments where you can run your tests or applications.
6
8
 
7
9
  Installation
8
10
  ------------
9
11
 
12
+ The installation is as simple as run this command in your user's shell:
13
+
10
14
  ```
11
15
  vagrant plugin install vagrant-gpii-ci
12
16
  ```
@@ -14,25 +18,54 @@ vagrant plugin install vagrant-gpii-ci
14
18
  Working with vms
15
19
  ----------------
16
20
 
17
- No Vagrantfile is required if a file [.gpii-ci.yml](gpii-ci.yml.template) is found in the root of the repository.
21
+ No Vagrantfile is required if a file [.vagrant.yml](vagrant.yml.template) is found in the root of the repository.
18
22
 
19
23
  The name of the file can be override using the environment variable `VAGRANT_CI_FILE`.
20
24
 
21
25
  Commands:
22
26
 
23
- * `vagrant up [vm]` to spin up the defined in the .ci_env variable of the [.gpii-ci.yml](gpii-ci.yml.template) file.
27
+ * `vagrant up [vm]` to spin up the vms defined in the .ci_env variable.
24
28
  * `vagrant destroy [vm]` to stop and destroy the vm.
25
29
  * `vagrant reload [vm]` to stop and destroy the vm.
26
30
  * `vagrant halt [vm]` to shutdown the vm without destroy it.
27
- * `vagrant ci test [vm]` to run all the stages defined in the selected vm
28
-
31
+ * `vagrant ci test [vm]` to run all the stages defined in the .ci_stages variable, at the selected vm.
29
32
 
30
33
  Note:
31
34
 
32
35
  * The `vm` parameter is not necessary in environments with only one VM defined.
33
36
 
34
- Sample:
35
37
 
38
+ Virtual Machines definition
39
+ ---------------------------
40
+
41
+ The `.ci_env` variable must have a child variable called `vms` that lists the names of the virtual machines defined. Each name of a VM must have some additional options.
42
+
43
+ The options available for a vm definition are:
44
+
45
+ * `3d` - Enable 3D support. _False_ by default.
46
+ * `autostart - Starts the vm when the command `up` is executed. _True_ by default.
47
+ * `box` - Defines the base box that the vm will use. `Required`
48
+ * `clone` - Use the [Vagrant clone feature](https://www.vagrantup.com/docs/virtualbox/configuration.html#linked-clones) to make the creation of the vm faster. _False_ by default.
49
+ * `cpu` - Defines the number of the virtual CPUs. `Required`
50
+ * `memory` - Defines the amount of RAM memory assigned to the VM. `Required`
51
+ * `sound` - Enables a dummy sound card in the VM. Disabled by default
52
+ * `gui` - Enable the GUI of the VM. _True_ by default.
53
+
54
+ Samples
55
+ =======
56
+
57
+ ```
58
+ .ci_env:
59
+ vms:
60
+ windows10:
61
+ cpu: 2
62
+ memory: 2048
63
+ clone: true
64
+ autostart: true
65
+ box: inclusivedesign/windows10-eval
66
+ ```
67
+
68
+ In the following example we use the [merge](http://yaml.org/type/merge.html) feature of YAML to simplify the virtual machines definitions.
36
69
 
37
70
  ```
38
71
  .ci_env:
@@ -58,15 +91,14 @@ Sample:
58
91
  Networking
59
92
  ----------
60
93
 
61
- All the VMs have access to Internet using the gateway of the host through a NAT interface.
94
+ All the VMs have access to Internet using the gateway of the host through a NAT interface by default.
62
95
 
63
- In the case of multi VM environments, a additional NIC card is create in each VM with a private IP of a private network that all the VMs share. The IP range of this network is 192.168.50.0/24. The IP address are assigned to each VM starting by 10.
96
+ In the case of multi VM environments, a additional NIC card is create in each VM with a private IP address of a private network where all the VMs are connected. The IP range of this network is 192.168.50.0/24. The IP addresses assigned to each VM start by 10 and is incremented by 1 in additional VMs.
64
97
 
65
98
  Mapped ports
66
99
  ---------------
67
100
 
68
- The port mapping is configured in the VMs definition. The `mapped_ports`
69
- variable is a list of ports that will be mapped from the VM to the host.
101
+ The port mapping is configured in the VMs definition. The `mapped_ports` variable is a list of ports that will be mapped from the VM to the host.
70
102
 
71
103
  ```
72
104
  mapped_ports:
@@ -74,3 +106,72 @@ mapped_ports:
74
106
  - 8181
75
107
  ```
76
108
 
109
+ Tags
110
+ ----
111
+
112
+ The tags can be used to run specific stages in some VMs. A stage with a set of tags will be only executed in the VMs that have those tags listed. If a stage doesn't have tags defined it will be executed in all VMs.
113
+
114
+ Sample
115
+ =======
116
+
117
+ ```
118
+ .ci_env:
119
+ default: &default
120
+ cpu: 2 # number of cpus
121
+ memory: 2048 # amount of RAM memory
122
+ clone: true # use the linked_clone Vagrant feature
123
+ autostart: false # only start a VM when it's specfied in the command line
124
+ vms:
125
+ windows: # name of the VM
126
+ <<: *default # referece of the common part
127
+ tags:
128
+ - windows
129
+ box: inclusivedesign/windows
130
+ fedora: # name of the VM
131
+ <<: *default # referece of the common part
132
+ tags:
133
+ - linux
134
+ box: inclusivedesign/fedora
135
+
136
+ .ci_stages: # Stages to perform when 'ci test' command is invoked
137
+ - setup_win
138
+ - setup_linux
139
+ - test
140
+
141
+ setup_win_job:
142
+ stage: setup_win # name of the stage
143
+ tags: # This stage will be only executed on Windows VMs
144
+ - windows
145
+ script:
146
+ - |
147
+ choco upgrade firefox googlechrome -y
148
+ choco install -y nodejs python2 msbuild.extensionpack microsoft-build-tools
149
+ refreshenv
150
+ - |
151
+ npm config -g set msvs_version 2015
152
+ npm install -g testem node-gyp
153
+ refreshenv
154
+ - |
155
+ npm install
156
+ refreshenv
157
+ - testem ci -l firefox
158
+ - testem ci -l chrome
159
+
160
+ setup_linux_job:
161
+ stage: setup_linux # name of the stage
162
+ tags: # This stage will be only executed on linux VMs
163
+ - linux
164
+ script:
165
+ - sudo ansible-galaxy install -fr provisioning/requirements.yml
166
+ - |
167
+ sudo mkdir -p /var/tmp/vagrant/node_modules /vagrant/node_modules
168
+ sudo chown vagrant:vagrant -R /var/tmp/vagrant/node_modules /vagrant/node_modules
169
+ sudo mount -o bind /var/tmp/vagrant/node_modules /vagrant/node_modules
170
+
171
+ test_job:
172
+ stage: test
173
+ script:
174
+ - npm run node-test
175
+ - npm run browser-test
176
+
177
+ ```
@@ -14,7 +14,7 @@ module VagrantPlugins
14
14
 
15
15
  # The file .gpii-ci.yml can be override using this environment variable
16
16
  ci_file ||= ENV["VAGRANT_CI_FILE"] if ENV.key?("VAGRANT_CI_FILE")
17
- ci_file ||= ".gpii-ci.yml"
17
+ ci_file ||= ".vagrant.yml"
18
18
 
19
19
  # Only if the ci_file is found the plugin will run
20
20
  if File.exist?(project_home(@env).join(ci_file))
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module GPIICi
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -23,7 +23,7 @@
23
23
  <<: *default # referece of the common part
24
24
  box: inclusivedesign/windows7-eval-x64
25
25
 
26
- stages: # Stages to perform when 'ci test' command is invoked
26
+ .ci_stages: # Stages to perform when 'ci test' command is invoked
27
27
  - setup # name of the first stage to execute
28
28
  - test # name of the second stage to execute
29
29
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-gpii-ci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alfredo Matas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-01 00:00:00.000000000 Z
11
+ date: 2017-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -71,7 +71,6 @@ files:
71
71
  - Rakefile
72
72
  - bin/console
73
73
  - bin/setup
74
- - gpii-ci.yml.template
75
74
  - lib/vagrant-gpii-ci.rb
76
75
  - lib/vagrant-gpii-ci/action.rb
77
76
  - lib/vagrant-gpii-ci/action/build_vagrantfile.rb
@@ -91,6 +90,7 @@ files:
91
90
  - spec/spec_helper.rb
92
91
  - spec/vagrant/gpiici_spec.rb
93
92
  - vagrant-gpiici.gemspec
93
+ - vagrant.yml.template
94
94
  homepage: http://github.com/amatas/vagrant-gpii-ci.git
95
95
  licenses:
96
96
  - MIT