repair rally dockerfile

Add create rally dabase and create rally log script

Closes-Bug: #1618722 

Change-Id: I8a78e518f63c4e9fab753a58fb7e36772380d4ef
This commit is contained in:
zhubingbing 2016-08-31 08:00:35 +00:00
parent 1e222274e1
commit 62781f4550
2 changed files with 21 additions and 2 deletions

View File

@ -17,12 +17,16 @@ RUN useradd --user-group rally
ADD rally-archive /rally-source
RUN ln -s rally-source/* rally \
&& useradd --user-group rally \
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /rally \
&& mkdir -p /etc/rally /var/log/rally \
&& useradd --user-group rally
&& mkdir -p /etc/rally /var/log/rally /home/rally \
&& chown -R rally: /etc/rally /var/log/rally /home/rally
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
RUN usermod -a -G kolla rally
{% block rally_footer %}{% endblock %}

View File

@ -0,0 +1,15 @@
#!/bin/bash
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
rally-manage db recreate
exit 0
fi
if [[ ! -d "/var/log/kolla/rally" ]]; then
mkdir -p /var/log/kolla/rally
fi
if [[ $(stat -c %a /var/log/kolla/rally) != "755" ]]; then
chmod 755 /var/log/kolla/rally
fi