Skip to contentSkip to conversation

patchwork: Add a dockerfile for deploy patchwork and patchtest

PATCH Superseded [email protected] 4 participants 7 messages Dec 29, 2018 – Feb 11, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 patchwork: Add a dockerfile for deploy patchwork and patchtest

From: Changqing Li <[email protected]>

Add a dockerfile for easy deploy patchwork and patchtest in docker

---
 Dockerfile.pw                 | 52 +++++++++++++++++++++++++++++++++++++++++++
 README.pw                     | 32 ++++++++++++++++++++++++++
 requirements.txt              | 12 ++++++++++
 scripts/pw_createsuperuser.sh |  5 +++++
 scripts/pw_getmail.sh         |  8 +++++++
 scripts/pw_migrate.sh         |  5 +++++
 scripts/pw_runwebserver.sh    | 12 ++++++++++
 7 files changed, 126 insertions(+)
 create mode 100644 Dockerfile.pw
 create mode 100644 README.pw
 create mode 100644 requirements.txt
 create mode 100755 scripts/pw_createsuperuser.sh
 create mode 100755 scripts/pw_getmail.sh
 create mode 100755 scripts/pw_migrate.sh
 create mode 100755 scripts/pw_runwebserver.sh
Dockerfile.pw new file +52 -0
new file mode 100644
index 0000000..ae3c1ee
@@ -0,0 +1,52 @@
+FROM ubuntu:latest
+MAINTAINER owner <[email protected]>
+
+EXPOSE 8080
+
+ENV PYTHONUNBUFFERED=1 \
+    LANG=en_US.UTF-8 \
+    LC_ALL=en_US.UTF-8 \
+    LC_CTYPE=en_US.UTF-8 \
+    PATH="$PATH:/opt/patchwork/git-pw:/opt/patchtest:/opt/patchtest/scripts"
+
+RUN  apt-get update \
+        && apt-get dist-upgrade -y \
+        && apt-get install -y --no-install-recommends \
+        autoconf \
+        gcc \
+        g++ \
+        make \
+        locales \
+        wget \
+        curl \
+        cron \
+        python-pip \
+        python-dev \
+        python-setuptools \
+        python3-pip \
+        python3-dev \
+        libmysqlclient-dev \
+        git-core \
+        getmail4 \
+        && sh -c "echo \"en_US.UTF-8 UTF-8\" >> /etc/locale.gen" \
+        && locale-gen en_US.UTF-8 \
+        && update-locale \
+        && pip2 install wheel \
+        && pip3 install wheel \
+        && pip3 install setuptools \
+        && apt-get autoremove --purge -y \
+        && rm -rf /var/lib/apt/lists/* \
+        && apt-get clean
+ADD ./patchwork /opt/patchwork
+ADD ./patchtest /opt/patchtest
+ADD ./patchtest-oe /opt/patchtest-oe
+ADD ./getmailrc /opt/getmail/getmailrc
+RUN  pip2 install -r /opt/patchwork/requirements.txt \ 
+    && pip3 install -r /opt/patchtest/requirements.txt \
+    && pip3 install  -r /opt/patchtest-oe/requirements.txt \
+    && mkdir -p /opt/getmail \
+    && mkdir -p /opt/pw-logs \
+    && git config --global user.email "[email protected]" \
+    && git config --global user.name "patchtest" \
+    && /opt/patchtest/scripts/create-host-test-folder -t /opt/pw-test \
+    && /opt/patchtest/scripts/create-host-crontab -c /opt/pw-test-cron 
README.pw new file +32 -0
new file mode 100644
index 0000000..ffa7af1
@@ -0,0 +1,32 @@
+* Dockerfile.pw deploy patchwork, patchtest, patchtest-oe in docker
+
+* Dockerfile.pw is just an example, you can adjust according to your
+  deploy condition, like not use getmail, but use postfix.
+
+* requirements.txt,  just for refer, you can also rewrite this 
+  according to patchwork'doc and accoridng to your deploy condition.
+
+* scripts folder hold the files will be used during deploy with docker.
+
+* Deploy steps:
+
+1. Clone patchwork, patchtest, patchtest-oe first, also put getmailrc used by
+   Dockerfile.pw under the same folder.
+
+2. Build docker image with Dockerfile.pw
+$docker build -t pw -f ./patchwork/Dockerfile.pw .
+
+3. use mariadb as dataserver:
+$ docker pull mariadb
+$ docker run -d --name pw-db -e MYSQL_ROOT_PASSWORD=123456 -e MYSQL_DATABASE=pwdb -v /pw/pwdb:/var/lib/mysql mariadb
+
+5. run web server
+docker run -d --name pw-web --link pw-db:pw-db -p 8080:8080 pw "/opt/patchwork/scripts/pw_runwebserver.sh"
+
+6. config pw
+docker exec -it pw-web /opt/patchwork/scripts/pw_migrate.sh
+docker exec -it pw-web /opt/patchwork/scripts/pw_createsuperuser.sh
+
+7. run patchwork
+docker run -d --name pw-mail --link pw-db:pw-db pw "/opt/patchwork/scripts/pw_getmail.sh"
+
requirements.txt new file +12 -0
new file mode 100644
index 0000000..b8f68f2
@@ -0,0 +1,12 @@
+django==1.8.0
+sqlparse==0.2.4
+celery==3.1.20
+django_filter==0.11.0
+djangorestframework==2.4.8
+drf-nested-routers==0.11.1
+psycopg2>=2.7,<2.8
+mysqlclient
+jsonfield
+enum34
+GitPython
+requests
scripts/pw_createsuperuser.sh new file +5 -0
new file mode 100755
index 0000000..324ce72
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+pw_dir='/opt/patchwork'
+
+(cd $pw_dir; ./manage.py createsuperuser)
scripts/pw_getmail.sh new file +8 -0
new file mode 100755
index 0000000..eff5c0e
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+while true
+do
+	getmail --getmaildir=/opt/getmail/ --idle INBOX
+        sleep 1
+done
+
scripts/pw_migrate.sh new file +5 -0
new file mode 100755
index 0000000..e54b2f4
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+pw_dir="/opt/patchwork"
+
+(cd $pw_dir; ./manage.py migrate; ./manage.py collectstatic; ./manage.py loaddata default_tags default_states default_events)
scripts/pw_runwebserver.sh new file +12 -0
new file mode 100755
index 0000000..4233b1a
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+export LANG="en_US.UTF-8"
+export LC_ALL="en_US.UTF-8"
+
+#open crontab to do test
+/etc/init.d/cron start
+crontab -u pwtest /opt/pw-test-cron/crontab
+
+pw_dir="/opt/patchwork"
+
+(cd $pw_dir; ./manage.py runserver 0.0.0.0:8080)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 patchwork: Add a dockerfile for deploy patchwork and patchtest

change in v2:
run getmail in crontab

Changqing Li (1):
patchwork: Add a dockerfile for deploy patchwork and patchtest

 Dockerfile.pw                 | 52 +++++++++++++++++++++++++++++++++++++++++++
 README.pw                     | 32 ++++++++++++++++++++++++++
 requirements.txt              | 12 ++++++++++
 scripts/pw_createsuperuser.sh |  5 +++++
 scripts/pw_getmail.sh         | 11 +++++++++
 scripts/pw_migrate.sh         |  5 +++++
 scripts/pw_runwebserver.sh    | 12 ++++++++++
 7 files changed, 129 insertions(+)
 create mode 100644 Dockerfile.pw
 create mode 100644 README.pw
 create mode 100644 requirements.txt
 create mode 100755 scripts/pw_createsuperuser.sh
 create mode 100755 scripts/pw_getmail.sh
 create mode 100755 scripts/pw_migrate.sh
 create mode 100755 scripts/pw_runwebserver.sh
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 1/1 patchwork: Add a dockerfile for deploy patchwork and patchtest

From: Changqing Li <[email protected]>

Add a dockerfile for easy deploy patchwork and patchtest in docker

---
 Dockerfile.pw                 | 52 +++++++++++++++++++++++++++++++++++++++++++
 README.pw                     | 32 ++++++++++++++++++++++++++
 requirements.txt              | 12 ++++++++++
 scripts/pw_createsuperuser.sh |  5 +++++
 scripts/pw_getmail.sh         | 11 +++++++++
 scripts/pw_migrate.sh         |  5 +++++
 scripts/pw_runwebserver.sh    | 12 ++++++++++
 7 files changed, 129 insertions(+)
 create mode 100644 Dockerfile.pw
 create mode 100644 README.pw
 create mode 100644 requirements.txt
 create mode 100755 scripts/pw_createsuperuser.sh
 create mode 100755 scripts/pw_getmail.sh
 create mode 100755 scripts/pw_migrate.sh
 create mode 100755 scripts/pw_runwebserver.sh
Dockerfile.pw new file +52 -0
new file mode 100644
index 0000000..ae3c1ee
@@ -0,0 +1,52 @@
+FROM ubuntu:latest
+MAINTAINER owner <[email protected]>
+
+EXPOSE 8080
+
+ENV PYTHONUNBUFFERED=1 \
+    LANG=en_US.UTF-8 \
+    LC_ALL=en_US.UTF-8 \
+    LC_CTYPE=en_US.UTF-8 \
+    PATH="$PATH:/opt/patchwork/git-pw:/opt/patchtest:/opt/patchtest/scripts"
+
+RUN  apt-get update \
+        && apt-get dist-upgrade -y \
+        && apt-get install -y --no-install-recommends \
+        autoconf \
+        gcc \
+        g++ \
+        make \
+        locales \
+        wget \
+        curl \
+        cron \
+        python-pip \
+        python-dev \
+        python-setuptools \
+        python3-pip \
+        python3-dev \
+        libmysqlclient-dev \
+        git-core \
+        getmail4 \
+        && sh -c "echo \"en_US.UTF-8 UTF-8\" >> /etc/locale.gen" \
+        && locale-gen en_US.UTF-8 \
+        && update-locale \
+        && pip2 install wheel \
+        && pip3 install wheel \
+        && pip3 install setuptools \
+        && apt-get autoremove --purge -y \
+        && rm -rf /var/lib/apt/lists/* \
+        && apt-get clean
+ADD ./patchwork /opt/patchwork
+ADD ./patchtest /opt/patchtest
+ADD ./patchtest-oe /opt/patchtest-oe
+ADD ./getmailrc /opt/getmail/getmailrc
+RUN  pip2 install -r /opt/patchwork/requirements.txt \ 
+    && pip3 install -r /opt/patchtest/requirements.txt \
+    && pip3 install  -r /opt/patchtest-oe/requirements.txt \
+    && mkdir -p /opt/getmail \
+    && mkdir -p /opt/pw-logs \
+    && git config --global user.email "[email protected]" \
+    && git config --global user.name "patchtest" \
+    && /opt/patchtest/scripts/create-host-test-folder -t /opt/pw-test \
+    && /opt/patchtest/scripts/create-host-crontab -c /opt/pw-test-cron 
README.pw new file +32 -0
new file mode 100644
index 0000000..ffa7af1
@@ -0,0 +1,32 @@
+* Dockerfile.pw deploy patchwork, patchtest, patchtest-oe in docker
+
+* Dockerfile.pw is just an example, you can adjust according to your
+  deploy condition, like not use getmail, but use postfix.
+
+* requirements.txt,  just for refer, you can also rewrite this 
+  according to patchwork'doc and accoridng to your deploy condition.
+
+* scripts folder hold the files will be used during deploy with docker.
+
+* Deploy steps:
+
+1. Clone patchwork, patchtest, patchtest-oe first, also put getmailrc used by
+   Dockerfile.pw under the same folder.
+
+2. Build docker image with Dockerfile.pw
+$docker build -t pw -f ./patchwork/Dockerfile.pw .
+
+3. use mariadb as dataserver:
+$ docker pull mariadb
+$ docker run -d --name pw-db -e MYSQL_ROOT_PASSWORD=123456 -e MYSQL_DATABASE=pwdb -v /pw/pwdb:/var/lib/mysql mariadb
+
+5. run web server
+docker run -d --name pw-web --link pw-db:pw-db -p 8080:8080 pw "/opt/patchwork/scripts/pw_runwebserver.sh"
+
+6. config pw
+docker exec -it pw-web /opt/patchwork/scripts/pw_migrate.sh
+docker exec -it pw-web /opt/patchwork/scripts/pw_createsuperuser.sh
+
+7. run patchwork
+docker run -d --name pw-mail --link pw-db:pw-db pw "/opt/patchwork/scripts/pw_getmail.sh"
+
requirements.txt new file +12 -0
new file mode 100644
index 0000000..b8f68f2
@@ -0,0 +1,12 @@
+django==1.8.0
+sqlparse==0.2.4
+celery==3.1.20
+django_filter==0.11.0
+djangorestframework==2.4.8
+drf-nested-routers==0.11.1
+psycopg2>=2.7,<2.8
+mysqlclient
+jsonfield
+enum34
+GitPython
+requests
scripts/pw_createsuperuser.sh new file +5 -0
new file mode 100755
index 0000000..324ce72
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+pw_dir='/opt/patchwork'
+
+(cd $pw_dir; ./manage.py createsuperuser)
scripts/pw_getmail.sh new file +11 -0
new file mode 100755
index 0000000..fadf7c9
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+sudo /etc/init.d/cron start
+echo "*/5 * * * * sudo getmail --getmaildir=/opt/getmail/ --idle INBOX >> /opt/pw-test-cron/getmail.log 2>&1" > /opt/pw-test-cron/cron-getmail
+sudo crontab -u wrlbuild  /opt/pw-test-cron/cron-getmail
+
+while true
+do
+   : 
+done
+
scripts/pw_migrate.sh new file +5 -0
new file mode 100755
index 0000000..e54b2f4
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+pw_dir="/opt/patchwork"
+
+(cd $pw_dir; ./manage.py migrate; ./manage.py collectstatic; ./manage.py loaddata default_tags default_states default_events)
scripts/pw_runwebserver.sh new file +12 -0
new file mode 100755
index 0000000..4233b1a
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+export LANG="en_US.UTF-8"
+export LC_ALL="en_US.UTF-8"
+
+#open crontab to do test
+/etc/init.d/cron start
+crontab -u pwtest /opt/pw-test-cron/crontab
+
+pw_dir="/opt/patchwork"
+
+(cd $pw_dir; ./manage.py runserver 0.0.0.0:8080)
Signature · 1 line
2.7.4
#3 lore raw
Quoted 1 line · On 1/16/19 12:37 AM, [email protected] wrote:

From: Changqing Li <[email protected]>

Ping?

Jose, are you maintaining this repo?
http://git.yoctoproject.org/cgit/cgit.cgi/patchwork/about/
You were the committer for most of the recent work.

../Randy

Quoted 194 lines

Add a dockerfile for easy deploy patchwork and patchtest in docker

---
  Dockerfile.pw                 | 52 +++++++++++++++++++++++++++++++++++++++++++
  README.pw                     | 32 ++++++++++++++++++++++++++
  requirements.txt              | 12 ++++++++++
  scripts/pw_createsuperuser.sh |  5 +++++
  scripts/pw_getmail.sh         | 11 +++++++++
  scripts/pw_migrate.sh         |  5 +++++
  scripts/pw_runwebserver.sh    | 12 ++++++++++
  7 files changed, 129 insertions(+)

create mode 100644 Dockerfile.pw
create mode 100644 README.pw
create mode 100644 requirements.txt create mode 100755 scripts/pw_createsuperuser.sh create mode 100755 scripts/pw_getmail.sh create mode 100755 scripts/pw_migrate.sh create mode 100755 scripts/pw_runwebserver.sh

Dockerfile.pw new file +52 -0
new file mode 100644
index 0000000..ae3c1ee
@@ -0,0 +1,52 @@
+FROM ubuntu:latest
+MAINTAINER owner <[email protected]>
+
+EXPOSE 8080
+
+ENV PYTHONUNBUFFERED=1 \
+    LANG=en_US.UTF-8 \
+    LC_ALL=en_US.UTF-8 \
+    LC_CTYPE=en_US.UTF-8 \
+    PATH="$PATH:/opt/patchwork/git-pw:/opt/patchtest:/opt/patchtest/scripts"
+
+RUN  apt-get update \
+        && apt-get dist-upgrade -y \
+        && apt-get install -y --no-install-recommends \
+        autoconf \
+        gcc \
+        g++ \
+        make \
+        locales \
+        wget \
+        curl \
+        cron \
+        python-pip \
+        python-dev \
+        python-setuptools \
+        python3-pip \
+        python3-dev \
+        libmysqlclient-dev \
+        git-core \
+        getmail4 \
+        && sh -c "echo \"en_US.UTF-8 UTF-8\" >> /etc/locale.gen" \
+        && locale-gen en_US.UTF-8 \
+        && update-locale \
+        && pip2 install wheel \
+        && pip3 install wheel \
+        && pip3 install setuptools \
+        && apt-get autoremove --purge -y \
+        && rm -rf /var/lib/apt/lists/* \
+        && apt-get clean
+ADD ./patchwork /opt/patchwork
+ADD ./patchtest /opt/patchtest
+ADD ./patchtest-oe /opt/patchtest-oe
+ADD ./getmailrc /opt/getmail/getmailrc
+RUN  pip2 install -r /opt/patchwork/requirements.txt \
+    && pip3 install -r /opt/patchtest/requirements.txt \
+    && pip3 install  -r /opt/patchtest-oe/requirements.txt \
+    && mkdir -p /opt/getmail \
+    && mkdir -p /opt/pw-logs \
+    && git config --global user.email "[email protected]" \
+    && git config --global user.name "patchtest" \
+    && /opt/patchtest/scripts/create-host-test-folder -t /opt/pw-test \
+    && /opt/patchtest/scripts/create-host-crontab -c /opt/pw-test-cron
README.pw new file +32 -0
new file mode 100644
index 0000000..ffa7af1
@@ -0,0 +1,32 @@
+* Dockerfile.pw deploy patchwork, patchtest, patchtest-oe in docker
+
+* Dockerfile.pw is just an example, you can adjust according to your
+  deploy condition, like not use getmail, but use postfix.
+
+* requirements.txt,  just for refer, you can also rewrite this
+  according to patchwork'doc and accoridng to your deploy condition.
+
+* scripts folder hold the files will be used during deploy with docker.
+
+* Deploy steps:
+
+1. Clone patchwork, patchtest, patchtest-oe first, also put getmailrc used by
+   Dockerfile.pw under the same folder.
+
+2. Build docker image with Dockerfile.pw
+$docker build -t pw -f ./patchwork/Dockerfile.pw .
+
+3. use mariadb as dataserver:
+$ docker pull mariadb
+$ docker run -d --name pw-db -e MYSQL_ROOT_PASSWORD=123456 -e MYSQL_DATABASE=pwdb -v /pw/pwdb:/var/lib/mysql mariadb
+
+5. run web server
+docker run -d --name pw-web --link pw-db:pw-db -p 8080:8080 pw "/opt/patchwork/scripts/pw_runwebserver.sh"
+
+6. config pw
+docker exec -it pw-web /opt/patchwork/scripts/pw_migrate.sh
+docker exec -it pw-web /opt/patchwork/scripts/pw_createsuperuser.sh
+
+7. run patchwork
+docker run -d --name pw-mail --link pw-db:pw-db pw "/opt/patchwork/scripts/pw_getmail.sh"
+
requirements.txt new file +12 -0
new file mode 100644
index 0000000..b8f68f2
@@ -0,0 +1,12 @@
+django==1.8.0
+sqlparse==0.2.4
+celery==3.1.20
+django_filter==0.11.0
+djangorestframework==2.4.8
+drf-nested-routers==0.11.1
+psycopg2>=2.7,<2.8
+mysqlclient
+jsonfield
+enum34
+GitPython
+requests
scripts/pw_createsuperuser.sh new file +5 -0
new file mode 100755
index 0000000..324ce72
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+pw_dir='/opt/patchwork'
+
+(cd $pw_dir; ./manage.py createsuperuser)
scripts/pw_getmail.sh new file +11 -0
new file mode 100755
index 0000000..fadf7c9
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+sudo /etc/init.d/cron start
+echo "*/5 * * * * sudo getmail --getmaildir=/opt/getmail/ --idle INBOX >> /opt/pw-test-cron/getmail.log 2>&1" > /opt/pw-test-cron/cron-getmail
+sudo crontab -u wrlbuild  /opt/pw-test-cron/cron-getmail
+
+while true
+do
+   :
+done
+
scripts/pw_migrate.sh new file +5 -0
new file mode 100755
index 0000000..e54b2f4
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+pw_dir="/opt/patchwork"
+
+(cd $pw_dir; ./manage.py migrate; ./manage.py collectstatic; ./manage.py loaddata default_tags default_states default_events)
scripts/pw_runwebserver.sh new file +12 -0
new file mode 100755
index 0000000..4233b1a
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+export LANG="en_US.UTF-8"
+export LC_ALL="en_US.UTF-8"
+
+#open crontab to do test
+/etc/init.d/cron start
+crontab -u pwtest /opt/pw-test-cron/crontab
+
+pw_dir="/opt/patchwork"
+
+(cd $pw_dir; ./manage.py runserver 0.0.0.0:8080)
Signature · 2 lines
# Randy MacLeod
# Wind River Linux
#4 lore raw

