kitchen-oci 1.12.3 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/kitchen/driver/oci.rb +129 -0
- data/lib/kitchen/driver/oci_version.rb +1 -1
- metadata +5 -15
- data/.cane +0 -0
- data/.gitignore +0 -19
- data/.rubocop.yml +0 -5
- data/.travis.yml +0 -11
- data/CHANGELOG.md +0 -40
- data/Gemfile +0 -19
- data/NOTICE +0 -96
- data/README.md +0 -367
- data/Rakefile +0 -37
- data/kitchen-oci.gemspec +0 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0cea9f46ffa83a8b4e5f7eed890889aa6265631e5cfbea839169f31e0dccaa7
|
4
|
+
data.tar.gz: 213c557476fce406d144335deba42318dd0a4fbb8820b4754b37acf1f4460bf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23272af5f39d286faf4affcd9b1966d5b67a531fe300614a9fe982d443af8fcac016aa511b6f953f790c425a75b6582eb1dbc010c3ce9fa3195cacdfba2506f6
|
7
|
+
data.tar.gz: a8b5c341ee9762d0d246e192a443dbe98f13e28b24c58b7674d80484b792d348e8dfdb0644252246a823832987201b6a7aa966809b5a8d5b2d5744db6189d8e0
|
data/lib/kitchen/driver/oci.rb
CHANGED
@@ -51,6 +51,7 @@ module Kitchen
|
|
51
51
|
default_config :proxy_url, nil
|
52
52
|
default_config :user_data, nil
|
53
53
|
default_config :freeform_tags, {}
|
54
|
+
default_config :defined_tags, {}
|
54
55
|
|
55
56
|
# compute config items
|
56
57
|
default_config :image_id
|
@@ -70,6 +71,9 @@ module Kitchen
|
|
70
71
|
# dbaas config items
|
71
72
|
default_config :dbaas, {}
|
72
73
|
|
74
|
+
# blockstorage config items
|
75
|
+
default_config :volumes, {}
|
76
|
+
|
73
77
|
def create(state)
|
74
78
|
return if state[:server_id]
|
75
79
|
|
@@ -82,6 +86,9 @@ module Kitchen
|
|
82
86
|
|
83
87
|
instance.transport.connection(state).wait_until_ready
|
84
88
|
|
89
|
+
state[:volumes] = process_volumes_list(state)
|
90
|
+
state[:volume_attachments] = process_volume_attachments(state)
|
91
|
+
|
85
92
|
return unless config[:post_create_script]
|
86
93
|
|
87
94
|
info('Running post create script')
|
@@ -94,6 +101,18 @@ module Kitchen
|
|
94
101
|
|
95
102
|
instance.transport.connection(state).close
|
96
103
|
|
104
|
+
if state[:volume_attachments]
|
105
|
+
state[:volume_attachments].each do |attachment|
|
106
|
+
volume_detach(attachment)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
if state[:volumes]
|
111
|
+
state[:volumes].each do |vol|
|
112
|
+
volume_delete(vol[:id])
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
97
116
|
if instance_type == 'compute'
|
98
117
|
comp_api.terminate_instance(state[:server_id])
|
99
118
|
elsif instance_type == 'dbaas'
|
@@ -231,6 +250,10 @@ module Kitchen
|
|
231
250
|
generic_api(OCI::Identity::IdentityClient)
|
232
251
|
end
|
233
252
|
|
253
|
+
def blockstorage_api
|
254
|
+
generic_api(OCI::Core::BlockstorageClient)
|
255
|
+
end
|
256
|
+
|
234
257
|
##################
|
235
258
|
# Common methods #
|
236
259
|
##################
|
@@ -341,6 +364,7 @@ module Kitchen
|
|
341
364
|
l.shape = config[:shape]
|
342
365
|
l.create_vnic_details = create_vnic_details(hostname)
|
343
366
|
l.freeform_tags = process_freeform_tags(config[:freeform_tags])
|
367
|
+
l.defined_tags = config[:defined_tags]
|
344
368
|
l.preemptible_instance_config = preemptible_instance_config if config[:preemptible_instance]
|
345
369
|
l.shape_config = shape_config unless config[:shape_config].empty?
|
346
370
|
end
|
@@ -372,10 +396,13 @@ module Kitchen
|
|
372
396
|
end
|
373
397
|
|
374
398
|
def create_vnic_details(name)
|
399
|
+
nsg_ids = config[:nsg_ids] || []
|
400
|
+
raise 'nsg_ids cannot have more than 5 NSGs.' if nsg_ids.length > 5
|
375
401
|
OCI::Core::Models::CreateVnicDetails.new(
|
376
402
|
assign_public_ip: public_ip_allowed?,
|
377
403
|
display_name: name,
|
378
404
|
hostname_label: name,
|
405
|
+
nsg_ids: nsg_ids,
|
379
406
|
subnetId: config[:subnet_id]
|
380
407
|
)
|
381
408
|
end
|
@@ -461,6 +488,107 @@ module Kitchen
|
|
461
488
|
end
|
462
489
|
end
|
463
490
|
|
491
|
+
########################
|
492
|
+
# BlockStorage methods #
|
493
|
+
########################
|
494
|
+
def process_volumes_list(state)
|
495
|
+
created_vol = []
|
496
|
+
config[:volumes].each do |vol_settings|
|
497
|
+
# convert to hash because otherwise it's an an OCI API Object and won't load
|
498
|
+
volume_attachment_type = vol_settings[:type].downcase || 'paravirtual'
|
499
|
+
unless %w[iscsi paravirtual].include?(volume_attachment_type)
|
500
|
+
info("invalid volume attachment type: #{volume_attachment_type}")
|
501
|
+
next
|
502
|
+
end
|
503
|
+
volume = volume_create(
|
504
|
+
config[:availability_domain],
|
505
|
+
vol_settings[:name],
|
506
|
+
vol_settings[:size_in_gbs],
|
507
|
+
vol_settings[:vpus_per_gb] || 10
|
508
|
+
).to_hash
|
509
|
+
# convert to string otherwise it's a ruby datetime object and won't load
|
510
|
+
volume[:attachment_type] = volume_attachment_type
|
511
|
+
created_vol << volume
|
512
|
+
end
|
513
|
+
created_vol
|
514
|
+
end
|
515
|
+
|
516
|
+
def volume_create(availability_domain, display_name, size_in_gbs, vpus_per_gb)
|
517
|
+
info("Creating volume <#{display_name}>...")
|
518
|
+
result = blockstorage_api.create_volume(
|
519
|
+
OCI::Core::Models::CreateVolumeDetails.new(
|
520
|
+
compartment_id: compartment_id,
|
521
|
+
availability_domain: availability_domain,
|
522
|
+
display_name: display_name,
|
523
|
+
size_in_gbs: size_in_gbs,
|
524
|
+
vpus_per_gb: vpus_per_gb
|
525
|
+
)
|
526
|
+
)
|
527
|
+
get_volume_response = blockstorage_api.get_volume(result.data.id)
|
528
|
+
.wait_until(:lifecycle_state, OCI::Core::Models::Volume::LIFECYCLE_STATE_AVAILABLE)
|
529
|
+
info("Finished creating volume <#{display_name}>.")
|
530
|
+
state_data = {
|
531
|
+
:id => get_volume_response.data.id
|
532
|
+
}
|
533
|
+
end
|
534
|
+
|
535
|
+
def volume_delete(volume_id)
|
536
|
+
info("Deleting volume: <#{volume_id}>...")
|
537
|
+
blockstorage_api.delete_volume(volume_id)
|
538
|
+
blockstorage_api.get_volume(volume_id)
|
539
|
+
.wait_until(:lifecycle_state, OCI::Core::Models::Volume::LIFECYCLE_STATE_TERMINATED)
|
540
|
+
info("Deleted volume: <#{volume_id}>")
|
541
|
+
end
|
542
|
+
|
543
|
+
def process_volume_attachments(state)
|
544
|
+
attachments = []
|
545
|
+
state[:volumes].each do |volume|
|
546
|
+
info("Attaching Volume: #{volume[:displayName]} - #{volume[:attachment_type]}")
|
547
|
+
details = volume_create_attachment_details(volume, state[:server_id])
|
548
|
+
attachment = volume_attach(details).to_hash
|
549
|
+
attachments << attachment
|
550
|
+
info("Attached Volume #{volume[:displayName]} - #{volume[:attachment_type]}")
|
551
|
+
end
|
552
|
+
attachments
|
553
|
+
end
|
554
|
+
|
555
|
+
def volume_create_attachment_details(volume, instance_id)
|
556
|
+
if volume[:attachment_type].eql?('iscsi')
|
557
|
+
OCI::Core::Models::AttachIScsiVolumeDetails.new(
|
558
|
+
display_name: 'iSCSIAttachment',
|
559
|
+
volume_id: volume[:id],
|
560
|
+
instance_id: instance_id
|
561
|
+
)
|
562
|
+
elsif volume[:attachment_type].eq?('paravirtual')
|
563
|
+
OCI::Core::Models::AttachParavirtualizedVolumeDetails.new(
|
564
|
+
display_name: 'paravirtAttachment',
|
565
|
+
volume_id: volume[:id],
|
566
|
+
instance_id: instance_id
|
567
|
+
)
|
568
|
+
end
|
569
|
+
end
|
570
|
+
|
571
|
+
def volume_attach(volume_attachment_details)
|
572
|
+
result = comp_api.attach_volume(volume_attachment_details)
|
573
|
+
get_volume_attachment_response =
|
574
|
+
comp_api.get_volume_attachment(result.data.id)
|
575
|
+
.wait_until(:lifecycle_state, OCI::Core::Models::VolumeAttachment::LIFECYCLE_STATE_ATTACHED)
|
576
|
+
state_data = {
|
577
|
+
:id => get_volume_attachment_response.data.id,
|
578
|
+
:iqn_ipv4 => get_volume_attachment_response.data.ipv4,
|
579
|
+
:iqn => get_volume_attachment_response.data.iqn,
|
580
|
+
:port => get_volume_attachment_response.data.port,
|
581
|
+
}
|
582
|
+
end
|
583
|
+
|
584
|
+
def volume_detach(volume_attachment)
|
585
|
+
info("Detaching volume: #{volume_attachment[:id]}")
|
586
|
+
comp_api.detach_volume(volume_attachment[:id])
|
587
|
+
comp_api.get_volume_attachment(volume_attachment[:id])
|
588
|
+
.wait_until(:lifecycle_state, OCI::Core::Models::VolumeAttachment::LIFECYCLE_STATE_DETACHED)
|
589
|
+
info("Detached volume: #{volume_attachment[:id]}")
|
590
|
+
end
|
591
|
+
|
464
592
|
#################
|
465
593
|
# DBaaS methods #
|
466
594
|
#################
|
@@ -500,6 +628,7 @@ module Kitchen
|
|
500
628
|
l.license_model = license_model
|
501
629
|
l.subnet_id = config[:subnet_id]
|
502
630
|
l.freeform_tags = process_freeform_tags(config[:freeform_tags])
|
631
|
+
l.defined_tags = config[:defined_tags]
|
503
632
|
end
|
504
633
|
end
|
505
634
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-oci
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Pearson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oci
|
@@ -115,17 +115,7 @@ executables: []
|
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
|
-
- ".cane"
|
119
|
-
- ".gitignore"
|
120
|
-
- ".rubocop.yml"
|
121
|
-
- ".travis.yml"
|
122
|
-
- CHANGELOG.md
|
123
|
-
- Gemfile
|
124
118
|
- LICENSE
|
125
|
-
- NOTICE
|
126
|
-
- README.md
|
127
|
-
- Rakefile
|
128
|
-
- kitchen-oci.gemspec
|
129
119
|
- lib/kitchen/driver/oci.rb
|
130
120
|
- lib/kitchen/driver/oci_version.rb
|
131
121
|
- tpl/setup_winrm.ps1.erb
|
@@ -133,7 +123,7 @@ homepage: ''
|
|
133
123
|
licenses:
|
134
124
|
- Apache-2.0
|
135
125
|
metadata: {}
|
136
|
-
post_install_message:
|
126
|
+
post_install_message:
|
137
127
|
rdoc_options: []
|
138
128
|
require_paths:
|
139
129
|
- lib
|
@@ -149,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
139
|
version: '0'
|
150
140
|
requirements: []
|
151
141
|
rubygems_version: 3.3.7
|
152
|
-
signing_key:
|
142
|
+
signing_key:
|
153
143
|
specification_version: 4
|
154
144
|
summary: A Test Kitchen Driver for Oracle OCI
|
155
145
|
test_files: []
|
data/.cane
DELETED
File without changes
|
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
data/.travis.yml
DELETED
data/CHANGELOG.md
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
|
2
|
-
## 1.12.1
|
3
|
-
- Refactor `oci_config` method to account for `warning: Using the last argument as keyword parameters is deprecated` deprecation warning
|
4
|
-
- Set dependency on oci gem to 2.15.0
|
5
|
-
|
6
|
-
## 1.12.0
|
7
|
-
- Added support for Flex and Preemptible instances
|
8
|
-
- Set dependency on oci gem to 2.14.0
|
9
|
-
- Further reduction of characters known to cause winrm password issues
|
10
|
-
|
11
|
-
## 1.11.2
|
12
|
-
- Set dependency on oci gem to 2.10.0
|
13
|
-
|
14
|
-
## 1.11.1
|
15
|
-
- Removed characters from password string known to break winrm
|
16
|
-
|
17
|
-
## 1.11.0
|
18
|
-
- Added support for user_data raw string
|
19
|
-
|
20
|
-
## 1.10.1 Issue 22
|
21
|
-
- Added safeguard for cluster_name length restriction in DBaaS.
|
22
|
-
|
23
|
-
## 1.10.0 DBaaS support
|
24
|
-
- Added support for DBaaS.
|
25
|
-
- instance_type is new optional parameter (compute or dbaas)
|
26
|
-
|
27
|
-
## 1.9.0 Use instance principals
|
28
|
-
- Added support for `use_instance_principals`
|
29
|
-
|
30
|
-
## 1.8.0 Freeform tags
|
31
|
-
- Added optional parameter `freeform_tags`
|
32
|
-
|
33
|
-
## 1.6.0 WinRM password option
|
34
|
-
- Added option to set winrm password, instead of randomly generating one
|
35
|
-
|
36
|
-
## 1.5.0 Windows support
|
37
|
-
|
38
|
-
- Added cloud-init support.
|
39
|
-
- Added support for Windows targets.
|
40
|
-
- Can inject powershell script to set a random password and enable WinRM
|
data/Gemfile
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright 2020 Stephen Pearson <stephen.pearson@oracle.com>
|
4
|
-
#
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
# you may not use this file except in compliance with the License.
|
7
|
-
# You may obtain a copy of the License at
|
8
|
-
#
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
#
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
# See the License for the specific language governing permissions and
|
15
|
-
# limitations under the License.
|
16
|
-
|
17
|
-
source 'https://rubygems.org'
|
18
|
-
|
19
|
-
gemspec
|
data/NOTICE
DELETED
@@ -1,96 +0,0 @@
|
|
1
|
-
LICENSING INFORMATION
|
2
|
-
---------------------
|
3
|
-
|
4
|
-
This code has dependencies upon oci-ruby-sdk and Chef Kitchen
|
5
|
-
|
6
|
-
oci-ruby-sdk: https://github.com/oracle/oci-ruby-sdk (Universal Permissive License, or Apache License 2.0)
|
7
|
-
chef-dk : https://github.com/chef/chef-dk (Apache License 2.0)
|
8
|
-
|
9
|
-
LICENSES
|
10
|
-
--------
|
11
|
-
|
12
|
-
Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
13
|
-
|
14
|
-
This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 or Apache License 2.0. See below for license terms. You may choose either license.
|
15
|
-
____________________________
|
16
|
-
The Universal Permissive License (UPL), Version 1.0
|
17
|
-
Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
18
|
-
|
19
|
-
Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this software, associated documentation and/or data (collectively the "Software"), free of charge and under any and all copyright rights in the Software, and any and all patent rights owned or freely licensable by each licensor hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor, or (ii) the Larger Works (as defined below), to deal in both
|
20
|
-
|
21
|
-
(a) the Software, and
|
22
|
-
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software (each a "Larger Work" to which the Software is contributed by such licensors),
|
23
|
-
|
24
|
-
without restriction, including without limitation the rights to copy, create derivative works of, display, perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and have sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other terms.
|
25
|
-
|
26
|
-
This license is subject to the following condition:
|
27
|
-
|
28
|
-
The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL must be included in all copies or substantial portions of the Software.
|
29
|
-
|
30
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
31
|
-
|
32
|
-
The Apache Software License, Version 2.0
|
33
|
-
Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
34
|
-
|
35
|
-
Licensed under the Apache License, Version 2.0 (the "License"); You may not use this product except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. A copy of the license is also reproduced below. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
36
|
-
|
37
|
-
Apache License
|
38
|
-
|
39
|
-
Version 2.0, January 2004
|
40
|
-
|
41
|
-
http://www.apache.org/licenses/
|
42
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
43
|
-
1. Definitions.
|
44
|
-
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
45
|
-
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
46
|
-
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
47
|
-
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
48
|
-
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
49
|
-
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
50
|
-
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
51
|
-
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
52
|
-
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
53
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
54
|
-
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
55
|
-
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
56
|
-
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
57
|
-
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
58
|
-
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
59
|
-
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
60
|
-
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
61
|
-
|
62
|
-
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
63
|
-
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
64
|
-
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
65
|
-
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
66
|
-
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
67
|
-
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
68
|
-
END OF TERMS AND CONDITIONS
|
69
|
-
|
70
|
-
APPENDIX: How to apply the Apache License to your work.
|
71
|
-
|
72
|
-
To apply the Apache License to your work, attach the following
|
73
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
74
|
-
replaced with your own identifying information. (Don't include
|
75
|
-
the brackets!) The text should be enclosed in the appropriate
|
76
|
-
comment syntax for the file format. We also recommend that a
|
77
|
-
file or class name and description of purpose be included on the
|
78
|
-
same "printed page" as the copyright notice for easier
|
79
|
-
identification within third-party archives.
|
80
|
-
|
81
|
-
Copyright [yyyy] [name of copyright owner]
|
82
|
-
|
83
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
84
|
-
you may not use this file except in compliance with the License.
|
85
|
-
You may obtain a copy of the License at
|
86
|
-
|
87
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
88
|
-
|
89
|
-
Unless required by applicable law or agreed to in writing, software
|
90
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
91
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
92
|
-
See the License for the specific language governing permissions and
|
93
|
-
limitations under the License.
|
94
|
-
|
95
|
-
|
96
|
-
|
data/README.md
DELETED
@@ -1,367 +0,0 @@
|
|
1
|
-
# Kitchen::OCI
|
2
|
-
|
3
|
-
A Test Kitchen Driver for Oracle Cloud Infrastructure (OCI)
|
4
|
-
|
5
|
-
## Prerequisites
|
6
|
-
|
7
|
-
You need an ssh keypair defined for your current user. By default the driver
|
8
|
-
expects to find the public key in ~/.ssh/id\_rsa.pub, but this can be
|
9
|
-
overridden in .kitchen.yml.
|
10
|
-
|
11
|
-
You need to create suitable configuration for OCI in ~/.oci/config and this
|
12
|
-
can be created using the CLI:
|
13
|
-
```bash
|
14
|
-
oci setup config
|
15
|
-
```
|
16
|
-
|
17
|
-
Ensure that you have a suitable compartment defined, an external subnet, and
|
18
|
-
security rules that allow incoming SSH and outgoing HTTP to allow Kitchen to
|
19
|
-
pull the Chef binaries.
|
20
|
-
|
21
|
-
## Building the gem
|
22
|
-
|
23
|
-
This step is only necessary if you wish to make local modifications. The gem
|
24
|
-
has already been published to rubygems.org.
|
25
|
-
|
26
|
-
```bash
|
27
|
-
rake build
|
28
|
-
```
|
29
|
-
|
30
|
-
## Installing the gem
|
31
|
-
|
32
|
-
You must install the gem into whatever Ruby is used to run kitchen. On a
|
33
|
-
workstation this will likely be the ChefDK environment. To switch to
|
34
|
-
ChefDK if you haven't already:
|
35
|
-
|
36
|
-
```bash
|
37
|
-
eval "$(chef shell-init bash)"
|
38
|
-
```
|
39
|
-
|
40
|
-
You can install the gem from RubyGems.org with:
|
41
|
-
|
42
|
-
```bash
|
43
|
-
gem install kitchen-oci
|
44
|
-
```
|
45
|
-
|
46
|
-
To install a gem you built yourself:
|
47
|
-
|
48
|
-
```bash
|
49
|
-
gem install pkg/kitchen-oci-<VERSION>.gem
|
50
|
-
```
|
51
|
-
|
52
|
-
## Example .kitchen.yml
|
53
|
-
|
54
|
-
Adjust below template as required. The following configuration is mandatory for all instance types:
|
55
|
-
|
56
|
-
- `compartment_id` or `compartment_name`
|
57
|
-
- `availability_domain`
|
58
|
-
- `shape`
|
59
|
-
- `subnet_id`
|
60
|
-
|
61
|
-
There is an additional configuration item that allows for toggling instance types. If this item is not included, it defaults to `compute`.
|
62
|
-
|
63
|
-
- Permitted values of `instance_type`:
|
64
|
-
- compute
|
65
|
-
- dbaas
|
66
|
-
|
67
|
-
Note: The availability domain should be the full AD name including the tenancy specific prefix. For example: "AaBb:US-ASHBURN-AD-1". Look in the OCI console to get your tenancy specific string.
|
68
|
-
|
69
|
-
### Compute Instance Type
|
70
|
-
|
71
|
-
The following configuration is mandatory:
|
72
|
-
|
73
|
-
- `image_id`
|
74
|
-
|
75
|
-
These settings are optional:
|
76
|
-
|
77
|
-
- `boot_volume_size_in_gbs`, The size of the boot volume, in GB
|
78
|
-
- `use_private_ip`, Whether to connect to the instance using a private IP, default is false (public ip)
|
79
|
-
- `oci_config_file`, OCI configuration file, by default this is ~/.oci/config
|
80
|
-
- `oci_profile_name`, OCI profile to use, default value is "DEFAULT"
|
81
|
-
- `oci_config`, Hash of additional `OCI::Config` settings. Allows you to test without an oci config file (see below)
|
82
|
-
- `ssh_keypath`, SSH public key, default is ~/.ssh/id\_rsa.pub
|
83
|
-
- `post_create_script`, run a script on compute\_instance after deployment
|
84
|
-
- `proxy_url`, Connect via the specified proxy URL
|
85
|
-
- `user_data`, Add user data scripts
|
86
|
-
- `hostname_prefix`, Prefix for the generated hostnames (note that OCI doesn't like underscores)
|
87
|
-
- `freeform_tags`, Hash containing tag name(s) and values(s)
|
88
|
-
- `use_instance_principals`, Boolean flag indicated whether Instance Principals should be used as credentials (see below)
|
89
|
-
- `use_token_auth`, Boolean flag indicating if token authentication should be used (see below)
|
90
|
-
- `preemptible_instance`, Boolean flag to indicate if the compute instance should be preemptible, default is `false`.
|
91
|
-
- `shape_config`, Hash of shape config parameters required when using Flex shapes.
|
92
|
-
- `ocpus`, number of CPUs requested
|
93
|
-
- `memory_in_gbs`, the amount of memory requested
|
94
|
-
- `baseline_ocpu_utilization`, the minimum CPU utilization, default `BASELINE_1_1`
|
95
|
-
|
96
|
-
Optional settings for WinRM support in Windows:
|
97
|
-
|
98
|
-
- `setup_winrm`, Inject Windows powershell to set password and enable WinRM, default false.
|
99
|
-
- `winrm_username`, Used to set the WinRM transport username, defaults to 'opc'.
|
100
|
-
- `winrm_password`, Set the winrm password. By default a randomly generated password will be used, so don't set this unless you have to. Beware that the password must meet the Windows password complexity requirements otherwise the bootstrapping procedure will fail silently and Kitchen will eventually time out.
|
101
|
-
|
102
|
-
The `use_private_ip` influences whether the public or private IP will be used by Kitchen to connect to the instance. If it is set to false (the default) then it will connect to the public IP, otherwise it'll use the private IP.
|
103
|
-
|
104
|
-
If the `subnet_id` refers to a subnet configured to disallow public IPs on any attached VNICs, then the VNIC will be created without a public IP and the `use_private_ip` flag will assumed to be true irrespective of the config setting. On subnets that do allow a public IP a public IP will be allocated to the VNIC, but the `use_private_ip` flag can still be used to override whether the private or public IP will be used.
|
105
|
-
|
106
|
-
```yml
|
107
|
-
---
|
108
|
-
driver:
|
109
|
-
name: oci
|
110
|
-
# These are mandatory
|
111
|
-
compartment_name: "dev-00"
|
112
|
-
availability_domain: "XyAb:US-ASHBURN-AD-1"
|
113
|
-
image_id: "ocid1.image.oc1.phx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
114
|
-
shape: "VM.Standard1.2"
|
115
|
-
subnet_id: "ocid1.subnet.oc1.phx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
116
|
-
|
117
|
-
# These are optional
|
118
|
-
use_private_ip: false
|
119
|
-
oci_config_file: "~/.oci/config"
|
120
|
-
oci_profile_name: "DEFAULT"
|
121
|
-
ssh_keypath: "~/.ssh/id_rsa.pub"
|
122
|
-
post_create_script: >-
|
123
|
-
```
|
124
|
-
|
125
|
-
### DBaaS Instance Type
|
126
|
-
|
127
|
-
The DBaaS instance type configuration should be written in a hash beginning with `dbaas`.
|
128
|
-
|
129
|
-
The following configuration item is mandatory for the DBaaS `instance_type`:
|
130
|
-
|
131
|
-
- `db_version`, The specific version of the Oracle database software to be installed. Values can be at either the major version level (eg. 12.1.0.2) or at a PSU level (eg. 12.1.0.2.191015). If no PSU is provided, the latest available will be installed.
|
132
|
-
|
133
|
-
The following is a list of optional items for the DBaaS `instance_type`:
|
134
|
-
|
135
|
-
- `cpu_core_count`, CPU core count for DBaaS nodes. Default value is 2
|
136
|
-
- `database_edition`, The edition of the Oracle database software to be installed. Default value is ENTERPRISE_EDITION
|
137
|
-
- `license_model`, The licensing model for the Oracle database software. Default value is BRING_YOUR_OWN_LICENSE
|
138
|
-
- `db_name`, The name of the database to be provisioned. Must be 8 characters or less, alphanumeric. Default value is `dbaas1`.
|
139
|
-
- `pdb_name`, The name of the pdb to be provisioned. Only valid if `db_version` is 12cR1 or higher. Default value is nil (OCI will create a single pdb with the name `db_name`\_PDB1)
|
140
|
-
- `admin_password`, The SYS password of the database to be provisioned. Password must be 9 to 30 characters and contain at least 2 uppercase, 2 lowercase, 2 special, and 2 numeric characters. The special characters must be `_`, `#`, or `-`. Default value will be a randomly generated password
|
141
|
-
- `initial_data_storage_size_in_gb`, The desired amount of database storage in GB. Default value is 256
|
142
|
-
- `character_set`, The characterset of the database. Default value is AL32UTF8
|
143
|
-
- `ncharacter_set`, The national characterset of the database. Default value is AL16UTF16
|
144
|
-
- `db_workload`, The desired workload configuration for the database. Acceptable values are 'OLTP' and 'DSS'. Default value is 'OLTP'
|
145
|
-
|
146
|
-
Note: At this time, `node_count` is forced to be 1. RAC provisioning is not supported.
|
147
|
-
|
148
|
-
```yml
|
149
|
-
---
|
150
|
-
driver:
|
151
|
-
name: oci
|
152
|
-
instance_type: dbaas
|
153
|
-
...
|
154
|
-
dbaas:
|
155
|
-
db_version: "12.1.0.2.191015"
|
156
|
-
```
|
157
|
-
|
158
|
-
## Instance Principals
|
159
|
-
|
160
|
-
If you are launching Kitchen from a compute instance running in OCI then you might prefer to use Instance Principals to authenticate to the OCI APIs. To set this up you can omit the `oci_config_file` and `oci_profile_name` settings and insert `use_instance_principals: true` into your .kitchen.yml instead.
|
161
|
-
|
162
|
-
```yml
|
163
|
-
platforms:
|
164
|
-
- name: ubuntu-18.04
|
165
|
-
driver:
|
166
|
-
...
|
167
|
-
use_instance_principals: true
|
168
|
-
...
|
169
|
-
```
|
170
|
-
|
171
|
-
__Important__: If you want to configure a proxy when using Instance Principals, ensure you define the `no_proxy` environment variable so that all link-local access bypasses the proxy. For example:
|
172
|
-
|
173
|
-
```sh
|
174
|
-
export no_proxy=169.254.0.0/16
|
175
|
-
```
|
176
|
-
|
177
|
-
This will allow the OCI lib to retrieve the certificate, key and ca-chain from the metadata service.
|
178
|
-
|
179
|
-
## Token Auth
|
180
|
-
|
181
|
-
If you are launching Kitchen from system configured for token authentication (by running `oci session authenticate`), you need to set `use_token_auth: true`. This is in addition to the `oci_config_file` and `oci_profile_name` settings.
|
182
|
-
|
183
|
-
```yml
|
184
|
-
platforms:
|
185
|
-
- name: ubuntu-18.04
|
186
|
-
driver:
|
187
|
-
...
|
188
|
-
oci_config_file: "~/.oci/config"
|
189
|
-
oci_profile_name: "DEFAULT"
|
190
|
-
use_token_auth: true
|
191
|
-
...
|
192
|
-
```
|
193
|
-
|
194
|
-
## Use without OCI config file
|
195
|
-
|
196
|
-
If you want to run without running `oci setup config` (such as on a build server) you can specify configuration settings that would be in the `~/.oci/config` file directly in the `kitchen.yml`
|
197
|
-
|
198
|
-
For example, to use the [OCI CLI Environment Variables](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/clienvironmentvariables.htm) without a config you could have use kitchen's ERB to read environment variables.
|
199
|
-
|
200
|
-
```yml
|
201
|
-
platforms:
|
202
|
-
- name: ubuntu-18.04
|
203
|
-
driver:
|
204
|
-
...
|
205
|
-
oci_config:
|
206
|
-
region: <%= ENV['OCI_CLI_REGION'] %>
|
207
|
-
user: <%= ENV['OCI_CLI_USER'] %>
|
208
|
-
fingerprint: <%= ENV['OCI_CLI_FINGERPRINT'] %>
|
209
|
-
authentication_type: <%= ENV['OCI_CLI_AUTH'] %>
|
210
|
-
key_file: <%= ENV['OCI_CLI_KEY_FILE'] %>
|
211
|
-
tenancy: <%= ENV['OCI_CLI_TENANCY'] %>
|
212
|
-
...
|
213
|
-
```
|
214
|
-
|
215
|
-
|
216
|
-
## Support for user data scripts and cloud-init
|
217
|
-
|
218
|
-
The driver has support for adding user data that can be executed as scripts by cloud-init. These can either be specified inline or by referencing a file. Examples:
|
219
|
-
|
220
|
-
```yml
|
221
|
-
user_data:
|
222
|
-
- type: x-shellscript
|
223
|
-
inline: |
|
224
|
-
#!/bin/bash
|
225
|
-
touch /tmp/foo.txt
|
226
|
-
filename: init.sh
|
227
|
-
- type: x-shellscript
|
228
|
-
path: myscript.sh
|
229
|
-
filename: myscript.sh
|
230
|
-
```
|
231
|
-
|
232
|
-
The `filename` parameter must be specified for each entry, and determines the destination filename for the script. If the user data is to be read from a file then the `path` parameter should be specified to indicate where the file is to be read from.
|
233
|
-
|
234
|
-
The scripts will be encoded into a gzipped, base64 encoded multipart mime message and added as user data when launching the instance.
|
235
|
-
|
236
|
-
Alternately, if you simply pass a string to the user_data, it will be base64 encoded and add as user data when launching the instance.
|
237
|
-
|
238
|
-
```yml
|
239
|
-
user_data: |
|
240
|
-
login: user1
|
241
|
-
uid: 1000
|
242
|
-
gid: 1000
|
243
|
-
```
|
244
|
-
|
245
|
-
## Proxy support
|
246
|
-
|
247
|
-
If running Kitchen on a private subnet with no public IPs permitted, it may be necessary to connect to the OCI API via a web proxy. The proxy URL can either be specified on the command line:
|
248
|
-
```bash
|
249
|
-
# With authentication
|
250
|
-
export http_proxy=http://<proxy_user>:<proxy_password>@<proxy_host>:<proxy_port>"
|
251
|
-
# Without authentication
|
252
|
-
export http_proxy=http://<proxy_host>:<proxy_port>"
|
253
|
-
```
|
254
|
-
.. or if preferred in the cookbook's .kitchen.yml file.
|
255
|
-
```yml
|
256
|
-
driver:
|
257
|
-
...
|
258
|
-
proxy_url: "http://<proxy_user>:<proxy_password>@<proxy_host>:<proxy_port>"
|
259
|
-
```
|
260
|
-
|
261
|
-
The SSH transport can also be tunneled via the web proxy using the CONNECT http method, but note that this is not handled by the kitchen-oci gem. Configuration is provided here for convenience only:
|
262
|
-
|
263
|
-
```yml
|
264
|
-
transport:
|
265
|
-
username: "<os_username>"
|
266
|
-
ssh_http_proxy: "<proxy_host>"
|
267
|
-
ssh_http_proxy_port: <proxy_port>
|
268
|
-
ssh_http_proxy_user: <proxy_user>
|
269
|
-
ssh_http_proxy_password: <proxy_password>
|
270
|
-
```
|
271
|
-
|
272
|
-
See also the section above on Instance Principals if you plan to use a proxy in conjunction with a proxy. The proxy needs to be avoided when accessing the metadata address.
|
273
|
-
|
274
|
-
## Preemptible Instances
|
275
|
-
|
276
|
-
This will allow you to create a [preemptible instance](https://docs.oracle.com/en-us/iaas/Content/Compute/Concepts/preemptible.htm). Preemptible instances behave the same as regular compute instances, but the capacity is reclaimed when it's needed elsewhere, and the instances are terminated. If your workloads are fault-tolerant and can withstand interruptions, then preemptible instances can reduce your costs.
|
277
|
-
|
278
|
-
```yml
|
279
|
-
---
|
280
|
-
driver:
|
281
|
-
name: oci
|
282
|
-
...
|
283
|
-
preemptible_instance: true
|
284
|
-
...
|
285
|
-
```
|
286
|
-
|
287
|
-
## Flex Shape Instances
|
288
|
-
|
289
|
-
This will allow you to launch a flexible shape instance. A flexible shape lets you customize the number of CPUs and memory available when launching or resizing the VM. Note that there are smaller number of shapes available and the image ocid must also be compatible. Please consult [OCI documentation](https://docs.oracle.com/en-us/iaas/Content/Compute/References/computeshapes.htm#flexible) to ensure the proper combination of shape and image ocid.
|
290
|
-
|
291
|
-
```yml
|
292
|
-
---
|
293
|
-
driver:
|
294
|
-
name: oci
|
295
|
-
...
|
296
|
-
shape_config:
|
297
|
-
ocpus: 2
|
298
|
-
memory_in_gbs: 8
|
299
|
-
baseline_ocpu_utilization: BASELINE_1_1
|
300
|
-
...
|
301
|
-
```
|
302
|
-
|
303
|
-
## Windows Support
|
304
|
-
|
305
|
-
When launching Oracle provided Windows images, it may be helpful to allow kitchen-oci to inject powershell to configure WinRM and to set a randomized password that does not need to be changed on first login. If the `setup_winrm` parameter is set to true then the following steps will happen:
|
306
|
-
|
307
|
-
- A random password will be generated and stored into the Kitchen state
|
308
|
-
- A powershell script will be generated which sets the password for whatever username is defined in the transport section.
|
309
|
-
- The script, along with any other user data, will be added to the user data and passed to the new instance.
|
310
|
-
- The random password will be injected into the WinRM transport.
|
311
|
-
|
312
|
-
Make sure that the transport name is set to `winrm` and that the os\_type in the driver is set to `windows`. See the following example.
|
313
|
-
|
314
|
-
Full example (.kitchen.yml):
|
315
|
-
|
316
|
-
```yml
|
317
|
-
---
|
318
|
-
driver:
|
319
|
-
name: oci
|
320
|
-
|
321
|
-
provisioner:
|
322
|
-
name: chef_zero
|
323
|
-
always_update_cookbooks: true
|
324
|
-
|
325
|
-
verifier:
|
326
|
-
name: inspec
|
327
|
-
|
328
|
-
platforms:
|
329
|
-
- name: windows
|
330
|
-
os_type: windows
|
331
|
-
driver:
|
332
|
-
# These are mandatory
|
333
|
-
compartment_id: ocid1.compartment.oc1..aaaaaaaa...
|
334
|
-
availability_domain: UhTe:PHX-AD-1
|
335
|
-
image_id: ocid1.image.oc1.phx.aaaaaaaa...
|
336
|
-
shape: VM.Standard2.2
|
337
|
-
subnet_id: ocid1.subnet.oc1.phx.aaaaaaaa...
|
338
|
-
|
339
|
-
# These are optional
|
340
|
-
use_private_ip: false
|
341
|
-
oci_config_file: ~/.oci/config
|
342
|
-
oci_profile_name: DEFAULT
|
343
|
-
ssh_keypath: "/home/<user>/.ssh/id_rsa.pub"
|
344
|
-
|
345
|
-
# This optional, but for Windows only
|
346
|
-
setup_winrm: true
|
347
|
-
winrm_username: opc
|
348
|
-
transport:
|
349
|
-
name: winrm
|
350
|
-
|
351
|
-
suites:
|
352
|
-
- name: default
|
353
|
-
run_list:
|
354
|
-
- recipe[my_cookbook::default]
|
355
|
-
verifier:
|
356
|
-
inspec_tests:
|
357
|
-
- test/smoke/default
|
358
|
-
attributes:
|
359
|
-
```
|
360
|
-
|
361
|
-
## Maintainer
|
362
|
-
|
363
|
-
Created and maintained by Stephen Pearson (<stephen.pearson@oracle.com>)
|
364
|
-
|
365
|
-
## License
|
366
|
-
|
367
|
-
Apache 2.0
|
data/Rakefile
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright 2020 Stephen Pearson <stephen.pearson@oracle.com>
|
4
|
-
#
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
# you may not use this file except in compliance with the License.
|
7
|
-
# You may obtain a copy of the License at
|
8
|
-
#
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
#
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
# See the License for the specific language governing permissions and
|
15
|
-
# limitations under the License.
|
16
|
-
|
17
|
-
require 'bundler/gem_tasks'
|
18
|
-
require 'cane/rake_task'
|
19
|
-
require 'tailor/rake_task'
|
20
|
-
|
21
|
-
desc 'Run cane to check quality metrics'
|
22
|
-
Cane::RakeTask.new do |cane|
|
23
|
-
cane.canefile = './.cane'
|
24
|
-
end
|
25
|
-
|
26
|
-
Tailor::RakeTask.new
|
27
|
-
|
28
|
-
desc 'Display LOC stats'
|
29
|
-
task :stats do
|
30
|
-
puts '\n## Production Code Stats'
|
31
|
-
sh 'countloc -r lib'
|
32
|
-
end
|
33
|
-
|
34
|
-
desc 'Run all quality tasks'
|
35
|
-
task quality: %i[cane tailor stats]
|
36
|
-
|
37
|
-
task default: %i[quality]
|
data/kitchen-oci.gemspec
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright 2020 Stephen Pearson <stephen.pearson@oracle.com>
|
4
|
-
#
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
# you may not use this file except in compliance with the License.
|
7
|
-
# You may obtain a copy of the License at
|
8
|
-
#
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
#
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
# See the License for the specific language governing permissions and
|
15
|
-
# limitations under the License.
|
16
|
-
|
17
|
-
lib = File.expand_path('lib', __dir__)
|
18
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
19
|
-
require 'kitchen/driver/oci_version'
|
20
|
-
|
21
|
-
Gem::Specification.new do |spec|
|
22
|
-
spec.name = 'kitchen-oci'
|
23
|
-
spec.version = Kitchen::Driver::OCI_VERSION
|
24
|
-
spec.authors = ['Stephen Pearson']
|
25
|
-
spec.email = ['stephen.pearson@oracle.com']
|
26
|
-
spec.description = 'A Test Kitchen Driver for Oracle OCI'
|
27
|
-
spec.summary = spec.description
|
28
|
-
spec.homepage = ''
|
29
|
-
spec.license = 'Apache-2.0'
|
30
|
-
|
31
|
-
# rubocop:disable SpecialGlobalVars
|
32
|
-
spec.files = `git ls-files`.split($/)
|
33
|
-
# rubocop:enable SpecialGlobalVars
|
34
|
-
spec.executables = []
|
35
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
36
|
-
spec.require_paths = ['lib']
|
37
|
-
|
38
|
-
spec.add_dependency 'oci', '~> 2.18.0'
|
39
|
-
spec.add_dependency 'test-kitchen'
|
40
|
-
|
41
|
-
spec.add_development_dependency 'bundler'
|
42
|
-
spec.add_development_dependency 'cane'
|
43
|
-
spec.add_development_dependency 'countloc'
|
44
|
-
spec.add_development_dependency 'rake'
|
45
|
-
spec.add_development_dependency 'tailor'
|
46
|
-
end
|