-
Notifications
You must be signed in to change notification settings - Fork 385
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
Add support for building snaps #313
Conversation
Hey @igorljubuncic really appreciate you taking the time to send this on the Would you be in a position to include the necessary yaml instructions or should this be a decision and job for the snapcraft user who may have the necessary go environment or have added the go snap already? Appreciate your guidance and assistance since as you can probably tell, I have very limited knowledge of Snap, but want to ensure the file we include in the repo lets a snap user get Ponzu up and running with no issues. Thanks again. |
Hi Ollie, Sure thing, just one question for clarification - do you need go at build time or runtime? So if it's build time, then the yaml changes as follows:
If it's runtime, the yaml changes as follows:
For the stage package, you could just add |
There are two binaries, the Ponzu CLI, for which it is necessary to have Go installed, to build & install the CLI itself, and then the Ponzu server (your application) and the CLI uses Go under the hood to build the Ponzu server. With version control someone may pull their ponzu server source down to the physical production server and build it there, in which case they'd need Go installed so the CLI could build the Ponzu server binary, or, they may send the Ponzu server binary direct via SCP or similar, in which case there'd be no requirement for Go. To summarise this, I think, in the development environment you would definitely need Go installed. In the production environment, you may need Go installed, depending on your workflow. But in both cases they are build-time dependencies. |
You could have two apps inside the snap - both the cli and the server. Most of the time, snaps have a single app in the app stanza, but you can have more (including the server). They can have their different parts, and be built separately, but still be offered in a single bundle. You can build with just build packages, see if everything works, then add stage packages. This will only slightly change the size of the snap, e.g.:
Does this make sense? |
That's not clear to me - I might have muddied the water a bit with my explanation. I think as a minimum, if someone whats to install Ponzu from a snap, then Go (either from a snap, or other source) should be present. |
Then this is what you need (stage = runtime assets):
|
As per #313 just adding code to have go be a dependency
@igorljubuncic I've added that to the file, it's in ponzu-dev but will be merged to master in due course |
Excellent! Once ponzu is in the store, we can do some work together to promote it. |
As per #313 just adding code to have go be a dependency
Following up on #307.
This is the PR for building a snap package of ponzu.
Build and test
You can use:
Build locally
I used Ubuntu 18.04 for this.
This command will generate a .snap file, something like ponzu_1.0_amd64.snap.
Install locally
snap install ponzu_1.0_amd64.snap --dangerous
The --dangerous flag is necessary because the app (snap) does not originate from the snap store just yet and is not digitally signed.
Run ponzu
snap run ponzu "options"
Register dev account
You can do this here: https://snapcraft.io/account.
Register ponzu name in the store
This can be done on the command line with snapcraft:
snapcraft login snapcraft register
Upload/push ponzu to the store
snapcraft push ponzu_1.0_amd64.snap --release edge
We use release channels to denote risk, as follows:
You can promote to different channels after testing and validation.
Install from store for (a second) test
snap install ponzu --edge
I think this covers it.
Once you land the PR, we can help you with the promotion of ponzu.
Feel free to ask any questions you may have.
Thanks!