grim/containers/reviewboard

740900c1657d
Parents 69cc3f5b8ffa
Children 213fa05b31d4
Remove all the stuff from the old version of the image
  • +2 -2
    README.md
  • +0 -7
    shell.sh
  • +0 -70
    start.sh
  • +0 -26
    upgrade-site.py
  • +0 -16
    uwsgi.ini
  • --- a/README.md Tue Jun 14 21:32:42 2022 -0500
    +++ b/README.md Tue Jun 14 21:32:53 2022 -0500
    @@ -1,7 +1,7 @@
    # rwgrim/reviewboard
    -This container image was originally based on docker.io/ikatson/reviewboard.
    -It is now a fork so that it can be updated going forward.
    +This container image was originally based on docker.io/ikatson/reviewboard,
    +but is now based on the upstream image beanbag/reviewboard.
    It adds a few additional plugins to reviewboard, namely rbjbhub and is deployed
    on [reviews.imfreedom.org](https://reviews.imfreedom.org).
    --- a/shell.sh Tue Jun 14 21:32:42 2022 -0500
    +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
    @@ -1,7 +0,0 @@
    -#!/bin/bash
    -
    -cd /var/www/reviewboard/conf
    -
    -export PYTHONPATH=./
    -export DJANGO_SETTINGS_MODULE=reviewboard.settings
    -exec django-admin.py shell
    --- a/start.sh Tue Jun 14 21:32:42 2022 -0500
    +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
    @@ -1,70 +0,0 @@
    -#!/bin/bash
    -PGUSER="${PGUSER:-reviewboard}"
    -PGPASSWORD="${PGPASSWORD:-reviewboard}"
    -PGDB="${PGDB:-reviewboard}"
    -
    -# Get these variables either from PGPORT and PGHOST, or from
    -# linked "pg" container.
    -PGPORT="${PGPORT:-$( echo "${PG_PORT_5432_TCP_PORT:-5432}" )}"
    -PGHOST="${PGHOST:-$( echo "${PG_PORT_5432_TCP_ADDR:-127.0.0.1}" )}"
    -
    -# Get these variable either from MEMCACHED env var, or from
    -# linked "memcached" container.
    -MEMCACHED_LINKED_NOTCP="${MEMCACHED_PORT#tcp://}"
    -MEMCACHED="${MEMCACHED:-$( echo "${MEMCACHED_LINKED_NOTCP:-127.0.0.1}" )}"
    -
    -DOMAIN="${DOMAIN:localhost}"
    -
    -if [[ "${WAIT_FOR_POSTGRES}" = "true" ]]; then
    -
    - echo "Waiting for Postgres readiness..."
    - export PGUSER PGHOST PGPORT PGPASSWORD
    -
    - until psql "${PGDB}"; do
    - echo "Postgres is unavailable - sleeping"
    - sleep 1
    - done
    - echo "Postgres is up!"
    -
    -fi
    -
    -if [[ "${SITE_ROOT}" ]]; then
    - if [[ "${SITE_ROOT}" != "/" ]]; then
    - # Add trailing and leading slashes to SITE_ROOT if it's not there.
    - SITE_ROOT="${SITE_ROOT#/}"
    - SITE_ROOT="/${SITE_ROOT%/}/"
    - fi
    -else
    - SITE_ROOT=/
    -fi
    -
    -mkdir -p /var/www/
    -
    -CONFFILE=/var/www/reviewboard/conf/settings_local.py
    -
    -if [[ ! -d /var/www/reviewboard ]]; then
    - rb-site install --noinput \
    - --domain-name="$DOMAIN" \
    - --site-root="$SITE_ROOT" \
    - --static-url=static/ --media-url=media/ \
    - --db-type=postgresql \
    - --db-name="$PGDB" \
    - --db-host="$PGHOST" \
    - --db-user="$PGUSER" \
    - --db-pass="$PGPASSWORD" \
    - --cache-type=memcached --cache-info="$MEMCACHED" \
    - --web-server-type=lighttpd --web-server-port=8000 \
    - --admin-user=admin --admin-password=admin --admin-email=admin@example.com \
    - /var/www/reviewboard/
    -fi
    -
    -/upgrade-site.py /var/www/reviewboard/rb-version /var/www/reviewboard
    -
    -if [[ "${DEBUG}" ]]; then
    - sed -i 's/DEBUG *= *False/DEBUG=True/' "$CONFFILE"
    - cat "${CONFFILE}"
    -fi
    -
    -export SITE_ROOT
    -
    -exec uwsgi --ini /uwsgi.ini
    --- a/upgrade-site.py Tue Jun 14 21:32:42 2022 -0500
    +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
    @@ -1,26 +0,0 @@
    -#!/usr/bin/env python
    -
    -import sys
    -import subprocess
    -import semver
    -import reviewboard
    -
    -
    -def main(version_file, site_folder):
    - running_version = reviewboard.get_version_string()
    -
    - try:
    - with open(version_file) as f:
    - previous_version = f.readline().strip()
    - except IOError:
    - previous_version = "0.0.0"
    -
    - if semver.compare(running_version, previous_version) == 1:
    - print("ReviewBoard upgrade detected, performing rb-site upgrade")
    - subprocess.check_call(["rb-site", "upgrade", site_folder])
    - with open(version_file, 'w') as f:
    - f.write(running_version)
    -
    -
    -if __name__ == "__main__":
    - main(*sys.argv[1:])
    --- a/uwsgi.ini Tue Jun 14 21:32:42 2022 -0500
    +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
    @@ -1,16 +0,0 @@
    -[uwsgi]
    -plugin=python,http
    -home=/opt/venv/
    -die-on-term=
    -env=DJANGO_SETTINGS_MODULE=reviewboard.settings
    -pymodule-alias=settings_local=/var/www/reviewboard/conf/settings_local.py
    -module = django.core.handlers.wsgi:WSGIHandler()
    -master=true
    -http=:8000
    -static-map=$(SITE_ROOT)static=/var/www/reviewboard/htdocs/static
    -static-map=$(SITE_ROOT)media=/var/www/reviewboard/htdocs/media
    -static-map=$(SITE_ROOT)errordocs=/var/www/reviewboard/htdocs/errordocs
    -static-safe=/opt/venv/lib/python2.7/site-packages/
    -enable-threads=true
    -processes=%k
    -buffer-size=8192