Hi Randy,

Sorry for the late response. I'm no longer involved with the Yocto Project. Last word I heard was that point of contact for Patchwork- related work was Paul Eggleton.

Hope this helps.

Jose

Quoted 223 lines · Randy MacLeod
Quoted 1 line · On 1/16/19 12:37 AM, [email protected] wrote:

From: Changqing Li <[email protected]>

Ping?

Jose, are you maintaining this repo?
http://git.yoctoproject.org/cgit/cgit.cgi/patchwork/about/
You were the committer for most of the recent work.

../Randy

Quoted 211 lines

Add a dockerfile for easy deploy patchwork and patchtest in docker

---
  Dockerfile.pw                 | 52
+++++++++++++++++++++++++++++++++++++++++++
  README.pw                     | 32 ++++++++++++++++++++++++++
  requirements.txt              | 12 ++++++++++
  scripts/pw_createsuperuser.sh |  5 +++++
  scripts/pw_getmail.sh         | 11 +++++++++
  scripts/pw_migrate.sh         |  5 +++++
  scripts/pw_runwebserver.sh    | 12 ++++++++++
  7 files changed, 129 insertions(+)

create mode 100644 Dockerfile.pw
create mode 100644 README.pw
create mode 100644 requirements.txt create mode 100755 scripts/pw_createsuperuser.sh create mode 100755 scripts/pw_getmail.sh create mode 100755 scripts/pw_migrate.sh create mode 100755 scripts/pw_runwebserver.sh

