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
1=== modified file 'Makefile'
2--- Makefile 2017-03-01 10:04:15 +0000
3+++ Makefile 2021-02-05 09:33:39 +0000
4@@ -9,6 +9,13 @@
5 toxcmd = tox
6 endif
7
8+deps:
9+ @./suggest_install_deps.sh
10+
11+test-deps: deps
12+ @./suggest_install_test_deps.sh
13+
14+
15 test:
16 # launchpad build farm target
17 TEST_OFFLINE=1 JUJU_HOME=/tmp nosetests -s --verbosity=2 --with-coverage --cover-package=deployer deployer/tests
18@@ -17,3 +24,5 @@
19 local_test:
20 # local test target
21 $(toxcmd)
22+
23+.PHONY: deps test-deps test local_test
24
25=== modified file 'README'
26--- README 2015-03-16 23:53:59 +0000
27+++ README 2021-02-05 09:33:39 +0000
28@@ -13,6 +13,17 @@
29 $ ./deployer/bin/easy_install juju-deployer
30 $ ./deployer/bin/juju-deployer -h
31
32+Requirements
33+------------
34+
35+juju-deployer requires 'juju' itself to be installed:
36+
37+https://juju.is/docs/installing
38+
39+Development of juju-deployer will also require the 'bzr', 'make' and 'tox'
40+packages to be installed:
41+
42+ $ apt-get install bzr make tox
43
44 Usage
45 -----
46
47=== added file 'suggest_install_deps.sh'
48--- suggest_install_deps.sh 1970-01-01 00:00:00 +0000
49+++ suggest_install_deps.sh 2021-02-05 09:33:39 +0000
50@@ -0,0 +1,13 @@
51+#!/bin/bash
52+
53+set -eu
54+
55+if [ -x "$(command -v juju)" ]; then
56+ :
57+else
58+ if [ -x "$(command -v snap)" ]; then
59+ echo "Please run: sudo snap install juju --classic"
60+ else
61+ echo "Please install Juju <https://juju.is/docs/installing>"
62+ fi
63+fi
64
65=== added file 'suggest_install_test_deps.sh'
66--- suggest_install_test_deps.sh 1970-01-01 00:00:00 +0000
67+++ suggest_install_test_deps.sh 2021-02-05 09:33:39 +0000
68@@ -0,0 +1,26 @@
69+#!/bin/bash
70+
71+set -eu
72+
73+PKG_DEPS="make tox"
74+
75+RELEASE=$(lsb_release -r | cut -f 2)
76+
77+if (( $(echo "$RELEASE >= 20.04" |bc -l) )); then
78+ PKG_DEPS="$PKG_DEPS brz"
79+elif [ "$RELEASE" == "18.04" ]; then
80+ PKG_DEPS="$PKG_DEPS brz"
81+else
82+ PKG_DEPS="$PKG_DEPS bzr"
83+fi
84+
85+PKGS_TO_INSTALL=""
86+
87+for PKG_DEP in $PKG_DEPS;
88+do
89+ command -v "${PKG_DEP?}" >/dev/null || PKGS_TO_INSTALL="$TO_INSTALL $PKG_DEP"
90+done
91+
92+if [ "$PKGS_TO_INSTALL" != "" ]; then
93+ echo "Please run: sudo apt-get install $PKGS_TO_INSTALL"
94+fi

Subscribers

People subscribed via source and target branches