Skip to content

Commit

Permalink
Fix jimmctl snap (#1044)
Browse files Browse the repository at this point in the history
* Fix jimmctl snap

* newlines
  • Loading branch information
ale8k authored Sep 15, 2023
1 parent 30c6c9d commit efbf28a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/access.log
/parts/
/prime/
/snap/.snapcraft/
/snap/
/stage/
/vendor
/version/commit.txt
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ jimm-image:
jimm-snap:
mkdir -p ./snap
cp ./snaps/jimm/snapcraft.yaml ./snap/
snapcraft
snapcraft

jimmctl-snap:
mkdir -p ./snap
cp -R ./snaps/jimmctl/* ./snap/
snapcraft

push-microk8s: jimm-image
docker tag jimm:latest localhost:32000/jimm:latest
Expand Down
3 changes: 0 additions & 3 deletions snaps/jimmctl/files/jimmctl.wrapper

This file was deleted.

3 changes: 3 additions & 0 deletions snaps/jimmctl/local/jimmctl.wrapper
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

JUJU_DATA=$SNAP_REAL_HOME/.local/share/juju "$SNAP"/bin/jimmctl "$@"
18 changes: 13 additions & 5 deletions snaps/jimmctl/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
name: jimmctl
version: git
summary: JAAS client
description: Client for controlling JAAS multi-cloud juju controllers.
version: git
grade: stable
base: core20
confinement: strict

plugs:
# We use personal-files instead of the home interface
# as the home interface does not permit access to hidden files/directories.
# See: https://askubuntu.com/questions/1238211/how-to-make-snaps-access-hidden-files-and-folders-in-home
# And: https://snapcraft.io/docs/personal-files-interface
#
# The personal-files interface is also a none auto-connect, and must
# typically be connected via: snap connect jimmctl:dot-local-share-juju
#
# In our scenario, we are going to request auto-connect.
dot-local-share-juju:
interface: personal-files
read:
- $HOME/.local/share/juju
- $HOME/.local/share/juju/cookies

apps:
jimmctl:
Expand All @@ -19,7 +29,6 @@ apps:
- dot-local-share-juju
- network


parts:
jimmctl:
plugin: go
Expand All @@ -30,11 +39,10 @@ parts:
override-build: |
set -e
go install -mod readonly -ldflags '-linkmode=external' github.com/canonical/jimm/cmd/jimmctl
files:
wrapper:
plugin: dump
source: snaps/jimmctl/files/
source: snaps/jimmctl/local/
source-type: local
organize:
jimmctl.wrapper: bin/wrappers/jimmctl
Expand Down

0 comments on commit efbf28a

Please sign in to comment.