Dockerfile.pw new file +10 -0
new file mode 100644
index 0000000..ae3c1ee
@@ -0,0 +1,52 @@
+FROM ubuntu:latest
+MAINTAINER owner <[email protected]>
+
+EXPOSE 8080
+
+ENV PYTHONUNBUFFERED=1 \
+    LANG=en_US.UTF-8 \
+    LC_ALL=en_US.UTF-8 \
+    LC_CTYPE=en_US.UTF-8 \
+    PATH="$PATH:/opt/patchwork/git-

pw:/opt/patchtest:/opt/patchtest/scripts"

Dockerfile.pw new file +41 -0
+
+RUN  apt-get update \
+        && apt-get dist-upgrade -y \
+        && apt-get install -y --no-install-recommends \
+        autoconf \
+        gcc \
+        g++ \
+        make \
+        locales \
+        wget \
+        curl \
+        cron \
+        python-pip \
+        python-dev \
+        python-setuptools \
+        python3-pip \
+        python3-dev \
+        libmysqlclient-dev \
+        git-core \
+        getmail4 \
+        && sh -c "echo \"en_US.UTF-8 UTF-8\" >> /etc/locale.gen" \
+        && locale-gen en_US.UTF-8 \
+        && update-locale \
+        && pip2 install wheel \
+        && pip3 install wheel \
+        && pip3 install setuptools \
+        && apt-get autoremove --purge -y \
+        && rm -rf /var/lib/apt/lists/* \
+        && apt-get clean
+ADD ./patchwork /opt/patchwork
+ADD ./patchtest /opt/patchtest
+ADD ./patchtest-oe /opt/patchtest-oe
+ADD ./getmailrc /opt/getmail/getmailrc
+RUN  pip2 install -r /opt/patchwork/requirements.txt \
+    && pip3 install -r /opt/patchtest/requirements.txt \
+    && pip3 install  -r /opt/patchtest-oe/requirements.txt \
+    && mkdir -p /opt/getmail \
+    && mkdir -p /opt/pw-logs \
+    && git config --global user.email "[email protected]" \
+    && git config --global user.name "patchtest" \
+    && /opt/patchtest/scripts/create-host-test-folder -t /opt/pw-

test \
+ && /opt/patchtest/scripts/create-host-crontab -c /opt/pw-test-
cron

README.pw new file +1 -0
new file mode 100644
index 0000000..ffa7af1
@@ -0,0 +1,32 @@
+* Dockerfile.pw deploy patchwork, patchtest, patchtest-oe in

docker

README.pw new file +2 -0
+
+* Dockerfile.pw is just an example, you can adjust according to

your

README.pw new file +4 -0
+  deploy condition, like not use getmail, but use postfix.
+
+* requirements.txt,  just for refer, you can also rewrite this
+  according to patchwork'doc and accoridng to your deploy

condition.

README.pw new file +2 -0
+
+* scripts folder hold the files will be used during deploy with

docker.

README.pw new file +4 -0
+
+* Deploy steps:
+
+1. Clone patchwork, patchtest, patchtest-oe first, also put

getmailrc used by

README.pw new file +8 -0
+   Dockerfile.pw under the same folder.
+
+2. Build docker image with Dockerfile.pw
+$docker build -t pw -f ./patchwork/Dockerfile.pw .
+
+3. use mariadb as dataserver:
+$ docker pull mariadb
+$ docker run -d --name pw-db -e MYSQL_ROOT_PASSWORD=123456 -e

MYSQL_DATABASE=pwdb -v /pw/pwdb:/var/lib/mysql mariadb

README.pw new file +3 -0
+
+5. run web server
+docker run -d --name pw-web --link pw-db:pw-db -p 8080:8080 pw

"/opt/patchwork/scripts/pw_runwebserver.sh"

README.pw new file +4 -0
+
+6. config pw
+docker exec -it pw-web /opt/patchwork/scripts/pw_migrate.sh
+docker exec -it pw-web

/opt/patchwork/scripts/pw_createsuperuser.sh

README.pw new file +3 -0
+
+7. run patchwork
+docker run -d --name pw-mail --link pw-db:pw-db pw

"/opt/patchwork/scripts/pw_getmail.sh"

README.pw new file +1 -0
+
requirements.txt new file +12 -0
new file mode 100644
index 0000000..b8f68f2
@@ -0,0 +1,12 @@
+django==1.8.0
+sqlparse==0.2.4
+celery==3.1.20
+django_filter==0.11.0
+djangorestframework==2.4.8
+drf-nested-routers==0.11.1
+psycopg2>=2.7,<2.8
+mysqlclient
+jsonfield
+enum34
+GitPython
+requests
scripts/pw_createsuperuser.sh new file +5 -0
new file mode 100755
index 0000000..324ce72
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+pw_dir='/opt/patchwork'
+
+(cd $pw_dir; ./manage.py createsuperuser)
scripts/pw_getmail.sh new file +4 -0
new file mode 100755
index 0000000..fadf7c9
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+sudo /etc/init.d/cron start
+echo "*/5 * * * * sudo getmail --getmaildir=/opt/getmail/ --idle

