make the file builder run provisioners for testing purposes

This commit is contained in:
Adrien Delorme 2019-04-08 13:40:02 +02:00
parent 2b06d74019
commit 06941a86a3
2 changed files with 8 additions and 2 deletions

View File

@ -68,5 +68,11 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
artifact.filename = b.config.Target
}
if hook != nil {
if err := hook.Run(ctx, packer.HookProvision, ui, new(packer.MockCommunicator), nil); err != nil {
return nil, err
}
}
return artifact, nil
}

View File

@ -2,7 +2,7 @@
description: |
The file Packer builder is not really a builder, it just creates an artifact
from a file. It can be used to debug post-processors without incurring high
wait times. It does not run any provisioners.
wait times.
layout: docs
page_title: 'File - Builders'
sidebar_current: 'docs-builders-file'
@ -14,7 +14,7 @@ Type: `file`
The `file` Packer builder is not really a builder, it just creates an artifact
from a file. It can be used to debug post-processors without incurring high
wait times. It does not run any provisioners.
wait times.
## Basic Example