Skip to content
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

snapcraft.yaml: improve version,base and plugs #161

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: spread
version: 2020.08.19
adopt-info: spread
summary: Convenient full-system test (task) distribution
description: |
Spread is a plesant way distribute full-system integration tests and
Expand All @@ -12,14 +12,35 @@ description: |

confinement: strict
grade: stable
base: core20
base: core22

plugs:
dot-spread:
interface: personal-files
read:
- $HOME/.spread
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some concerns during a discussion: as $HOME inside the confinement does not point to the real /home but ~/snap/sparead/ this seems a bit useless without further changes. So this needs some more investigation/thinking.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes whilst $HOME in the snap environment points to $SNAP_USER_DATA, in this case $HOME gets used as an AppArmor rule and will translate to @{HOME} - see formatPath() in interfaces/builtin/common_files.go - https://github.com/snapcore/snapd/blob/master/interfaces/builtin/common_files.go#L70 - so this works as intended.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that what @mvo5 is alluding to is that perhaps spread needs to be aware of this detail

write:
- $HOME/.spread
dot-gcloud:
interface: personal-files
read:
- $HOME/.config/gcloud
apps:
spread:
command: bin/spread
plugs: [home, network, network-bind]
plugs:
- home
- network
- network-bind
- dot-spread
- dot-gcloud

parts:
spread:
plugin: go
source: .
build-packages: [git]
build-snaps: [go]
override-pull: |
snapcraftctl pull
snapcraftctl set-version "$(date +"%Y.%m.%d").g$(git describe --always)"