Exemplo n.º 1
0
    def configure(self):
        self.provide('zopecommon', self)
        self.common = self.require_one('common', host=self.host)
        self.zope_instances = self.require('zope:http')
        self.zope_instances.sort(key=lambda s: s.script_id)
        self.backupsdir = self.backupsdir or self.expand(
            '{{component.workdir}}/var/backup')

        config = File('buildout.cfg',
                      source='buildout.cfg',
                      template_context=self)
        buildout_general = File('buildout_general.cfg',
                                source='buildout_general.cfg',
                                template_context=self)
        additional_config = [
            buildout_general,
            Directory('profiles', source='profiles')
        ]

        self += Buildout(python='3.8',
                         version=self.common.zc_buildout,
                         setuptools=self.common.setuptools,
                         config=config,
                         additional_config=additional_config)

        self += InstallPythonPackages()

        # some ElasticSearch, Celery configuration
        self += File('elasticsearch-mappings.json',
                     source='elasticsearch-mappings.json')
        self += File('elasticsearch-preprocessings.json',
                     source='elasticsearch-preprocessings.json')
        self += File('.env', source='_env', template_context=self)
Exemplo n.º 2
0
 def configure(self):
     self.programs = self.require('programs', self.host)
     self += Buildout('supervisor',
                      version='2.2',
                      setuptools='0.9.8',
                      python='2.7')
     self += Service('bin/supervisord', pidfile='var/supervisord.pid')
Exemplo n.º 3
0
 def configure(self):
     self.programs = self.require("programs", self.host)
     self += Buildout("supervisor",
                      version="2.2",
                      setuptools="0.9.8",
                      python="2.7")
     self += Service("bin/supervisord", pidfile="var/supervisord.pid")
Exemplo n.º 4
0
    def configure(self):
        if self.reload_templates is None:
            self.reload_templates = self.debug

        self.address = Address(self.listen_host, self.listen_port)

        self += File('appserver.ini')

        self += Buildout(additional_config=[
            Directory('profiles', source='profiles'),
        ])

        env = [  # (name, value)
        ]
        self += Program(
            'appserver',
            priority=20,
            options=dict(
                startsecs=20,
                environment=','.join('{}={}'.format(name, value)
                                     for name, value in env),
            ),
            command=self.map('bin/pserve'),
            args='appserver.ini',
        )
Exemplo n.º 5
0
    def configure(self):
        self.provide("supervisor", self)

        buildout_cfg = File("buildout.cfg", source=self.buildout_cfg)
        self += Buildout(
            version="2.13.3",
            setuptools="46.1.3",
            config=buildout_cfg,
            python="3",
        )

        self.program_config_dir = Directory("etc/supervisor.d", leading=True)
        self += self.program_config_dir
        self += File("etc/supervisord.conf", source=self.supervisor_conf)
        self.logdir = Directory("var/log", leading=True)
        self += self.logdir

        postrotate = self.expand(
            "kill -USR2 $({{component.workdir}}/bin/supervisorctl pid)")

        if self.logrotate:
            self += RotatedLogfile("var/log/*.log", postrotate=postrotate)

        self += Service("bin/supervisord", pidfile=self.pidfile)
        service = self._

        if self.enable:
            self += RunningSupervisor(service)
        else:
            self += StoppedSupervisor()

        # Nagios check
        if self.nagios:
            self += File(
                "check_supervisor",
                mode=0o755,
                source=os.path.join(
                    os.path.dirname(__file__),
                    "resources",
                    "check_supervisor.py.in",
                ),
            )

            self += ServiceCheck(
                "Supervisor programs",
                nrpe=True,
                contact_groups=self.check_contact_groups,
                command=self.expand("{{component.workdir}}/check_supervisor"),
            )
Exemplo n.º 6
0
    def configure(self):
        self.provide('supervisor', self)

        buildout_cfg = File('buildout.cfg',
                            source=self.buildout_cfg)
        self += Buildout('buildout',
                         version='2.13.3',
                         setuptools='46.1.3',
                         config=buildout_cfg,
                         python='3')

        self.program_config_dir = Directory('etc/supervisor.d', leading=True)
        self += self.program_config_dir
        self += File('etc/supervisord.conf',
                     source=self.supervisor_conf)
        self.logdir = Directory('var/log', leading=True)
        self += self.logdir

        postrotate = self.expand(
            'kill -USR2 $({{component.workdir}}/bin/supervisorctl pid)')

        if self.logrotate:
            self += RotatedLogfile('var/log/*.log', postrotate=postrotate)

        self += Service('bin/supervisord', pidfile=self.pidfile)
        service = self._

        if self.enable:
            self += RunningSupervisor(service)
        else:
            self += StoppedSupervisor(service)

        # Nagios check
        if self.nagios:
            self += File('check_supervisor',
                         mode=0o755,
                         source=os.path.join(
                             os.path.dirname(__file__),
                             'resources',
                             'check_supervisor.py.in'))

            self += ServiceCheck(
                'Supervisor programs',
                nrpe=True,
                contact_groups=self.check_contact_groups,
                command=self.expand('{{component.workdir}}/check_supervisor'))
Exemplo n.º 7
0
    def configure(self):
        self += Clone('ssh://[email protected]/ctheune/zwicky',
                      target='zwicky',
                      branch='default')

        # XXX hack, hack, hack
        w = self.workdir
        self.workdir += '/zwicky'
        self += Buildout(python='2.7',
                         version='2.3.1',
                         setuptools='12.0.5')
        self.workdir = w

        self += Program(
            'app',
            priority=20,
            options=dict(startsecs=10),
            command='zwicky/bin/web')
Exemplo n.º 8
0
 def configure(self):
     self += File("test", content="asdf {{component.address.listen}}")
     self += Buildout(version="2.3.1", python="2.7", setuptools="17.1")
Exemplo n.º 9
0
 def configure(self):
     buildout = Buildout(python='3.5', setuptools='18.3.1', version='2.4.3')
     self += buildout
Exemplo n.º 10
0
 def configure(self):
     self += File('test', content='asdf {{component.address.listen}}')
     self += Buildout(version='2.3.1',
                      python='2.7',
                      setuptools='17.1')
Exemplo n.º 11
0
 def configure(self):
     buildout = Buildout(
         python='3.3',
         setuptools='1.4.1',
         version='2.2.1')
     self += buildout
Exemplo n.º 12
0
 def configure(self):
     buildout = Buildout(python="3.5", setuptools="18.3.1", version="2.4.3")
     self += buildout
Exemplo n.º 13
0
 def configure(self):
     buildout = Buildout(python="2.7", setuptools="1.4.1", version="2.2.1")
     self += buildout