I'm trying to create a snapp from an app host on github (etherpad-lite).

When I launch the snapcraft stage command, snapcraft downloads all the files into the parts/etherpad-lite/src folder and then builds all that need to be built, and copies files into the stage/bin folder.

Now I need to copy some script from the source folder to the stage/bin folder.

How I can do that in snapcraft?

All the history is explained on the snap-app-devel ML : https://lists.ubuntu.com/archives/snappy-app-devel/2016-February/000611.html

share|improve this question

There is a copy plugin. So you can add a part that copies files into /bin

   <part-name>:
      plugin: copy
      source: <your source directory>
      files:
         <source path 1>: <destination path 1>
         <source path 2>: <destination path 2>

You can play around with that and check the result in the directories ./parts, ./stage and ./snap .

share|improve this answer
    
Thx @abbgrade, I didn't know that we could use the copy plugin like this :) I'll try – Winael Feb 28 '16 at 22:19
    
Is it possible to copy an entire folder ? or is it just file by file ? – Winael Feb 29 '16 at 11:27
3  
Now that the copy plugin is deprecated how does one do this with the dump plugin? I get Additional properties are not allowed ('files' was unexpected) when I try this advice but with plugin: dump. – sarnold Aug 13 '16 at 2:00

You can use the dump plugin to copy files:

<part-name>:
   plugin: dump
   source: .
   stage:
      - <file1>
      - <file2>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.