Ensure git is installed for all reactive openstack charms

This is due to bug 1767328, which is due to setuptools_scm using
the 'git' command to find the version number when charms.openstack
is installed (via the wheelhouse.txt) from git+https://...

This only happens on trusty as xenial+ already have git installed.
The script only tries to install git once and then uses a local
flag file to stop it trying thereafter on every hook.

Change-Id: I8a7daa0fff3d5bc7b11f70cde246975987c7cb66
Closes-Bug: #1767328
This commit is contained in:
Alex Kavanagh 2018-05-10 12:36:36 +01:00
parent 9ce9db2466
commit ff5f2d22ed
1 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,10 @@
#!/bin/bash
# Ensure that git is installed for trusty due to bug: 1767328
# This can be removed when trusty support is dropped.
# Note we can't test the env JUJU_HOOK_NAME var as it isn't set for this script
# so this ensures that we only actually do it once.
if [[ ! -f "./.is-git-installed" ]]; then
juju-log -l 'DEBUG' "Running the apt-get install command as .is-git-installed not set"
apt-get install -y git
touch ./.is-git-installed
fi