You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 10, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: tutorials/packaging/create-your-first-snap.md
+48-24Lines changed: 48 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -152,7 +152,7 @@ confinement: devmode # use 'strict' once you have the right plugs and slots
152
152
This part of `snapcraft.yaml` is mandatory and describes the very basics of the snap metadata. Let’s go through this line by line:
153
153
154
154
- **name** describes the name of the snap.
155
-
- **version** is the current version of the snap. This is just a human readable string. The ascii order doesn’t matter: all snap uploads will get an incremental snap **revision**, which is independant from the version. It’s separated so that you can upload multiple times the same snap for the same architecture with the exact same version. See it as a string that indicates to your user the current version, like “stable”, “2.0” and such.
155
+
- **version** is the current version of the snap. This is just a human readable string. The ascii order doesn’t matter: all snap uploads will get an incremental snap **revision**, which is independent from the version. It’s separated so that you can upload multiple times the same snap for the same architecture with the exact same version. See it as a string that indicates to your user the current version, like “stable”, “2.0” and such.
156
156
- **summary** is a short, one-line summary or tag-line for your snap.
157
157
- **description** should provide the user with enough information to judge if the snap is going to be useful to them. This description can span over multiple lines if prefixed with **|**.
158
158
- **grade** can be used by the publisher to indicate the quality confidence in the build. The store will prevent publishing "devel" grade builds to stable channels.
@@ -486,7 +486,7 @@ One last thing you might want to do before the snap is ready for wider consumpti
486
486
487
487
488
488
negative
489
-
: Users of snaps using `devmode`, will need to pass `--devmode` during the installation, so they explicitly agree to trust you and your snap. Another benefit of removing devmode is that you will be able to ship your snap on the **stable** or **candidate** channels (you can only publish to the other channels, like **beta** or **edge** as your snap is less trusted) and users will be able to search for it using `snap find`.
489
+
: Users of snaps using `devmode`, will need to pass `--devmode` during the installation, so they explicitly agree to trust you and your snap. Another benefit of removing devmode is that you will be able to ship your snap on the **stable** or **candidate** channels (you can only release to the other channels, like **beta** or **edge** as your snap is less trusted) and users will be able to search for it using `snap find`.
490
490
491
491
492
492
For this to be declared in your snap, let’s set `confinement` to `strict` in your `snapcraft.yaml`:
@@ -551,7 +551,7 @@ positive
551
551
552
552
You are done. This snap is ready for publication!
553
553
554
-
## Upload to the store
554
+
## Push to the store
555
555
Duration: 5:00
556
556
557
557
@@ -560,29 +560,34 @@ positive
560
560
Check or download [here][here3] to see what your current directory should look like.
561
561
562
562
563
-
Apps can easily be uploaded to the store via [My Apps]. Registering an account is easy, so let’s do that first.
563
+
Apps can easily be uploaded to the [Snap Store](https://snapcraft.io/discover/). Registering an account is easy, so let’s do that first.
564
564
565
565
### Registering an account
566
566
567
-
Open My Apps in your browser and follow the instructions to register an account:
567
+
Open the [snapcraft dashboard](https://dashboard.snapcraft.io/dev/account/) in your browser and follow the instructions to register an account:
Enter your email address, name and password, accept the terms of service and create the account. Remember as well to choose a namespace on myapps before registering your snap.
576
+
Enter your email address, name and password, accept the terms of service and create the account. Remember as well to choose a "Snap store username", that will identify you as a developer, before registering your snap.
577
577
578
-
It’s then time for you to get authenticated from snapcraft:
578
+
### Command-line authentication
579
+
580
+
It’s time for you to get authenticated from snapcraft:
581
+
582
+
To do so, use the `snapcraft login` command.
579
583
580
584
If it is your first time you will get a message to enable multifactor authentication and agree with the developer terms and conditions.
581
585
582
586
583
587
```bash
584
588
~/hello$ snapcraft login
585
-
Enter your Ubuntu One SSO credentials.
589
+
Enter your Ubuntu One e-mail address and password.
590
+
If you do not have an Ubuntu One account, you can create one at https://dashboard.snapcraft.io/openid/login
586
591
Email: myemail@provider.com
587
592
Password:
588
593
One-time password (just press enter if you don't use two-factor authentication):
@@ -596,12 +601,26 @@ You can logout any time with simply `snapcraft logout`.
596
601
597
602
Before being able to upload any snap, you need to register (meaning: reserving) a name. That way, this snap name is yours, and you will be able to upload snaps matching this name.
598
603
599
-
To reserve a new name, simply try:
604
+
To reserve a new name, simply try`snapcraft register`:
600
605
601
606
602
607
```bash
603
608
~/hello$ snapcraft register hello-<yourname>
604
609
snapcraft register hello-<yourname>
610
+
611
+
We always want to ensure that users get the software they expect
612
+
for a particular name.
613
+
614
+
If needed, we will rename snaps to ensure that a particular name
615
+
reflects the software most widely expected by our community.
616
+
617
+
For example, most people would expect ‘thunderbird’ to be published by
618
+
Mozilla. They would also expect to be able to get other snaps of
619
+
Thunderbird as 'thunderbird-$username'.
620
+
621
+
Would you say that MOST users will expect 'hello-<yourname>' to come from
622
+
you, and be the software you intend to publish there? [y/N]: y
623
+
605
624
Registering hello-<yourname>.
606
625
Congratulations! You're now the publisher for 'hello-<yourname>'.
607
626
```
@@ -616,7 +635,7 @@ If you changed your snap name while registering, you need to rebuild this snap w
616
635
name: hello-didrocks
617
636
[…]
618
637
```
619
-
- as we want to publish it in the candidate channel, we need to set its grade to stable:
638
+
- as we want to release it in the candidate channel, we need to set its grade to stable:
620
639
621
640
```bash
622
641
grade: stable
@@ -637,11 +656,11 @@ Snapping 'hello-didrocks' -
637
656
Snapped hello-didrocks_2.10_amd64.snap
638
657
```
639
658
640
-
### Upload your snap
659
+
### Push and release your snap
641
660
642
661
It’s high time to make this snap available to the world!
643
662
644
-
Let’s try to publish it to the **candidate** channel for now:
663
+
Let’s try to release it to the **candidate** channel for now:
You should receive an email telling you that your snap is pending review (automatic checking). If you are not using any reserved interfaces and security checks are passing, it would be available to the user (in the **candidate**, **beta** and **edge** channels in this case) to your users via a simple:
663
-
681
+
You should receive an email telling you that your snap is pending review (automatic checking). If you are not using any reserved interfaces and security checks are passing, it would be available to the user (in the **candidate** channel in this case) to your users via a simple:
: As you uploaded an amd64 binary, only people on amd64 machine will get access to this snap. You can either only focus on one architecture to support, build yourself for all supported architectures your snap, or use **launchpad snap build service** to push your `snapcraft.yaml`, and get resulting snaps built on all architectures for you! More information are [available here].
688
+
: As you uploaded an amd64 binary, only people on 64-bit machines will get access to this snap. You can either only focus on one architecture to support, manually build a binary for each architecture you wish to support, or use [build.snapcraft.io](https://build.snapcraft.io) to push your `snapcraft.yaml`, and get resulting snaps built on all architectures for you!
672
689
673
-
From here, if you are happy with the testing of your snap, you can snapcraft push again the same file, omitting `--release` option to publish a revision 2 in the **stable** channel. You can use the website as well and check the box for the channels you want this revision 1 to be published to.
690
+
From here, if you are happy with the testing of your snap, you can use the `snapcraft release` command to have fine-grained control over what you are releasing and where:
674
691
675
-
Remember that snaps with `confinement: devmode` can’t be published to the **stable** or **candidate** channels.
So, to release hello-didrocks to the stable channel, and make it immediately visible in the store:
677
698
678
-
positive
679
-
: Note: both of these steps (registering and uploading new snaps) are also available through the web interface. You then just upload your .snap files after clicking on **New Snap** on the website and filling in the form.
699
+
```bash
700
+
snapcraft release hello-didrocks 1 stable
701
+
```
702
+
703
+
Remember that snaps with `confinement: devmode` can’t be released to the **stable** or **candidate** channels.
680
704
681
705
The web interface will give you information about the publication status. Take a look to see all the available options!
682
706
@@ -716,7 +740,7 @@ By now you should successfully have built your first snap, fixed build issues, e
Copy file name to clipboardExpand all lines: tutorials/packaging/snap-a-website.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -667,8 +667,7 @@ What a journey! If this is the first time you installed a snap or created a LXD
667
667
668
668
### How to share my snap with the world?
669
669
670
-
You can release it in the Snap Store and make it available privately or publicly in 5 minutes.
671
-
Publishing steps are available in the [snapcraft docs](https://docs.snapcraft.io/build-snaps/publish).
670
+
To release it in the Snap Store and make it available to others, privately or publicly, follow the [publishing steps](https://docs.snapcraft.io/build-snaps/publish).
0 commit comments