mirror of
https://github.com/zulip/docker-zulip.git
synced 2025-11-06 15:03:14 +00:00
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:
7
.dockerignore
Normal file
7
.dockerignore
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
includes/zulip-puppet-config
|
||||||
|
AUTHORS
|
||||||
|
LICENSE
|
||||||
|
README
|
||||||
|
README.md
|
||||||
@@ -8,11 +8,9 @@ ENV ZULIP_GROUP="zulip" ZULIP_USER="zulip" ZULIP_DIR="/home/zulip" \
|
|||||||
|
|
||||||
ADD entrypoint.sh /entrypoint.sh
|
ADD entrypoint.sh /entrypoint.sh
|
||||||
ADD includes/zulip /root/zulip-puppet
|
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
|
# TODO: Change this to the docker build repo including all required files
|
||||||
# zulip.conf file is also located in includes folder
|
# 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 && \
|
||||||
RUN chmod 755 /entrypoint.sh /root/zulip-puppet-apply && \
|
|
||||||
groupadd -r "zulip" && \
|
groupadd -r "zulip" && \
|
||||||
useradd -r -g "zulip" -d "/home/zulip" "zulip" && \
|
useradd -r -g "zulip" -d "/home/zulip" "zulip" && \
|
||||||
apt-get -qq update -q && \
|
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 && \
|
rm -rf /root/zulip/puppet/zulip_internal /root/zulip/puppet/zulip && \
|
||||||
mv -f /root/zulip-puppet /root/zulip/puppet/zulip && \
|
mv -f /root/zulip-puppet /root/zulip/puppet/zulip && \
|
||||||
ls -ahl /root/zulip/puppet /root/zulip/puppet/zulip /root && \
|
ls -ahl /root/zulip/puppet /root/zulip/puppet/zulip /root && \
|
||||||
/root/zulip-puppet-apply -f && \
|
puppet apply --modulepath=/root/zulip/puppet -e "Exec { path => \"/usr/sbin:/usr/bin:/sbin:/bin\" }\ninclude apt\ninclude zulip::voyager" && \
|
||||||
/root/zulip/scripts/setup/generate_secrets.py && \
|
|
||||||
cp -a /root/zulip/zproject/local_settings_template.py /etc/zulip/settings.py && \
|
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 && \
|
ln -nsf /etc/zulip/settings.py /root/zulip/zproject/local_settings.py && \
|
||||||
ZULIP_DEPLOY_PATH=$(/root/zulip/zulip_tools.py make_deploy_path) && \
|
ZULIP_DEPLOY_PATH=$(/root/zulip/zulip_tools.py make_deploy_path) && \
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ function initialize-database(){
|
|||||||
|
|
||||||
if [ ! -f "$ZULIP_DIR/.initiated" ]; then
|
if [ ! -f "$ZULIP_DIR/.initiated" ]; then
|
||||||
echo "Initiating Zulip ..."
|
echo "Initiating Zulip ..."
|
||||||
|
/root/zulip/scripts/setup/generate_secrets.py
|
||||||
# Init Postgres database server
|
# Init Postgres database server
|
||||||
postgres-init-db
|
postgres-init-db
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
|
||||||
5
includes/zulip-puppet-config
Normal file
5
includes/zulip-puppet-config
Normal 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
|
||||||
Reference in New Issue
Block a user