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
0a90d3e7
Commit
0a90d3e7
authored
Jun 18, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
post-processor/compress: Boilerplate for the compress PP
parent
b34bc1a0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
0 deletions
+52
-0
config.go
config.go
+4
-0
plugin/post-processor-compress/main.go
plugin/post-processor-compress/main.go
+10
-0
post-processor/compress/post-processor.go
post-processor/compress/post-processor.go
+38
-0
No files found.
config.go
View file @
0a90d3e7
...
@@ -30,6 +30,10 @@ const defaultConfig = `
...
@@ -30,6 +30,10 @@ const defaultConfig = `
"validate": "packer-command-validate"
"validate": "packer-command-validate"
},
},
"post-processors": {
"compress": "packer-post-processor-compress"
},
"provisioners": {
"provisioners": {
"shell": "packer-provisioner-shell"
"shell": "packer-provisioner-shell"
}
}
...
...
plugin/post-processor-compress/main.go
0 → 100644
View file @
0a90d3e7
package
main
import
(
"github.com/mitchellh/packer/post-processor/compress"
"github.com/mitchellh/packer/packer/plugin"
)
func
main
()
{
plugin
.
ServePostProcessor
(
new
(
compress
.
PostProcessor
))
}
post-processor/compress/post-processor.go
0 → 100644
View file @
0a90d3e7
// compress implements the packer.PostProcessor interface and adds a
// post-processor for compressing output.
package
compress
import
(
"errors"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/mapstructure"
)
type
Config
struct
{
Format
string
}
type
PostProcessor
struct
{
config
Config
}
func
(
p
*
PostProcessor
)
Configure
(
raw
interface
{})
error
{
if
err
:=
mapstructure
.
Decode
(
raw
,
&
p
.
config
);
err
!=
nil
{
return
err
}
if
p
.
config
.
Format
==
""
{
p
.
config
.
Format
=
"tar.gz"
}
if
p
.
config
.
Format
!=
"tar.gz"
{
return
errors
.
New
(
"only 'tar.gz' is a supported format right now"
)
}
return
nil
}
func
(
p
*
PostProcessor
)
PostProcess
(
ui
packer
.
Ui
,
artifact
packer
.
Artifact
)
(
packer
.
Artifact
,
error
)
{
ui
.
Say
(
"We made it to here."
)
return
nil
,
nil
}
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