mirror of
https://github.com/goreleaser/goreleaser.git
synced 2024-12-27 01:33:39 +02:00
fix(snapcraft): set confinement to strict by default
This commit is contained in:
parent
2226cb5146
commit
2e9eefb5b9
@ -126,6 +126,9 @@ func (Pipe) Default(ctx *context.Context) error {
|
|||||||
if snap.Grade == "" {
|
if snap.Grade == "" {
|
||||||
snap.Grade = "stable"
|
snap.Grade = "stable"
|
||||||
}
|
}
|
||||||
|
if snap.Confinement == "" {
|
||||||
|
snap.Confinement = "strict"
|
||||||
|
}
|
||||||
if len(snap.ChannelTemplates) == 0 {
|
if len(snap.ChannelTemplates) == 0 {
|
||||||
switch snap.Grade {
|
switch snap.Grade {
|
||||||
case "devel":
|
case "devel":
|
||||||
|
@ -494,6 +494,7 @@ func TestDefault(t *testing.T) {
|
|||||||
require.Equal(t, []string{"foo"}, ctx.Config.Snapcrafts[0].Builds)
|
require.Equal(t, []string{"foo"}, ctx.Config.Snapcrafts[0].Builds)
|
||||||
require.Equal(t, []string{"edge", "beta", "candidate", "stable"}, ctx.Config.Snapcrafts[0].ChannelTemplates)
|
require.Equal(t, []string{"edge", "beta", "candidate", "stable"}, ctx.Config.Snapcrafts[0].ChannelTemplates)
|
||||||
require.Equal(t, "stable", ctx.Config.Snapcrafts[0].Grade)
|
require.Equal(t, "stable", ctx.Config.Snapcrafts[0].Grade)
|
||||||
|
require.Equal(t, "strict", ctx.Config.Snapcrafts[0].Confinement)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDefaultGradeTmpl(t *testing.T) {
|
func TestDefaultGradeTmpl(t *testing.T) {
|
||||||
|
@ -91,6 +91,8 @@ snapcrafts:
|
|||||||
# `devel` will let you release only to the `edge` and `beta` channels in the
|
# `devel` will let you release only to the `edge` and `beta` channels in the
|
||||||
# store. `stable` will let you release also to the `candidate` and `stable`
|
# store. `stable` will let you release also to the `candidate` and `stable`
|
||||||
# channels.
|
# channels.
|
||||||
|
#
|
||||||
|
# Default: 'stable'
|
||||||
grade: stable
|
grade: stable
|
||||||
|
|
||||||
# Snaps can be setup to follow three different confinement policies:
|
# Snaps can be setup to follow three different confinement policies:
|
||||||
@ -99,6 +101,8 @@ snapcrafts:
|
|||||||
# permissions for strict snaps can be declared as `plugs` for the app, which
|
# permissions for strict snaps can be declared as `plugs` for the app, which
|
||||||
# are explained later. More info about confinement here:
|
# are explained later. More info about confinement here:
|
||||||
# https://snapcraft.io/docs/reference/confinement
|
# https://snapcraft.io/docs/reference/confinement
|
||||||
|
#
|
||||||
|
# Default: 'strict'
|
||||||
confinement: strict
|
confinement: strict
|
||||||
|
|
||||||
# Your app's license, based on SPDX license expressions:
|
# Your app's license, based on SPDX license expressions:
|
||||||
|
Loading…
Reference in New Issue
Block a user