Merge lp:~barryprice/juju-deployer/lp1893162 into lp:juju-deployer

Proposed by Barry Price
Status: Merged
Approved by: Tom Haddon
Approved revision: 227
Merged at revision: 222
Proposed branch: lp:~barryprice/juju-deployer/lp1893162
Merge into: lp:juju-deployer
Diff against target: 94 lines (+59/-0)
4 files modified
Makefile (+9/-0)
README (+11/-0)
suggest_install_deps.sh (+13/-0)
suggest_install_test_deps.sh (+26/-0)
To merge this branch: bzr merge lp:~barryprice/juju-deployer/lp1893162
Reviewer Review Type Date Requested Status
Tom Haddon Approve
Canonical IS Reviewers Pending
Review via email: mp+393172@code.launchpad.net

Commit message

Document dependencies (LP:1893162)

To post a comment you must log in.
223. By Barry Price

Clean up

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

224. By Barry Price

Move deps logic to separate shell scripts

225. By Barry Price

Bugfix

226. By Barry Price

shellcheck

Revision history for this message
Tom Haddon (mthaddon) wrote :

I think it'd be worth changing the names of the scripts to reflect that they prompt you to install dependencies (which I think is the right thing to do - I don't think we should actually be installing dependencies here). Currently ./install_deps.sh to me suggests they're installing things, so maybe ./suggest_install_deps.sh and ./suggest_install_test_deps.sh or something like that?

227. By Barry Price

More accurate helper script names

Revision history for this message
Tom Haddon (mthaddon) wrote :

LGTM, thx

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 222

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile'
--- Makefile 2017-03-01 10:04:15 +0000
+++ Makefile 2021-02-05 09:33:39 +0000
@@ -9,6 +9,13 @@
9 toxcmd = tox9 toxcmd = tox
10endif10endif
1111
12deps:
13 @./suggest_install_deps.sh
14
15test-deps: deps
16 @./suggest_install_test_deps.sh
17
18
12test:19test:
13 # launchpad build farm target20 # launchpad build farm target
14 TEST_OFFLINE=1 JUJU_HOME=/tmp nosetests -s --verbosity=2 --with-coverage --cover-package=deployer deployer/tests21 TEST_OFFLINE=1 JUJU_HOME=/tmp nosetests -s --verbosity=2 --with-coverage --cover-package=deployer deployer/tests
@@ -17,3 +24,5 @@
17local_test:24local_test:
18 # local test target25 # local test target
19 $(toxcmd)26 $(toxcmd)
27
28.PHONY: deps test-deps test local_test
2029
=== modified file 'README'
--- README 2015-03-16 23:53:59 +0000
+++ README 2021-02-05 09:33:39 +0000
@@ -13,6 +13,17 @@
13 $ ./deployer/bin/easy_install juju-deployer13 $ ./deployer/bin/easy_install juju-deployer
14 $ ./deployer/bin/juju-deployer -h14 $ ./deployer/bin/juju-deployer -h
1515
16Requirements
17------------
18
19juju-deployer requires 'juju' itself to be installed:
20
21https://juju.is/docs/installing
22
23Development of juju-deployer will also require the 'bzr', 'make' and 'tox'
24packages to be installed:
25
26 $ apt-get install bzr make tox
1627
17Usage28Usage
18-----29-----
1930
=== added file 'suggest_install_deps.sh'
--- suggest_install_deps.sh 1970-01-01 00:00:00 +0000
+++ suggest_install_deps.sh 2021-02-05 09:33:39 +0000
@@ -0,0 +1,13 @@
1#!/bin/bash
2
3set -eu
4
5if [ -x "$(command -v juju)" ]; then
6 :
7else
8 if [ -x "$(command -v snap)" ]; then
9 echo "Please run: sudo snap install juju --classic"
10 else
11 echo "Please install Juju <https://juju.is/docs/installing>"
12 fi
13fi
014
=== added file 'suggest_install_test_deps.sh'
--- suggest_install_test_deps.sh 1970-01-01 00:00:00 +0000
+++ suggest_install_test_deps.sh 2021-02-05 09:33:39 +0000
@@ -0,0 +1,26 @@
1#!/bin/bash
2
3set -eu
4
5PKG_DEPS="make tox"
6
7RELEASE=$(lsb_release -r | cut -f 2)
8
9if (( $(echo "$RELEASE >= 20.04" |bc -l) )); then
10 PKG_DEPS="$PKG_DEPS brz"
11elif [ "$RELEASE" == "18.04" ]; then
12 PKG_DEPS="$PKG_DEPS brz"
13else
14 PKG_DEPS="$PKG_DEPS bzr"
15fi
16
17PKGS_TO_INSTALL=""
18
19for PKG_DEP in $PKG_DEPS;
20do
21 command -v "${PKG_DEP?}" >/dev/null || PKGS_TO_INSTALL="$TO_INSTALL $PKG_DEP"
22done
23
24if [ "$PKGS_TO_INSTALL" != "" ]; then
25 echo "Please run: sudo apt-get install $PKGS_TO_INSTALL"
26fi

Subscribers

People subscribed via source and target branches