Added .dockerignore

Launching puppet by hand and not using the zulip-puppet-apply script
This should hopefully do the trick
This commit is contained in:
Alexander Trost
2015-10-05 20:48:57 +02:00
parent 38ed8c83f4
commit d63f28628a
5 changed files with 15 additions and 50 deletions

7
.dockerignore Normal file
View File

@@ -0,0 +1,7 @@
.git
.gitignore
includes/zulip-puppet-config
AUTHORS
LICENSE
README
README.md

View File

@@ -8,11 +8,9 @@ ENV ZULIP_GROUP="zulip" ZULIP_USER="zulip" ZULIP_DIR="/home/zulip" \
ADD entrypoint.sh /entrypoint.sh
ADD includes/zulip /root/zulip-puppet
ADD includes/zulip-puppet-apply /root/zulip-puppet-apply
# TODO: Change this to the docker build repo including all required files
# zulip.conf file is also located in includes folder
# Orig zulip-puppet-apply path /root/zulip/scripts/zulip-puppet-apply
RUN chmod 755 /entrypoint.sh /root/zulip-puppet-apply && \
RUN chmod 755 /entrypoint.sh && \
groupadd -r "zulip" && \
useradd -r -g "zulip" -d "/home/zulip" "zulip" && \
apt-get -qq update -q && \
@@ -33,8 +31,7 @@ RUN chmod 755 /entrypoint.sh /root/zulip-puppet-apply && \
rm -rf /root/zulip/puppet/zulip_internal /root/zulip/puppet/zulip && \
mv -f /root/zulip-puppet /root/zulip/puppet/zulip && \
ls -ahl /root/zulip/puppet /root/zulip/puppet/zulip /root && \
/root/zulip-puppet-apply -f && \
/root/zulip/scripts/setup/generate_secrets.py && \
puppet apply --modulepath=/root/zulip/puppet -e "Exec { path => \"/usr/sbin:/usr/bin:/sbin:/bin\" }\ninclude apt\ninclude zulip::voyager" && \
cp -a /root/zulip/zproject/local_settings_template.py /etc/zulip/settings.py && \
ln -nsf /etc/zulip/settings.py /root/zulip/zproject/local_settings.py && \
ZULIP_DEPLOY_PATH=$(/root/zulip/zulip_tools.py make_deploy_path) && \

View File

@@ -39,6 +39,7 @@ function initialize-database(){
if [ ! -f "$ZULIP_DIR/.initiated" ]; then
echo "Initiating Zulip ..."
/root/zulip/scripts/setup/generate_secrets.py
# Init Postgres database server
postgres-init-db

View File

@@ -1,45 +0,0 @@
#!/usr/bin/python
import sys
import subprocess
import ConfigParser
import re
force = False
extra_args = sys.argv[1:]
if len(extra_args) and extra_args[0] in ('-f', '--force'):
force = True
extra_args = extra_args[1:]
config = ConfigParser.RawConfigParser()
config.read("/etc/zulip/zulip.conf")
puppet_config = """
Exec { path => "/usr/sbin:/usr/bin:/sbin:/bin" }
include apt
"""
for pclass in re.split(r'\s*,\s*', config.get('machine', 'puppet_classes')):
puppet_config += "include %s\n" % (pclass,)
print puppet_config
puppet_cmd = ["puppet", "apply", "--modulepath=/root/zulip/puppet", "-e", puppet_config]
puppet_cmd += extra_args
if force:
subprocess.check_call(puppet_cmd)
sys.exit(0)
subprocess.check_call(puppet_cmd + ['--noop', '--show_diff'])
do_apply = None
while not (do_apply == 'y' or do_apply == 'n'):
sys.stdout.write("Apply changes? [y/N] ")
do_apply = sys.stdin.readline().strip().lower()
if do_apply == '':
do_apply = 'n'
if do_apply == 'y':
subprocess.check_call(puppet_cmd)

View File

@@ -0,0 +1,5 @@
# This is the string generated in the zulip-puppet-apply script
# It is here for documentation purpose, it isn't used in the Dockerfile
Exec { path => "/usr/sbin:/usr/bin:/sbin:/bin" }
include apt
include zulip::voyager