Skip to content

Commit a1da048

Browse files
Leo Ariasplaindocs
Leo Arias
authored andcommitted
Add documentation about the continuous delivery of snaps (travis-ci#1287)
* Add documentation about the continuous delivery of snaps * a little rewording on the encrypt link. * update the tutorial link * minor edits
1 parent 479f17b commit a1da048

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

user/deployment/snaps.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: Ubuntu Snap Store
3+
layout: en
4+
permalink: /user/deployment/snaps/
5+
---
6+
7+
Travis CI can automate the continuous delivery of [snaps](https://snapcraft.io) to the Ubuntu store.
8+
9+
Snaps are a new packaging and delivery system for Ubuntu, Debian, Fedora, openSuse and other [Linux distros](https://snapcraft.io/docs/core/install). Snaps are secure, they bundle all their dependencies and they are designed to be part of the upstream development workflow in a seamless way. This means that no distro maintainers are involved, and that the delivery to the store can be fully automated. The snaps installed in the users' machines are auto-updated, so a few hours after you push a new snap to the store, all your users will get the most recent version.
10+
11+
To automate continuous delivery of snaps to the Ubuntu store:
12+
13+
1. [Encrypt](https://docs.travis-ci.com/user/encrypting-files) your snapcraft credentials with Travis CI
14+
2. Add the encrypted credentials to the repository where you have the `snapcraft.yaml` metadata for your package.
15+
3. Run `snapcraft` and `snapcraft push` in your `.travis.yml`:
16+
17+
```yaml
18+
deploy:
19+
skip_cleanup: true
20+
provider: script
21+
script: docker run -v $(pwd):$(pwd) -w $(pwd) snapcore/snapcraft sh -c "apt update && snapcraft && snapcraft push *.snap --release edge"
22+
on:
23+
branch: master
24+
```
25+
26+
The `snapcraft enable-ci travis` command will assist you getting the credential, encrypting it and adding the right script to the deploy section of your `.travis.yml` file. Here is a [tutorial that will guide you setting up the continuous delivery from Travis CI](https://tutorials.ubuntu.com/tutorial/continuous-snap-delivery-from-travis-ci#0) on your project.
27+
28+
Note that the `edge` channel is intended for crowdtesting with your community of early adopters. With this deployment script in Travis, every time a pull request lands into the master branch, a new snap will be published to edge. Your testers can install it in any of the supported Linux distros with:
29+
30+
```bash
31+
sudo snap install my-snap-name --edge
32+
```
33+
34+
After that, they will be always ready to provide early feedback and help making a more stable release.
35+
36+
You can adjust the Travis script and the `snapcraft` calls to fit your development process. For example, you could install the snap and run user acceptance tests before releasing to edge, to make sure that there are no regressions in master. Also, there are three other channels in the store: `beta`, `candidate` and `stable`. You can run different tests suites with Travis for each channel on your way to stable.
37+
38+
There are plenty of [tutorials](https://tutorials.ubuntu.com/) and [videos](https://www.youtube.com/snapcraftio) that will help you packaging your project as a snap. This one is a very good way to get started: [https://tutorials.ubuntu.com/tutorial/create-your-first-snap](https://tutorials.ubuntu.com/tutorial/create-your-first-snap)

0 commit comments

Comments
 (0)