Affected files (+44, -26 lines):
M .lbox
M HACKING.md
M Makefile
M README.md
A [revision details]
M hooks/install
M revision
M tests/deploy.py
M tests/example.py
M tests/test_deploy.py
Index: HACKING.md
=== modified file 'HACKING.md'
--- HACKING.md 2014-04-15 14:17:12 +0000
+++ HACKING.md 2014-04-22 10:28:39 +0000
@@ -30,7 +30,7 @@
The command above will run as root and install the required deb packages.
The second one is just running "make deploy":
@@ -127,10 +127,10 @@
created, the testing virtualenv.
The `make deploy` command also supports specifying the OS version used to
-deploy the local charm. By default a precise machine is created, but you
can
-run the following to deploy the charm on trusty:
+deploy the local charm. By default a trusty machine is created, but you can
+run the following to deploy the charm on precise:
- make deploy SERIES=trusty
+ make deploy SERIES=precise
Now you are working with a test run, as described in
<https://juju.ubuntu.com/docs/write-charm.html#test-run>. The
@@ -166,6 +166,17 @@
All of this is described in more detail on the Juju site: this is an
introduction to the process.
+## Making charm releases ##
+
+The same code base is used for both precise and trusty releases.
+Releasing the charm is done by pushing changes from the development branch
to
+the precise and trusty release branches.
+The branches live in the following locations:
+
+- development branch: `lp:~juju-gui/charms/trusty/juju-gui/trunk`
+- precise release: `lp:charms/juju-gui`
+- trusty release: `lp:charms/trusty/juju-gui`
+
## Upgrading the local releases repository ##
The charm, in the default juju-gui-source configuration ("local"), deploys
the
Index: Makefile
=== modified file 'Makefile'
--- Makefile 2014-04-15 12:52:27 +0000
+++ Makefile 2014-04-22 09:27:01 +0000
@@ -84,7 +84,8 @@
@echo ' expose the Juju GUI charm setting up a temporary Juju
repository.'
@echo ' Wait for the service to be started. If JUJU_ENV is not passed,'
@echo ' the charm will be deployed in the default Juju environment.'
- @echo ' If SERIES is not passed, "precise" is used.'
+ @echo ' If SERIES is not passed, "trusty" is used. Possible values are'
+ @echo ' "precise" and "trusty".'
.PHONY: all clean deploy ensure-juju-env ensure-juju-test ftest help \
jujutest lint setup sysdeps test unittest
-# Python dependencies must be installed here so that the charm can import
and
-# use required libraries.
PYTHON_DEPENDENCIES = (
'libapt-pkg-dev', 'python-apt', 'python-launchpadlib', 'python-tempita',
'python-yaml'
)
+
+# Update the list of dependencies to ensure sources are not stale.
+run('juju-log', '--', 'Updating APT sources.')
+run('apt-get', 'update')
+# Python dependencies must be installed here so that the charm can import
and
+# use required libraries.
run('juju-log', '--', 'Installing base Python dependencies: {}.'.format(
', '.join(PYTHON_DEPENDENCIES)))
apt_get_install(*PYTHON_DEPENDENCIES)
-def setup_repository(name, source, series='precise'):
+def setup_repository(name, source, series='trusty'):
"""Create a temporary Juju repository to use for charm deployment.
- Copy the charm files in source in the precise repository section,
using the
- provided charm name and excluding the virtualenv and Git directories.
+ Copy the charm files in source in the repository section corresponding
to
+ the given series, using the provided charm name and excluding the
+ virtualenv and Git directories.
Return the repository path.
"""
@@ -67,7 +68,7 @@
If force_machine is not None, create the unit in the specified machine.
If charm_source is None, dynamically retrieve the charm source
directory.
If series is None, the series specified in the SERIES environment
variable
- is used if found, defaulting to "precise".
+ is used if found, defaulting to "trusty".
"""
# Note: this function is used by both the functional tests and
# "make deploy": see the "if main" section below.
@@ -75,7 +76,7 @@
# Dynamically retrieve the charm source based on the path of this
file. charm_source = os.path.join(os.path.dirname(__file__), '..')
if series is None:
- series = os.getenv('SERIES', '').strip() or 'precise'
+ series = os.getenv('SERIES', '').strip() or 'trusty'
logging.debug('setting up the charms repository')
repo = setup_repository(charm_name, charm_source, series=series)
args = ['deploy', '--repository', repo]
Reviewers: mp+216695_ code.launchpad. net,
Message:
Please take a look.
Description:
Use trusty as default target series.
Switched to lp:~juju-gui/charms/trusty/juju-gui/trunk
(I'll send an email after this branch is landed).
Change "make deploy" to install the trusty charm by default.
Also run "apt-get update" at the beginning of the install hook.
Tests: `make unittest`.
https:/ /code.launchpad .net/~frankban/ charms/ precise/ juju-gui/ trusty- defaults/ +merge/ 216695
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/90220043/
Affected files (+44, -26 lines): deploy. py
M .lbox
M HACKING.md
M Makefile
M README.md
A [revision details]
M hooks/install
M revision
M tests/deploy.py
M tests/example.py
M tests/test_
Index: .lbox
=== modified file '.lbox'
--- .lbox 2013-06-04 16:52:52 +0000
+++ .lbox 2014-04-22 09:27:01 +0000
@@ -1,1 +1,1 @@
-propose -cr -for lp:~juju-gui/charms/precise/juju-gui/trunk
+propose -cr -for lp:~juju-gui/charms/trusty/juju-gui/trunk
Index: HACKING.md
=== modified file 'HACKING.md'
--- HACKING.md 2014-04-15 14:17:12 +0000
+++ HACKING.md 2014-04-22 10:28:39 +0000
@@ -30,7 +30,7 @@
The command above will run as root and install the required deb packages.
Next, you need the bzr branch. We work from /code.launchpad .net/~juju- gui/charms/ precise/ juju-gui/ trunk). /code.launchpad .net/~juju- gui/charms/ trusty/ juju-gui/ trunk).
-[lp:~juju-gui/charms/precise/juju-gui/trunk](https:/
+[lp:~juju-gui/charms/trusty/juju-gui/trunk](https:/
You could start hacking now, but there's a bit more to do to prepare for
running and writing tests.
@@ -112,7 +112,7 @@
make clean /path/to/ charm/repo local:precise/ juju-gui /path/to/ charm/repo local:trusty/ juju-gui
juju bootstrap
- juju deploy --repository=
+ juju deploy --repository=
juju expose juju-gui
The second one is just running "make deploy":
@@ -127,10 +127,10 @@
created, the testing virtualenv.
The `make deploy` command also supports specifying the OS version used to
-deploy the local charm. By default a precise machine is created, but you
can
-run the following to deploy the charm on trusty:
+deploy the local charm. By default a trusty machine is created, but you can
+run the following to deploy the charm on precise:
- make deploy SERIES=trusty
+ make deploy SERIES=precise
Now you are working with a test run, as described in /juju.ubuntu. com/docs/ write-charm. html#test- run>. The
<https:/
@@ -166,6 +166,17 @@
All of this is described in more detail on the Juju site: this is an
introduction to the process.
+## Making charm releases ##
+
+The same code base is used for both precise and trusty releases.
+Releasing the charm is done by pushing changes from the development branch
to
+the precise and trusty release branches.
+The branches live in the following locations:
+
+- development branch: `lp:~juju-gui/charms/trusty/juju-gui/trunk`
+- precise release: `lp:charms/juju-gui`
+- trusty release: `lp:charms/trusty/juju-gui`
+
## Upgrading the local releases repository ##
The charm, in the default juju-gui-source configuration ("local"), deploys
the
Index: Makefile
=== modified file 'Makefile'
--- Makefile 2014-04-15 12:52:27 +0000
+++ Makefile 2014-04-22 09:27:01 +0000
@@ -84,7 +84,8 @@
@echo ' expose the Juju GUI charm setting up a temporary Juju
repository.'
@echo ' Wait for the service to be started. If JUJU_ENV is not passed,'
@echo ' the charm will be deployed in the default Juju environment.'
- @echo ' If SERIES is not passed, "precise" is used.'
+ @echo ' If SERIES is not passed, "trusty" is used. Possible values are'
+ @echo ' "precise" and "trusty".'
.PHONY: all clean deploy ensure-juju-env ensure-juju-test ftest help \
jujutest lint setup sysdeps test unittest
Index: README.md
=== modified file 'README.md'
--- README.md 2014-04-15 14:17:12 +0000
+++ README.md 2014-04-22 09:27:01 +0000
@@ -83,7 +83,7 @@
services: juju-gui- 7 juju-gui- 42
relations: {}
juju-gui:
- charm: cs:precise/
+ charm: cs:trusty/
exposed: true
units:
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision:
<email address hidden>
+New revision:
<email address hidden>
Index: revision
=== modified file 'revision'
--- revision 2014-04-17 09:17:07 +0000
+++ revision 2014-04-22 09:27:33 +0000
@@ -1,1 +1,1 @@
-112
+113
Index: hooks/install
=== modified file 'hooks/install'
--- hooks/install 2014-01-16 19:25:52 +0000
+++ hooks/install 2014-04-22 09:31:49 +0000
@@ -26,13 +26,17 @@
)
-# Python dependencies must be installed here so that the charm can import DEPENDENCIES = ( libapt- pkg-dev' , 'python-apt', 'python- launchpadlib' , 'python-tempita',
and
-# use required libraries.
PYTHON_
'
'python-yaml'
)
+ PYTHON_ DEPENDENCIES) )) install( *PYTHON_ DEPENDENCIES)
+# Update the list of dependencies to ensure sources are not stale.
+run('juju-log', '--', 'Updating APT sources.')
+run('apt-get', 'update')
+# Python dependencies must be installed here so that the charm can import
and
+# use required libraries.
run('juju-log', '--', 'Installing base Python dependencies: {}.'.format(
', '.join(
apt_get_
Index: tests/deploy.py
'-- exclude' , '/tests')
=== modified file 'tests/deploy.py'
--- tests/deploy.py 2014-04-14 17:00:09 +0000
+++ tests/deploy.py 2014-04-22 09:27:01 +0000
@@ -39,11 +39,12 @@
-def setup_repositor y(name, source, series='precise'): y(name, source, series='trusty'):
+def setup_repositor
"""Create a temporary Juju repository to use for charm deployment.
- Copy the charm files in source in the precise repository section,
using the
- provided charm name and excluding the virtualenv and Git directories.
+ Copy the charm files in source in the repository section corresponding
to
+ the given series, using the provided charm name and excluding the
+ virtualenv and Git directories.
Return the repository path.
charm_ source = os.path. join(os. path.dirname( __file_ _), '..') debug(' setting up the charms repository') y(charm_ name, charm_source, series=series)
"""
@@ -67,7 +68,7 @@
If force_machine is not None, create the unit in the specified machine.
If charm_source is None, dynamically retrieve the charm source
directory.
If series is None, the series specified in the SERIES environment
variable
- is used if found, defaulting to "precise".
+ is used if found, defaulting to "trusty".
"""
# Note: this function is used by both the functional tests and
# "make deploy": see the "if main" section below.
@@ -75,7 +76,7 @@
# Dynamically retrieve the charm source based on the path of this
file.
if series is None:
- series = os.getenv('SERIES', '').strip() or 'precise'
+ series = os.getenv('SERIES', '').strip() or 'trusty'
logging.
repo = setup_repositor
args = ['deploy', '--repository', repo]
Index: tests/example.py
=== modified file 'tests/example.py'
--- tests/example.py 2013-11-27 14:37:06 +0000
+++ tests/example.py 2014-04-22 09:27:01 +0000
@@ -19,12 +19,11 @@
BUNDLE1 = """ wordpress- 15" mysql-26"
"binlog- format" : MIXED
"block- size": "5"
bundle1:
- series: precise
+ series: trusty
services:
wordpress:
charm: "cs:precise/
- num_units: 1
- to: '0'
+ num_units: 2
options:
debug: "no"
engine: nginx
@@ -35,8 +34,9 @@
"gui-x": 313
"gui-y": 51
mysql:
- charm: "cs:precise/
- num_units: 2
+ charm: "cs:trusty/mysql-0"
+ num_units: 1
+ to: '0'
options:
@@ -63,7 +63,6 @@
BUNDLE2 = """ mediawiki- 9"
bundle2:
- series: precise
services:
mediawiki:
charm: "cs:precise/
Index: tests/test_ deploy. py test_deploy. py' deploy. py 2014-01-16 19:25:52 +0000 deploy. py 2014-04-22 09:27:01 +0000 (self): y(self. name, self.source) repository( repo, 'precise') repository( repo, 'trusty')
=== modified file 'tests/
--- tests/test_
+++ tests/test_
@@ -90,7 +90,7 @@
def test_repository
# The charm repository is correctly created with the default
series.
repo = setup_repositor
- self.check_
+ self.check_
def test_series(self): y(self. name, self.source)
os.path. basename( self.root_ file)
# The charm repository is created with the given series.
@@ -101,7 +101,7 @@
# The charm files are correctly copied inside the repository,
excluding
# unwanted directories.
repo = setup_repositor
- charm_dir = os.path.join(repo, 'precise', self.name)
+ charm_dir = os.path.join(repo, 'trusty', self.name)
expected = set([
])
@@ -116,14 +116,14 @@
unit_info = {'public-address': 'unit.example.com'} precise/ {}'.format( charm) trusty/ {}'.format( charm)
charm = 'test-charm'
- local_charm = 'local:
+ local_charm = 'local:
@ mock.patch( 'deploy. juju') mock.patch( 'deploy. wait_for_ unit')
service_ name=None, options=None, force_machine=None,
mock_ wait_for_ unit.return_ value = self.unit_info
expected_ source = os.path. join(os. path.dirname( __file_ _), '..')
@
def call_deploy(
self, mock_wait_for_unit, mock_juju,
- charm_source=None, series='precise'):
+ charm_source=None, series='trusty'):
if charm_source is None: