Skip to content

Commit

Permalink
Switch to classic snap
Browse files Browse the repository at this point in the history
  • Loading branch information
nskaggs committed Feb 7, 2017
1 parent 71ece57 commit 609dbb2
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 26 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion etc/bash_completion.d/juju-version
Expand Up @@ -2,7 +2,7 @@
_juju_complete_ver() {
case "$(juju version)" in
2.*)
# See /etc/bash_completion.d/juju-2
# See /etc/bash_completion.d/juju
_juju_complete_2 "$@"
return $?
;;
Expand Down
16 changes: 16 additions & 0 deletions snap/hooks/configure
@@ -0,0 +1,16 @@
#!/bin/bash

# Make sure we have lxd installed to use
snap install lxd || true

# copy bash completions to host system
cp -a $SNAP/bash_completions/* /usr/share/bash-completion/completions/. || true

# setup sysctl defaults for lxd
mkdir -p /usr/lib/sysctl.d
cat <<EOF>/usr/lib/sysctl.d/juju-2.conf
fs.inotify.max_user_watches = 524288
fs.inotify.max_user_instances = 256
EOF
sysctl -p /usr/lib/sysctl.d/juju-2.conf
38 changes: 38 additions & 0 deletions snap/snapcraft.yaml
@@ -0,0 +1,38 @@
name: juju
version: 2.2-alpha1
summary: juju client
description: Through the use of charms, juju provides you with shareable, re-usable, and repeatable expressions of devops best practices.
confinement: classic
grade: devel

apps:
juju:
command: wrappers/juju

parts:
wrappers:
plugin: dump
source: snap/
juju:
plugin: godeps
go-importpath: github.com/juju/juju
#The source can be your local tree or github
#source: https://github.com/juju/juju.git
#If you pull a remote, set source-depth to 1 to make the fetch shorter
source-depth: 1
#source: file:///full/file/path
#By default, reuse existing tree
source: .
source-type: git
build-packages: [gcc]
#You can grab a specific tag, commit, or branch
#source-tag: juju-2.0.2
#source-commit: a83896d913d7e43c960e441c1e41612116d92d46
source-branch: develop
go-packages:
- github.com/juju/juju/cmd/juju
#If you are releasing a build with public streams, you don't need to build the agent
- github.com/juju/juju/cmd/jujud
install: |
mkdir -p $SNAPCRAFT_PART_INSTALL/bash_completions
cp -a etc/bash_completion.d/juju* $SNAPCRAFT_PART_INSTALL/bash_completions/.
8 changes: 8 additions & 0 deletions snap/wrappers/juju
@@ -0,0 +1,8 @@
#!/bin/bash

export LXD_DIR=/var/snap/lxd/common/lxd

# Make sure we access snap binaries first
export PATH=$SNAP/bin:$SNAP/usr/bin:/snap/bin:$PATH

exec $SNAP/bin/juju "$@"
25 changes: 0 additions & 25 deletions snapcraft.yaml

This file was deleted.

0 comments on commit 609dbb2

Please sign in to comment.