diff --git a/etc/bash_completion.d/juju-2 b/etc/bash_completion.d/juju similarity index 100% rename from etc/bash_completion.d/juju-2 rename to etc/bash_completion.d/juju diff --git a/etc/bash_completion.d/juju-version b/etc/bash_completion.d/juju-version index 894f50fd324..904ceae06fe 100644 --- a/etc/bash_completion.d/juju-version +++ b/etc/bash_completion.d/juju-version @@ -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 $? ;; diff --git a/snap/hooks/configure b/snap/hooks/configure new file mode 100755 index 00000000000..de9495ad8a8 --- /dev/null +++ b/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 </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 diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 00000000000..0b4614765da --- /dev/null +++ b/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/. diff --git a/snap/wrappers/juju b/snap/wrappers/juju new file mode 100644 index 00000000000..27ab2d71932 --- /dev/null +++ b/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 "$@" diff --git a/snapcraft.yaml b/snapcraft.yaml deleted file mode 100644 index 20e57de11cf..00000000000 --- a/snapcraft.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: juju -version: 2.1-rc1 -summary: juju client -description: Through the use of charms, juju provides you with shareable, re-usable, and repeatable expressions of devops best practices. -confinement: devmode - -apps: - juju: - command: bin/juju - plugs: [network, network-bind, home] - -parts: - juju: - plugin: godeps - go-importpath: github.com/juju/juju - source: https://github.com/juju/juju.git - source-type: git - build-packages: [gcc] - #If you want to grab a specific revision tag, include it here - #source-tag: juju-2.0.0 - snap: - - -bin/filetoconst - - -bin/winuserdata - #If you are releasing a build with public streams, also remove the agent - #- -bin/jujud