forked from nir0s/python-packer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tester.py
26 lines (24 loc) · 787 Bytes
/
tester.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import packer
packerfile = 'packer/tests/resources/packerfile.json'
# exc = ['z', 't']
exc = []
# only = ['x', 'y']
only = []
# vars = {"variable1": "y", "variable2": "value"}
vars = {}
vars_file = '/x'
p = packer.Installer('packer_executables/', 'packer_0.7.5_linux_amd64.zip')
# If we installed packer using the provided installer, it will return
# packer's executable path. We can use it below:
# packer_exec = p.install()
packer_exec = 'packer'
p = packer.Packer(packerfile, exc=exc, only=only, vars=vars,
exec_path=packer_exec)
# print(p.version())
# validation = p.validate(syntax_only=True)
# print(validation.succeeded)
# print(validation.error)
# result = p.inspect(mrf=True)
# print result.parsed_output
# print(p.fix('TEST.json').fixed)
# print(p.build())