INBOX >> /opt/pw-test-cron/getmail.log 2>&1" > /opt/pw-test- cron/cron-getmail

scripts/pw_getmail.sh new file +7 -0
+sudo crontab -u wrlbuild  /opt/pw-test-cron/cron-getmail
+
+while true
+do
+   :
+done
+
scripts/pw_migrate.sh new file +5 -0
new file mode 100755
index 0000000..e54b2f4
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+pw_dir="/opt/patchwork"
+
+(cd $pw_dir; ./manage.py migrate; ./manage.py collectstatic;

./manage.py loaddata default_tags default_states default_events)

scripts/pw_runwebserver.sh new file +12 -0
new file mode 100755
index 0000000..4233b1a
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+export LANG="en_US.UTF-8"
+export LC_ALL="en_US.UTF-8"
+
+#open crontab to do test
+/etc/init.d/cron start
+crontab -u pwtest /opt/pw-test-cron/crontab
+
+pw_dir="/opt/patchwork"
+
+(cd $pw_dir; ./manage.py runserver 0.0.0.0:8080)
#5 lore raw

Hi, Paul

Are you maintaining this repo?

Quoted 9 lines · Jose Lamego

Hi Randy,

Sorry for the late response. I'm no longer involved with the Yocto Project. Last word I heard was that point of contact for Patchwork- related work was Paul Eggleton.

