diff --git a/precise/pypi-cacher/etc/devpi-server/devpi-server-log.yml b/precise/pypi-cacher/etc/devpi-server/devpi-server-log.yml new file mode 100644 index 00000000..eee73fa0 --- /dev/null +++ b/precise/pypi-cacher/etc/devpi-server/devpi-server-log.yml @@ -0,0 +1,21 @@ +version: 1 +formatters: + simpleFormater: + format: '%(asctime)s - %(levelname)s: %(message)s' + datefmt: '%Y/%m/%d %H:%M:%S' + +handlers: + file: + class : logging.FileHandler + formatter: simpleFormater + level: WARNING + filename: /var/log/devpi-server/main.log + +loggers: + flogger: + level: WARNING + handlers: [file] + +root: + level: DEBUG + handlers: [file] diff --git a/precise/pypi-cacher/etc/devpi-server/devpi-server.service b/precise/pypi-cacher/etc/devpi-server/devpi-server.service new file mode 100644 index 00000000..0cd2ce29 --- /dev/null +++ b/precise/pypi-cacher/etc/devpi-server/devpi-server.service @@ -0,0 +1,17 @@ +[Unit] +Description=DevPi Server +After=network-online.target +Requires=network-online.target + +[Service] +TimeoutStartSec=0 +Type=forking +#PIDFile=/var/run/devpi-server.pid +Restart=always +ExecStart=/usr/local/bin/devpi-server --host 0.0.0.0 --port 3142 --serverdir=/var/lib/devpi-server --logger-cfg=/etc/devpi-server/devpi-server-log.yml --start +ExecStop=/usr/local/bin/devpi-server --host 0.0.0.0 --port 3142 --serverdir=/var/lib/devpi-server --logger-cfg=/etc/devpi-server/devpi-server-log.yml --stop +#User=devpi + +[Install] +WantedBy=multi-user.target + diff --git a/precise/pypi-cacher/hooks/install b/precise/pypi-cacher/hooks/install new file mode 100755 index 00000000..364e6f1e --- /dev/null +++ b/precise/pypi-cacher/hooks/install @@ -0,0 +1,37 @@ +#!/bin/bash + +set -eux + +apt-get install -y --force-yes python-pip + +pip install devpi-server + +# cat <> /etc/init/devpi-server.conf + +# # this script will start/stop DevPI Server +# description "DevPI server" +# version "1.0" +# author "Valentin Lab" + +# chdir /root +# exec devpi-server --start --host 0.0.0.0 --port 3142 + +# EOF + +cp -a etc/devpi-server/* /etc/devpi-server + +mkdir /var/{lib,log}/devpi-server -p + +systemctl enable /etc/devpi-server/devpi-server.service + + +## This is needed to enable https_port +#apt-get install devscripts build-essential +#apt-get install libssl-dev ## not in build-dep ... because we'll add it. +#apt-get source squid3 +#apt-get build-dep squid3 +#cd squid3-3.1.19 +#vim debian/rules # or whatever editor you use +# add --enable-ssl +#debuild -us -uc + diff --git a/precise/pypi-cacher/hooks/start b/precise/pypi-cacher/hooks/start new file mode 100755 index 00000000..88e357a2 --- /dev/null +++ b/precise/pypi-cacher/hooks/start @@ -0,0 +1,7 @@ +#!/bin/bash + +## XXX: will need to add route: + +route add -net VPN_NET gw LXC_NAME + +juju-log "Nothing to Start for base." diff --git a/precise/pypi-cacher/hooks/stop b/precise/pypi-cacher/hooks/stop new file mode 100755 index 00000000..170162bd --- /dev/null +++ b/precise/pypi-cacher/hooks/stop @@ -0,0 +1,3 @@ +#!/bin/bash + +juju-log "Nothing to stop for base." diff --git a/precise/pypi-cacher/metadata.yaml b/precise/pypi-cacher/metadata.yaml new file mode 100644 index 00000000..4f3d8fca --- /dev/null +++ b/precise/pypi-cacher/metadata.yaml @@ -0,0 +1,15 @@ +name: pypi-cacher +summary: "PyPI Caching Server" +maintainer: "Valentin Lab " +inherit: base-0k +description: | + PyPI Caching Server +data-resources: + - /var/lib/devpi-server + - /var/log/devpi-server +config-resources: + - /etc/devpi-server +docker: + entrypoimt: '["/usr/local/bin/devpi-server", "--host=0.0.0.0", "--port=3142", "--start"]' + expose: 3142 + diff --git a/precise/pypi-cacher/revision b/precise/pypi-cacher/revision new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/precise/pypi-cacher/revision @@ -0,0 +1 @@ +0