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

[nice to have] Some contributors / developers instructions #259

Open
fernflower opened this issue Jan 13, 2025 · 5 comments
Open

[nice to have] Some contributors / developers instructions #259

fernflower opened this issue Jan 13, 2025 · 5 comments

Comments

@fernflower
Copy link
Contributor

It would be great to include some contributors guide / rtfm link with minimal information for people coming from outside of packer plugin development.
For example I'm currently struggling with the basics of "how do I build the plugin after I applied some changes to the source code so that packer picks it up" and would greatly benefit of anything like that.
Thanks!

@mkumatag
Copy link
Member

Agree, lot needs to be improved.

@mkumatag
Copy link
Member

if you want to modify and build/run then following make target can be used:

# Builds the code and installs the packer plugin code using packer command.
# Note: make sure to delete any pre-existing plugin in the machine - ref: https://developer.hashicorp.com/packer/docs/commands/plugins/remove
$ make install

@mkumatag
Copy link
Member

mkumatag commented Jan 13, 2025

uninstallation is also taken care part of the make target via #263 before installation

@fernflower
Copy link
Contributor Author

Hmm actually the recent change has introduced some troubles with local install for me, so I had to revert it.
Looks like now it doesn't play nicely if the user removes the plugin manually.

ivasilev@ivasilev-thinkpadp1gen4i:~/projects/packer-plugin-powervs$ packer plugins remove github.com/ppc64le-cloud/powervs
/home/ivasilev/.packer.d/plugins/github.com/ppc64le-cloud/powervs/packer-plugin-powervs_v0.0.1-dev_x5.0_linux_amd64
ivasilev@ivasilev-thinkpadp1gen4i:~/projects/packer-plugin-powervs$ make install
No installed plugin found matching the plugin constraints github.com/ppc64le-cloud/powervs
make: *** [GNUmakefile:18: uninstall] Error 1
ivasilev@ivasilev-thinkpadp1gen4i:~/projects/packer-plugin-powervs$ packer plugins installed
/home/ivasilev/.packer.d/plugins/github.com/hashicorp/amazon/packer-plugin-amazon_v1.3.4_x5.0_linux_amd64
/home/ivasilev/.packer.d/plugins/github.com/hashicorp/ansible/packer-plugin-ansible_v1.1.2_x5.0_linux_amd64
/home/ivasilev/.packer.d/plugins/github.com/IBM/ibmcloud/packer-plugin-ibmcloud_v3.2.6_x5.0_linux_amd64

Revert:

ivasilev@ivasilev-thinkpadp1gen4i:~/projects/packer-plugin-powervs$ git diff
diff --git a/GNUmakefile b/GNUmakefile
index 94c0e61..c712d13 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -17,7 +17,7 @@ dev: build
 uninstall:
        @packer plugins remove github.com/ppc64le-cloud/powervs
 
-install: build uninstall
+install: build
        @packer plugins install -path ./${BINARY} "github.com/ppc64le-cloud/powervs"
 
 test:

@mkumatag
Copy link
Member

Looks like now it doesn't play nicely if the user removes the plugin manually.

this can be ignored with - before the command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants