Skip to content

Commit

Permalink
add triton builders
Browse files Browse the repository at this point in the history
  • Loading branch information
mayn committed Aug 17, 2017
1 parent e126c67 commit 4bb9439
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@


### FEATURES:
* builder/Triton: add support for packer's triton builder
* builder/VirtualboxIso: add support for packer's virtualbox iso builder
* builder/VirtualboxOvf: add support for packer's virtualbox ovf builder
* builder/VMwareIso: add support for packer's vmware iso builder
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Builders:
- amazon-ebs
- docker
- file
- triton
- virtualbox-iso
- virtualbox-ovf
- vmware-iso
Expand Down
29 changes: 29 additions & 0 deletions src/packerlicious/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,35 @@ def validate(self):
warnings.warn("Both source and content not specified, artifact will be empty.")


class Triton(PackerBuilder):
"""
Triton Builder
https://www.packer.io/docs/builders/triton.html
"""
resource_type = "triton"

props = {
'triton_account': (basestring, True),
'triton_key_id': (basestring, True),
'source_machine_image': (basestring, True),
'source_machine_package': (basestring, True),
'image_name': (basestring, True),
'image_version': (basestring, True),
'triton_url': (basestring, False),
'triton_key_material': (basestring, False),
'source_machine_firewall_enabled': (validator.boolean, False),
'source_machine_metadata': (dict, False),
'source_machine_name': (basestring, False),
'source_machine_networks': ([basestring], False),
'source_machine_tags': (dict, False),
'image_acls': ([basestring], False),
'image_description': (basestring, False),
'image_eula_url': (basestring, False),
'image_homepage': (basestring, False),
'image_tags': (dict, False),
}


class VirtualboxIso(PackerBuilder):
"""
VirtualBox ISO Builder
Expand Down
14 changes: 14 additions & 0 deletions tests/packerlicious/test_builder_triton.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import pytest

import packerlicious.builder as builder


class TestTritonBuilder(object):

def test_required_fields_missing(self):
b = builder.Triton()

with pytest.raises(ValueError) as excinfo:
b.to_dict()
assert 'required' in str(excinfo.value)

0 comments on commit 4bb9439

Please sign in to comment.