Hope this helps.

Jose

Thanks.

Quoted 224 lines · Randy MacLeod
Quoted 221 lines · On 1/16/19 12:37 AM, [email protected] wrote:
Quoted 1 line

From: Changqing Li <[email protected]>

Ping?

Jose, are you maintaining this repo?
http://git.yoctoproject.org/cgit/cgit.cgi/patchwork/about/
You were the committer for most of the recent work.

../Randy

Quoted 211 lines

Add a dockerfile for easy deploy patchwork and patchtest in docker

---
   Dockerfile.pw                 | 52
+++++++++++++++++++++++++++++++++++++++++++
   README.pw                     | 32 ++++++++++++++++++++++++++
   requirements.txt              | 12 ++++++++++
   scripts/pw_createsuperuser.sh |  5 +++++
   scripts/pw_getmail.sh         | 11 +++++++++
   scripts/pw_migrate.sh         |  5 +++++
   scripts/pw_runwebserver.sh    | 12 ++++++++++
   7 files changed, 129 insertions(+)

create mode 100644 Dockerfile.pw
create mode 100644 README.pw
create mode 100644 requirements.txt create mode 100755 scripts/pw_createsuperuser.sh create mode 100755 scripts/pw_getmail.sh create mode 100755 scripts/pw_migrate.sh create mode 100755 scripts/pw_runwebserver.sh

Dockerfile.pw new file +10 -0
new file mode 100644
index 0000000..ae3c1ee
@@ -0,0 +1,52 @@
+FROM ubuntu:latest
+MAINTAINER owner <[email protected]>
+
+EXPOSE 8080
+
+ENV PYTHONUNBUFFERED=1 \
+    LANG=en_US.UTF-8 \
+    LC_ALL=en_US.UTF-8 \
+    LC_CTYPE=en_US.UTF-8 \
+    PATH="$PATH:/opt/patchwork/git-

pw:/opt/patchtest:/opt/patchtest/scripts"

Dockerfile.pw new file +41 -0
+
+RUN  apt-get update \
+        && apt-get dist-upgrade -y \
+        && apt-get install -y --no-install-recommends \
+        autoconf \
+        gcc \
+        g++ \
+        make \
+        locales \
+        wget \
+        curl \
+        cron \
+        python-pip \
+        python-dev \
+        python-setuptools \
+        python3-pip \
+        python3-dev \
+        libmysqlclient-dev \
+        git-core \
+        getmail4 \
+        && sh -c "echo \"en_US.UTF-8 UTF-8\" >> /etc/locale.gen" \
+        && locale-gen en_US.UTF-8 \
+        && update-locale \
+        && pip2 install wheel \
+        && pip3 install wheel \
+        && pip3 install setuptools \
+        && apt-get autoremove --purge -y \
+        && rm -rf /var/lib/apt/lists/* \
+        && apt-get clean
+ADD ./patchwork /opt/patchwork
+ADD ./patchtest /opt/patchtest
+ADD ./patchtest-oe /opt/patchtest-oe
+ADD ./getmailrc /opt/getmail/getmailrc
+RUN  pip2 install -r /opt/patchwork/requirements.txt \
+    && pip3 install -r /opt/patchtest/requirements.txt \
+    && pip3 install  -r /opt/patchtest-oe/requirements.txt \
+    && mkdir -p /opt/getmail \
+    && mkdir -p /opt/pw-logs \
+    && git config --global user.email "[email protected]" \
+    && git config --global user.name "patchtest" \
+    && /opt/patchtest/scripts/create-host-test-folder -t /opt/pw-

test \
+ && /opt/patchtest/scripts/create-host-crontab -c /opt/pw-test-
cron

README.pw new file +1 -0
new file mode 100644
index 0000000..ffa7af1
@@ -0,0 +1,32 @@
+* Dockerfile.pw deploy patchwork, patchtest, patchtest-oe in

docker

README.pw new file +2 -0
+
+* Dockerfile.pw is just an example, you can adjust according to

your

README.pw new file +4 -0
+  deploy condition, like not use getmail, but use postfix.
+
+* requirements.txt,  just for refer, you can also rewrite this
+  according to patchwork'doc and accoridng to your deploy

condition.

README.pw new file +2 -0
+
+* scripts folder hold the files will be used during deploy with

docker.

README.pw new file +4 -0
+
+* Deploy steps:
+
+1. Clone patchwork, patchtest, patchtest-oe first, also put

getmailrc used by

README.pw new file +8 -0
+   Dockerfile.pw under the same folder.
+
+2. Build docker image with Dockerfile.pw
+$docker build -t pw -f ./patchwork/Dockerfile.pw .
+
+3. use mariadb as dataserver:
+$ docker pull mariadb
+$ docker run -d --name pw-db -e MYSQL_ROOT_PASSWORD=123456 -e

MYSQL_DATABASE=pwdb -v /pw/pwdb:/var/lib/mysql mariadb

README.pw new file +3 -0
+
+5. run web server
+docker run -d --name pw-web --link pw-db:pw-db -p 8080:8080 pw

"/opt/patchwork/scripts/pw_runwebserver.sh"

README.pw new file +4 -0
+
+6. config pw
+docker exec -it pw-web /opt/patchwork/scripts/pw_migrate.sh
+docker exec -it pw-web

/opt/patchwork/scripts/pw_createsuperuser.sh

README.pw new file +3 -0
+
+7. run patchwork
+docker run -d --name pw-mail --link pw-db:pw-db pw

"/opt/patchwork/scripts/pw_getmail.sh"

README.pw new file +1 -0
+
requirements.txt new file +12 -0
new file mode 100644
index 0000000..b8f68f2
@@ -0,0 +1,12 @@
+django==1.8.0
+sqlparse==0.2.4
+celery==3.1.20
+django_filter==0.11.0
+djangorestframework==2.4.8
+drf-nested-routers==0.11.1
+psycopg2>=2.7,<2.8
+mysqlclient
+jsonfield
+enum34
+GitPython
+requests
scripts/pw_createsuperuser.sh new file +5 -0
new file mode 100755
index 0000000..324ce72
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+pw_dir='/opt/patchwork'
+
+(cd $pw_dir; ./manage.py createsuperuser)
scripts/pw_getmail.sh new file +4 -0
new file mode 100755
index 0000000..fadf7c9
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+sudo /etc/init.d/cron start
+echo "*/5 * * * * sudo getmail --getmaildir=/opt/getmail/ --idle

INBOX >> /opt/pw-test-cron/getmail.log 2>&1" > /opt/pw-test- cron/cron-getmail

scripts/pw_getmail.sh new file +7 -0
+sudo crontab -u wrlbuild  /opt/pw-test-cron/cron-getmail
+
+while true
+do
+   :
+done
+
scripts/pw_migrate.sh new file +5 -0
new file mode 100755
index 0000000..e54b2f4
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+pw_dir="/opt/patchwork"
+
+(cd $pw_dir; ./manage.py migrate; ./manage.py collectstatic;

./manage.py loaddata default_tags default_states default_events)

scripts/pw_runwebserver.sh new file +12 -0
new file mode 100755
index 0000000..4233b1a
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+export LANG="en_US.UTF-8"
+export LC_ALL="en_US.UTF-8"
+
+#open crontab to do test
+/etc/init.d/cron start
+crontab -u pwtest /opt/pw-test-cron/crontab
+
+pw_dir="/opt/patchwork"
+
+(cd $pw_dir; ./manage.py runserver 0.0.0.0:8080)
Signature · 3 lines
BRs

Sandy(Li Changqing)
#6 lore raw

Not actively, no. I will try to take a look at your patch this week though.

Cheers,
Paul

Quoted 240 lines · NZDT Changqing Li

Hi, Paul

Are you maintaining this repo?

Quoted 9 lines · Jose Lamego

Hi Randy,

Sorry for the late response. I'm no longer involved with the Yocto Project. Last word I heard was that point of contact for Patchwork- related work was Paul Eggleton.

Hope this helps.

Jose

Thanks.

Quoted 224 lines · Randy MacLeod
Quoted 221 lines · On 1/16/19 12:37 AM, [email protected] wrote:
Quoted 1 line

From: Changqing Li <[email protected]>

Ping?

Jose, are you maintaining this repo?
http://git.yoctoproject.org/cgit/cgit.cgi/patchwork/about/
You were the committer for most of the recent work.

../Randy

Quoted 211 lines

Add a dockerfile for easy deploy patchwork and patchtest in docker

---
   Dockerfile.pw                 | 52
+++++++++++++++++++++++++++++++++++++++++++
   README.pw                     | 32 ++++++++++++++++++++++++++
   requirements.txt              | 12 ++++++++++
   scripts/pw_createsuperuser.sh |  5 +++++
   scripts/pw_getmail.sh         | 11 +++++++++
   scripts/pw_migrate.sh         |  5 +++++
   scripts/pw_runwebserver.sh    | 12 ++++++++++
   7 files changed, 129 insertions(+)

create mode 100644 Dockerfile.pw
create mode 100644 README.pw
create mode 100644 requirements.txt create mode 100755 scripts/pw_createsuperuser.sh create mode 100755 scripts/pw_getmail.sh create mode 100755 scripts/pw_migrate.sh create mode 100755 scripts/pw_runwebserver.sh

Dockerfile.pw new file +10 -0
new file mode 100644
index 0000000..ae3c1ee
@@ -0,0 +1,52 @@
+FROM ubuntu:latest
+MAINTAINER owner <[email protected]>
+
+EXPOSE 8080
+
+ENV PYTHONUNBUFFERED=1 \
+    LANG=en_US.UTF-8 \
+    LC_ALL=en_US.UTF-8 \
+    LC_CTYPE=en_US.UTF-8 \
+    PATH="$PATH:/opt/patchwork/git-

