Browse Source

new: [pypi-cacher] added pypi cacher.

postgres
Valentin Lab 10 years ago
parent
commit
9b61b0d8f7
  1. 21
      precise/pypi-cacher/etc/devpi-server/devpi-server-log.yml
  2. 17
      precise/pypi-cacher/etc/devpi-server/devpi-server.service
  3. 37
      precise/pypi-cacher/hooks/install
  4. 7
      precise/pypi-cacher/hooks/start
  5. 3
      precise/pypi-cacher/hooks/stop
  6. 15
      precise/pypi-cacher/metadata.yaml
  7. 1
      precise/pypi-cacher/revision

21
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]

17
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

37
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 <<EOF >> /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

7
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."

3
precise/pypi-cacher/hooks/stop

@ -0,0 +1,3 @@
#!/bin/bash
juju-log "Nothing to stop for base."

15
precise/pypi-cacher/metadata.yaml

@ -0,0 +1,15 @@
name: pypi-cacher
summary: "PyPI Caching Server"
maintainer: "Valentin Lab <valentin.lab@kalysto.org>"
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

1
precise/pypi-cacher/revision

@ -0,0 +1 @@
0
Loading…
Cancel
Save