Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flag to skip postprocessor #2679

Closed
rrva opened this issue Aug 25, 2015 · 20 comments · Fixed by #7183
Closed

flag to skip postprocessor #2679

rrva opened this issue Aug 25, 2015 · 20 comments · Fixed by #7183
Labels
core Core components of Packer enhancement post-1.0 +1

Comments

@rrva
Copy link

rrva commented Aug 25, 2015

I'd like a flag to skip certain postprocessors, for example atlas when I only want to do a local build.

@rrva
Copy link
Author

rrva commented Aug 25, 2015

Similar to -only:

packer -postprocessors vagrant

will only run the vagrant postprocessor

@cbednarski cbednarski added enhancement core Core components of Packer labels Aug 25, 2015
@ghost
Copy link

ghost commented Aug 25, 2015

2nd this. I know docker really wants us to use dockerhub but I don't have any need for that.

@robertrossmann
Copy link

👍

Yes, this would be a welcome addition. I frequently find myself testing my builds locally to catch any errors before I am ready for publishing and so far I had to manually remove the atlas post-processor when I wanted to only do a local build.

@mwrock
Copy link

mwrock commented Sep 29, 2015

👍 yes. this would be a welcome feature

@simbo
Copy link

simbo commented Oct 11, 2015

+1
Yes, please.

@mvermaes
Copy link
Contributor

👍

Currently we maintain two templates, one to generate AWS/Vagrant images via Atlas, another with the details required for the vSphere postprocessor (which is otherwise identical to the Atlas one).

@sharumpe
Copy link

sharumpe commented Nov 3, 2015

+1

We also maintain two .json files: one for vagrant box build for testing and one for vSphere. It would be wonderful to be able to overload -only= or add -only-post= (or similar) to limit the post-processor.

@bdwyertech
Copy link
Contributor

👍

@wyaeld
Copy link

wyaeld commented Jan 18, 2016

@cbednarski any love for this? Seems consistent with the DRY design.

Only comment I would make it that potentially rather than referring to provisioners/builders/post-processors by type, being able to 'tag' them, and filter the tags to run would give more flexibility, and its a pattern used successfully in some other tools.

eg.

packer build -tags vmware my-packer-template-with-everything.json

packer build --help
...
Options:

  -tags=foo,bar,baz         Only include the builds, provisioners and post-processors that match the tags
...

@cbednarski
Copy link
Contributor

Thanks for the suggestion, folks. This sounds like a good feature addition to me, but it's not on my short list right now.

rather than referring to provisioners/builders/post-processors by type, being able to 'tag' them, and filter the tags to run would give more flexibility

I like this idea. At least from a UX perspective this is a nice way to do things since you won't need to remember a bunch of different flags. At first glance I think we may be able to overload -only to use tags or builds. By default nothing will have a tag (and tags will not exist in anyone's build templates) so it should be backwards-compatible. Need to consider some of the compound cases here before committing to this, though.

@cbednarski cbednarski added the +1 label Jan 20, 2016
@steve-jansen
Copy link

Ran into this problem with local packer builds that include an Atlas post-processor.

As a one-liner workaround, the awesome jq can strip the post-processor block, then pipe it via stdin to packer...

jq 'del(."post-processors")' packer.json | packer build -

@bdwyertech
Copy link
Contributor

Thank you sir @steve-jansen, didn't know jq existed. Great addition to the arsenal.

@bdwyertech
Copy link
Contributor

It seems stripping post-processors caused no build artifacts to be produced, not even a local box. If you want to target a specific post-processor, use this jq '.["post-processors"][0] |= map(select(.type != "atlas"))' packer.json | packer build -

Credit goes to @parkershepherd

@marcusportmann
Copy link

+1

Also struggling with local packer builds that include an Atlas post-processor.

@panpan0000
Copy link

+1

1 similar comment
@pierreant-p
Copy link

+1

@rverchere
Copy link

+1

@awiddersheim
Copy link
Contributor

+1

@lfarnell
Copy link
Contributor

please don't +1 in a comment. Please use a reaction stead. It generates unnecessary emails when a +1 comment is made

@ghost
Copy link

ghost commented Apr 1, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
core Core components of Packer enhancement post-1.0 +1
Projects
None yet
Development

Successfully merging a pull request may close this issue.