如何创建自定义 Snapcraft 频道?

How to create a custom Snapcraft channel?

我什至只能在文档中找到几个地方表明这是可能的,但显然是可能的。

Moving a snap between channels helps to manage a user’s expectations in any trade-off between stability in the stable channel, and cutting edge features in the edge channel (as an arbitrary example). But its also a useful technique for beta testing, or for when a snap needs to revert to a previous revision. -- https://snapcraft.io/docs/release-management


kubectl(见下文)为例,除了默认的 latest 频道外,每个旧的次要版本都有一个频道。

我们即将发布一个与 Ubuntu 16.04 及更低版本不兼容的新版本,我们希望这些用户可以使用旧版本。我们怎样才能做到这一点?

❯ snap info kubectl
name:      kubectl
summary:   Command line client for controlling a Kubernetes cluster.
publisher: Canonical✓
store-url: https://snapcraft.io/kubectl
contact:   https://www.ubuntu.com/kubernetes
license:   Apache-2.0
description: [...]
snap-id: ZgG2URycDgvxSVskfoZxn44uaRMw0iwe
channels:
  latest/stable:    1.21.1         2021-05-14 (1976) 11MB classic
  latest/candidate: 1.21.1         2021-05-14 (1976) 11MB classic
  latest/beta:      1.21.1         2021-05-14 (1976) 11MB classic
  latest/edge:      1.21.1         2021-05-14 (1976) 11MB classic
  1.22/stable:      –                                     
  1.22/candidate:   –                                     
  1.22/beta:        –                                     
  1.22/edge:        1.22.0-alpha.1 2021-04-29 (1945) 11MB classic
  1.21/stable:      1.21.1         2021-05-13 (1976) 11MB classic
  1.21/candidate:   1.21.1         2021-05-13 (1976) 11MB classic
  1.21/beta:        1.21.1         2021-05-13 (1976) 11MB classic
  1.21/edge:        1.21.1         2021-05-13 (1976) 11MB classic
  1.20/stable:      1.20.7         2021-05-13 (1949)  9MB classic
  1.20/candidate:   1.20.7         2021-05-13 (1949)  9MB classic
  1.20/beta:        1.20.7         2021-05-13 (1949)  9MB classic
  1.20/edge:        1.20.7         2021-05-13 (1949)  9MB classic
  1.19/stable:      1.19.11        2021-05-13 (1947) 10MB classic
  1.19/candidate:   1.19.11        2021-05-13 (1947) 10MB classic
  1.19/beta:        1.19.11        2021-05-13 (1947) 10MB classic
  1.19/edge:        1.19.11        2021-05-13 (1947) 10MB classic
  1.18/stable:      1.18.19        2021-05-13 (1951) 10MB classic
  1.18/candidate:   1.18.19        2021-05-13 (1951) 10MB classic
  1.18/beta:        1.18.19        2021-05-13 (1951) 10MB classic
  1.18/edge:        1.18.19        2021-05-13 (1951) 10MB classic
  1.17/stable:      1.17.17        2021-01-15 (1777) 10MB classic
  1.17/candidate:   1.17.17        2021-01-15 (1777) 10MB classic
  1.17/beta:        1.17.17        2021-01-15 (1777) 10MB classic
  1.17/edge:        1.17.17        2021-01-15 (1777) 10MB classic
  1.16/stable:      1.16.15        2020-10-20 (1639) 10MB classic
  1.16/candidate:   1.16.15        2020-10-20 (1639) 10MB classic
  1.16/beta:        1.16.15        2020-10-20 (1639) 10MB classic
  1.16/edge:        1.16.15        2020-10-20 (1639) 10MB classic
  [...]

这些被称为“曲目”。每一个都有自己的边缘、测试、候选和稳定通道。

有一个过程要求您通过 forum.snapcraft.io 话语请求新曲目。有关该过程的更多详细信息,请参阅 https://snapcraft.io/docs/process-for-aliases-auto-connections-and-tracks