pw:/opt/patchtest:/opt/patchtest/scripts"

Dockerfile.pw new file +41 -0
+
+RUN  apt-get update \
+        && apt-get dist-upgrade -y \
+        && apt-get install -y --no-install-recommends \
+        autoconf \
+        gcc \
+        g++ \
+        make \
+        locales \
+        wget \
+        curl \
+        cron \
+        python-pip \
+        python-dev \
+        python-setuptools \
+        python3-pip \
+        python3-dev \
+        libmysqlclient-dev \
+        git-core \
+        getmail4 \
+        && sh -c "echo \"en_US.UTF-8 UTF-8\" >> /etc/locale.gen" \
+        && locale-gen en_US.UTF-8 \
+        && update-locale \
+        && pip2 install wheel \
+        && pip3 install wheel \
+        && pip3 install setuptools \
+        && apt-get autoremove --purge -y \
+        && rm -rf /var/lib/apt/lists/* \
+        && apt-get clean
+ADD ./patchwork /opt/patchwork
+ADD ./patchtest /opt/patchtest
+ADD ./patchtest-oe /opt/patchtest-oe
+ADD ./getmailrc /opt/getmail/getmailrc
+RUN  pip2 install -r /opt/patchwork/requirements.txt \
+    && pip3 install -r /opt/patchtest/requirements.txt \
+    && pip3 install  -r /opt/patchtest-oe/requirements.txt \
+    && mkdir -p /opt/getmail \
+    && mkdir -p /opt/pw-logs \
+    && git config --global user.email "[email protected]" \
+    && git config --global user.name "patchtest" \
+    && /opt/patchtest/scripts/create-host-test-folder -t /opt/pw-

test \
+ && /opt/patchtest/scripts/create-host-crontab -c /opt/pw-test-
cron

README.pw new file +1 -0
new file mode 100644
index 0000000..ffa7af1
@@ -0,0 +1,32 @@
+* Dockerfile.pw deploy patchwork, patchtest, patchtest-oe in

docker

README.pw new file +2 -0
+
+* Dockerfile.pw is just an example, you can adjust according to

your

README.pw new file +4 -0
+  deploy condition, like not use getmail, but use postfix.
+
+* requirements.txt,  just for refer, you can also rewrite this
+  according to patchwork'doc and accoridng to your deploy

condition.

README.pw new file +2 -0
+
+* scripts folder hold the files will be used during deploy with

docker.

README.pw new file +4 -0
+
+* Deploy steps:
+
+1. Clone patchwork, patchtest, patchtest-oe first, also put

getmailrc used by

README.pw new file +8 -0
+   Dockerfile.pw under the same folder.
+
+2. Build docker image with Dockerfile.pw
+$docker build -t pw -f ./patchwork/Dockerfile.pw .
+
+3. use mariadb as dataserver:
+$ docker pull mariadb
+$ docker run -d --name pw-db -e MYSQL_ROOT_PASSWORD=123456 -e

MYSQL_DATABASE=pwdb -v /pw/pwdb:/var/lib/mysql mariadb

README.pw new file +3 -0
+
+5. run web server
+docker run -d --name pw-web --link pw-db:pw-db -p 8080:8080 pw

"/opt/patchwork/scripts/pw_runwebserver.sh"

README.pw new file +4 -0
+
+6. config pw
+docker exec -it pw-web /opt/patchwork/scripts/pw_migrate.sh
+docker exec -it pw-web

/opt/patchwork/scripts/pw_createsuperuser.sh

README.pw new file +3 -0
+
+7. run patchwork
+docker run -d --name pw-mail --link pw-db:pw-db pw

"/opt/patchwork/scripts/pw_getmail.sh"

README.pw new file +1 -0
+
requirements.txt new file +12 -0
new file mode 100644
index 0000000..b8f68f2
@@ -0,0 +1,12 @@
+django==1.8.0
+sqlparse==0.2.4
+celery==3.1.20
+django_filter==0.11.0
+djangorestframework==2.4.8
+drf-nested-routers==0.11.1
+psycopg2>=2.7,<2.8
+mysqlclient
+jsonfield
+enum34
+GitPython
+requests
scripts/pw_createsuperuser.sh new file +5 -0
new file mode 100755
index 0000000..324ce72
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+pw_dir='/opt/patchwork'
+
+(cd $pw_dir; ./manage.py createsuperuser)
scripts/pw_getmail.sh new file +4 -0
new file mode 100755
index 0000000..fadf7c9
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+sudo /etc/init.d/cron start
+echo "*/5 * * * * sudo getmail --getmaildir=/opt/getmail/ --idle

INBOX >> /opt/pw-test-cron/getmail.log 2>&1" > /opt/pw-test- cron/cron-getmail

scripts/pw_getmail.sh new file +7 -0
+sudo crontab -u wrlbuild  /opt/pw-test-cron/cron-getmail
+
+while true
+do
+   :
+done
+
scripts/pw_migrate.sh new file +5 -0
new file mode 100755
index 0000000..e54b2f4
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+pw_dir="/opt/patchwork"
+
+(cd $pw_dir; ./manage.py migrate; ./manage.py collectstatic;

./manage.py loaddata default_tags default_states default_events)

scripts/pw_runwebserver.sh new file +12 -0
new file mode 100755
index 0000000..4233b1a
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+export LANG="en_US.UTF-8"
+export LC_ALL="en_US.UTF-8"
+
+#open crontab to do test
+/etc/init.d/cron start
+crontab -u pwtest /opt/pw-test-cron/crontab
+
+pw_dir="/opt/patchwork"
+
+(cd $pw_dir; ./manage.py runserver 0.0.0.0:8080)
Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre