This plugin dumps the content from a specified source.
You can specify various details about such a source using source keywords, such as source and source-type.
This plugin uses also common plugin keywords.
Such keywords can, for example, be useful when the dumped content needs to be mangled or organised in some way. Using keywords such as filesets, stage, snap and organize can be useful in such cases.
Since the target destination is never mentioned in these dump/organize examples, is it true that the target is the /root/prime virtual machine directory during the build process (which ends up as the root of the snap)?
Thus the dump command above copies the files from local-source/ into prime and the organize moves them into subdirs of prime, so that for example:
local-source/*.png ends up in /prime and then they all get moved into /prime/images/
local-source/launch.wrapper ends up in /prime and then gets moved into /prime/usr/bin/launcher/launch.wrapper
It is true that the target will end up be placing at the root of the snap file hierachy, what is unnecessarily true that it will always match the /root/prime virtual machine directory since thatās a Snapcraft internal implementation details.
Also the plugins only affect what will be contained in the SNAPCRAFT_PART_INSTALL directory in the partās build step, whether the file will end in SNAPCRAFT_PRIME directory will also be determined by the stage and prime step.
fileset: filesets appear to be a way to group files and operate on the group at once.
stage: no clue what this does. āA list of files from to stage.ā This tells me very little.
snap: I canāt find anything called snap in the common keywords link.
organize: I think I understand from the example that organize will rename files.
I am specifically here looking how to insert only a specific file into the snap. I just want foo/bar.sh included in my snap. I have learned from trial and error that source: ./foo will include ALL files from foo in the snap, dumped into the base directory of the snap. It would be nice to have this called out.
āThis plugin just dumps the content from a specified source(directory, url, git link, etc) into the base directory of the resulting snap.ā?
I then started to dig through the example and look things up. Looking up prime doesnāt result in any information about what it does. It just says āA list of files from to prime.ā and prime links to a page that says āMigrate this partās staged material into the final priming areaā. What is my staged material? Where is the final priming area? Why do I need to know that? This doesnāt make sense unless you have a lot of internal knowledge about how snaps work.
Iām just trying to make a zip of my application here. I donāt need to know how zip works or what temporary directories are used. Iāve now clicked on 3 links going back and forth to try and decrypt how to say ācopy random filename to snapā. It is very easy at this point for a potential user to be confused and give up at this point.
Could we add some more examples and document the one that is there? I assume ā*.pngā: images/ will move all png images into a img directory, but leave all jpg files for example. That stuff seems intuitive and maybe include this single file is as well, but unless it is shown I donāt see how a user can find it easily.
Iām struggling to understand where the files go with this plugin. Where do they go? How do I change the destiny? Can I chose if they go to $SNAP or $SNAP_COMMON?
It goes to the partās install directory(/root/parts/part_name/install), then to /stage, then to /prime, then to the snapās root directory($SNAP) if not moved or pruned by the organize, stage, or prime keywords.
Can I chose if they go to $SNAP or $SNAP_COMMON?
You can organize the files to your preferred paths under $SNAP but not $SNAP_COMMON
This example seems confusing in that the second part, āremote-partā, doesnāt seem to be contributing any information about the dump plugin as it doesnāt even specify a plugin. I would delete that second part entirely for clarity.