Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 203324f

Browse files
committed
readme
1 parent fae548f commit 203324f

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,24 @@ You must have Packer installed prior to using this client (DUH!)
2626
import packer
2727

2828
packerfile = 'packer/tests/resources/packerfile.json'
29+
output_file = 'packer/tests/resources/packerfile_fixed.json'
30+
atlas_token = 'oi21mok3mwqtk31om51o2joj213m1oo1i23n1o2'
2931
packer_exec_path = '/usr/bin/packer'
3032
exc = []
31-
only = []
32-
vars = {"variable1": "y", "variable2": "value"}
33+
only = ['my_first_image', 'my_second_image']
34+
vars = {"variable1": "value1", "variable2": "value2"}
3335
vars_file = 'path/to/vars/file'
3436

3537
p = packer.Packer(packerfile, exc=exc, only=only, vars=vars,
3638
vars_file=vars_file, exec_path=packer_exec_path)
3739
print(p.version()) # `packer version`
38-
p.validate(syntax_only=False) # `packer validate`
40+
p.validate(syntax_only=False) # `packer validates`
41+
print(p.fix(output_file)) # `packer fix`
3942
result = p.inspect() # `packer inspect`
4043
print(result.parsed_output)
4144
p.build(parallel=True, debug=False, force=False) # `packer build`
45+
# if you're logged into Atlas, you can also:
46+
p.push(create=True, token=atlas_token)
4247
```
4348

4449
The `inspect` method will return a dictionary containing the components:

tester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
p = packer.Packer(packerfile, exc=exc, only=only, vars=vars)
1313
print(p.version())
14-
print(p.validate(syntax_only=True))
14+
print(p.validate(syntax_only=False))
1515
result = p.inspect()
1616
print result.parsed_output
1717
print(p.fix('TEST.json'))

0 commit comments

Comments
 (0)