Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
b243eeda
Commit
b243eeda
authored
Jun 18, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packer: Post-process chain works properly
parent
4912b485
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
packer/build.go
packer/build.go
+12
-15
No files found.
packer/build.go
View file @
b243eeda
...
...
@@ -164,10 +164,19 @@ func (b *coreBuild) Run(ui Ui, cache Cache) ([]Artifact, error) {
// Run the post-processors
PostProcessorRunSeqLoop
:
for
_
,
ppSeq
:=
range
b
.
postProcessors
{
artifact
:=
builderArtifact
var
priorArtifact
Artifact
priorArtifact
:=
builderArtifact
for
i
,
corePP
:=
range
ppSeq
{
artifact
,
err
:=
corePP
.
processor
.
PostProcess
(
ui
,
priorArtifact
)
if
err
!=
nil
{
errors
=
append
(
errors
,
fmt
.
Errorf
(
"Post-processor failed: %s"
,
err
))
continue
PostProcessorRunSeqLoop
}
if
artifact
==
nil
{
log
.
Println
(
"Nil artifact, halting post-processor chain."
)
continue
PostProcessorRunSeqLoop
}
if
i
==
0
{
// This is the first post-processor. We handle deleting
// previous artifacts a bit different because multiple
...
...
@@ -176,11 +185,6 @@ PostProcessorRunSeqLoop:
keepOriginalArtifact
=
corePP
.
keepInputArtifact
}
}
else
{
if
priorArtifact
==
nil
{
errors
=
append
(
errors
,
fmt
.
Errorf
(
"Post-processor returned nil artifact mid-chain."
))
continue
PostProcessorRunSeqLoop
}
// We have a prior artifact. If we want to keep it, we append
// it to the results list. Otherwise, we destroy it.
if
corePP
.
keepInputArtifact
{
...
...
@@ -192,13 +196,6 @@ PostProcessorRunSeqLoop:
}
}
var
err
error
artifact
,
err
=
corePP
.
processor
.
PostProcess
(
ui
,
artifact
)
if
err
!=
nil
{
errors
=
append
(
errors
,
fmt
.
Errorf
(
"Post-processor failed: %s"
,
err
))
continue
PostProcessorRunSeqLoop
}
priorArtifact
=
artifact
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment