--- /dev/null
+FROM centos:latest
+MAINTAINER jonatanschlag
+
+ADD setup.sh /tmp/setup.sh
+
+RUN chmod +x /tmp/setup.sh && /tmp/setup.sh
+
+
+USER root
+
+# Define default command.
+CMD ["/bin/bash"]
+
--- /dev/null
+#!/bin/bash
+. /usr/lib/docker-shell-scripts-lib/tag.sh
+. /usr/lib/docker-shell-scripts-lib/get-id.sh
+. /usr/lib/docker-shell-scripts-lib/preparation.sh
+. /usr/lib/docker-shell-scripts-lib/logging.sh
+. /usr/lib/docker-shell-scripts-lib/install.sh
+
+###
+### Build the pakfire Dockerimage
+###
+
+### preparation ###
+# cd into script dir
+(cd $(dirname -- "$(readlink -e -- "$BASH_SOURCE")") || exit
+
+# check for all necessary files
+
+CheckForFile "setup-org.sh"
+CheckForFile "Dockerfile"
+
+#create a work copy of setup.sh
+cp setup-org.sh setup.sh
+### paramter for mariadb build
+repo="ipfire-pakfire"
+dockertag="new"
+username=jonatanschlag
+tag="${username}/${repo}:${dockertag}"
+### Build the docker image
+docker build --no-cache=true -t "$tag" .
+### Tag the docker image
+back=$(tag-image "${username}/${repo}")
+
+if [ "error" = "$back" ]; then
+ echo "Tagging was not successful"
+fi
+rm -f setup.sh
+)
yum update -y
log "Installing epel"
yum install -y epel-release
-log "Installing packages for build"
-yum install -y git gcc make intltool autoconf libtool libtool-devel libcap-devel libsolv-devel python-devel xz-devel
-log "Installing dependencies"
-yum install -y python-daemon python-tornado libcap libsolv xz
+build_deps="git gcc make autoconf libtool intltool libcap-devel libsolv-devel python-devel xz-devel"
+deps="libcap libsolv xz python"
-# add a user
-groupadd -g 2000 pbs
-useradd --system --no-create-home --shell /bin/bash --uid 2000 --gid 2000 pbs
+log "Installing dependencies"
+yum install -y ${deps}
+log "Installing packages for build"
+yum install -y ${build_deps}
mkdir -p /opt/dev
log "Building pakfire"
make
make install
-log "Installing the pbs"
-cd /opt/
-git clone -b master http://git.ipfire.org/pub/git/pbs.git
-cd pbs
-chmod +x pakfire-web
-
# cleanup
-yum remove -y git gcc make intltool autoconf libtool libtool-devel
+yum remove -y ${build_deps}
yum autoremove -y
yum clean all
-rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /opt/dev/*
-
-# set permissions
+rm -rf /var/tmp/* /var/cache/yum/* /opt/dev/*
--- /dev/null
+FROM jonatanschlag/ipfire-pakfire:latest
+MAINTAINER jonatanschlag
+
+ADD setup.sh /tmp/setup.sh
+
+RUN chmod +x /tmp/setup.sh && /tmp/setup.sh
+
+
+USER root
+
+# Define default command.
+CMD ["/bin/bash"]
+
--- /dev/null
+#!/bin/bash
+. /usr/lib/docker-shell-scripts-lib/tag.sh
+. /usr/lib/docker-shell-scripts-lib/get-id.sh
+. /usr/lib/docker-shell-scripts-lib/preparation.sh
+. /usr/lib/docker-shell-scripts-lib/logging.sh
+. /usr/lib/docker-shell-scripts-lib/install.sh
+
+###
+### Build the pakfire Dockerimage
+###
+
+### preparation ###
+# cd into script dir
+(cd $(dirname -- "$(readlink -e -- "$BASH_SOURCE")") || exit
+
+# check for all necessary files
+
+CheckForFile "setup-org.sh"
+CheckForFile "Dockerfile"
+
+#create a work copy of setup.sh
+cp setup-org.sh setup.sh
+### paramter for mariadb build
+repo="ipfire-pbs-base"
+dockertag="new"
+username=jonatanschlag
+tag="${username}/${repo}:${dockertag}"
+### Build the docker image
+docker build --no-cache=true -t "$tag" .
+### Tag the docker image
+back=$(tag-image "${username}/${repo}")
+
+if [ "error" = "$back" ]; then
+ echo "Tagging was not successful"
+fi
+rm -f setup.sh
+)
--- /dev/null
+#!/bin/bash
+#
+#settings
+#
+#="database"
+
+log() {
+ echo "#######################################"
+ echo ""
+ echo "$@"
+ echo ""
+ echo "#######################################"
+}
+
+# build the pbs from master branch
+log "Update all packages"
+yum update -y
+log "Installing epel"
+yum install -y epel-release
+deps="python python-tornado python-daemon"
+
+log "Installing dependencies"
+yum install -y ${deps}
+
+
+# add a user
+groupadd -g 2000 pbs
+useradd --system --no-create-home --shell /bin/bash --uid 2000 --gid 2000 pbs
+
+mkdir -p /opt/pbs
+
+# set permissions
+chown -R pbs:pbs /opt/pbs
+
+# cleanup
+yum autoremove -y
+yum clean all
+rm -rf /var/tmp/* /var/cache/yum/* /opt/dev/*
-FROM centos:latest
+FROM jonatanschlag/ipfire-pbs-base:latest
MAINTAINER jonatanschlag
-ENV DEBIAN_FRONTEND noninteractive
+#ADD setup.sh /tmp/setup.sh
+#RUN chmod +x /tmp/setup.sh && /tmp/setup.sh
-ADD setup.sh /tmp/setup.sh
-
-RUN chmod +x /tmp/setup.sh && /tmp/setup.sh
-
-USER psb
+USER pbs
# Define default command.
-CMD [""]
+CMD ["/opt/pbs/pakfire-hub"]
. /usr/lib/docker-shell-scripts-lib/install.sh
###
-### Build the pbs Dockerimage
+### Build the pbs-hub Dockerimage
###
### preparation ###
# check for all necessary files
-CheckForFile "setup-org.sh"
CheckForFile "Dockerfile"
-#create a work copy of setup.sh
-cp setup-org.sh setup.sh
### paramter for mariadb build
-repo="ipfire-pbs"
+repo="ipfire-pbs-hub"
dockertag="new"
username=jonatanschlag
tag="${username}/${repo}:${dockertag}"
if [ "error" = "$back" ]; then
echo "Tagging was not successful"
fi
-rm -f setup.sh
)
--- /dev/null
+[Unit]
+Description=Pakfire Build Service - Hub
+Requires=docker.service
+After=docker.service
+[Service]
+Environment=GIT_REPO=/root/pbs
+ExecStartPre=-/usr/bin/docker stop pbs-hub
+ExecStartPre=-/usr/bin/docker rm pbs-hub
+ExecStartPre=-/usr/bin/docker pull jonatanschlag/ipfire-pbs-hub:latest
+ExecStart=/usr/bin/docker run -p 80:80 --mount type=bind,source="${GIT_REPO}",target=/opt/pbs --name=pbs-hub jonatanschlag/ipfire-pbs-hub:latest
+ExecStop=/usr/bin/docker stop pbs-hub
+
+[Install]
+WantedBy=multi-user.target
+++ /dev/null
-#!/bin/bash
-#
-#settings
-#
-="database"
-
-# build the pbs from master branch
-apt-get update -y && apt-get install -y gcc make git
-# add a user
-addgroup --gid 2000 pbs
-adduser --system --no-create-home --shell /bin/bash --uid 2000 --disabled-password --disabled-login --gid 2000 pbs
-
-# build the pot
-mkdir -p /opt/dev
-cd /opt/
-git clone -b master http://git.ipfire.org/pub/git/pbs.git
-cd pbs
-# Maybe we have to change the configuration
-#sed -i s/"mysqlpassword"/"$mysql_pass"/g config.h
-#sed -i s/"mysqlhost"/"$mysql_host"/g config.h
-#sed -i s/"authmode"/"$pot_authmode"/g config.h
-#sed -i s/"sleeptime"/"$pot_sleeptime"/g config.h
-
-./configure --prefix=/usr
-make
-make install
-# cleanup
-apt-get remove -y git make gcc
-apt-get autoremove -y
-apt-get clean
-rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /opt/dev/*
-
-# set permissions
-FROM centos:latest
+FROM jonatanschlag/ipfire-pbs-base:latest
MAINTAINER jonatanschlag
-ENV DEBIAN_FRONTEND noninteractive
+#ADD setup.sh /tmp/setup.sh
+#RUN chmod +x /tmp/setup.sh && /tmp/setup.sh
-ADD setup.sh /tmp/setup.sh
-
-RUN chmod +x /tmp/setup.sh && /tmp/setup.sh
-
-USER psb
+USER pbs
# Define default command.
-CMD [""]
+CMD ["/opt/pbs/pakfire-manager"]
. /usr/lib/docker-shell-scripts-lib/install.sh
###
-### Build the pbs Dockerimage
+### Build the pbs-manager Dockerimage
###
### preparation ###
# check for all necessary files
-CheckForFile "setup-org.sh"
CheckForFile "Dockerfile"
-#create a work copy of setup.sh
-cp setup-org.sh setup.sh
### paramter for mariadb build
-repo="ipfire-pbs"
+repo="ipfire-pbs-manager"
dockertag="new"
username=jonatanschlag
tag="${username}/${repo}:${dockertag}"
if [ "error" = "$back" ]; then
echo "Tagging was not successful"
fi
-rm -f setup.sh
)
--- /dev/null
+[Unit]
+Description=Pakfire Build Service - Manager
+Requires=docker.service
+After=docker.service
+[Service]
+Environment=GIT_REPO=/root/pbs
+ExecStartPre=-/usr/bin/docker stop pbs-manager
+ExecStartPre=-/usr/bin/docker rm pbs-manager
+ExecStartPre=-/usr/bin/docker pull jonatanschlag/ipfire-pbs-manager:latest
+ExecStart=/usr/bin/docker run -p 80:80 --mount type=bind,source="${GIT_REPO}",target=/opt/pbs --name=pbs-manager jonatanschlag/ipfire-pbs-manager:latest
+ExecStop=/usr/bin/docker stop pbs-manager
+
+[Install]
+WantedBy=multi-user.target
+++ /dev/null
-[database]
-; Credentials to the pakfire build service database.
-
-host = database
-user = pakfire
-pass = pakfire
-db = pakfire
-
-[geoip-database]
-; Credentials to the geoip database.
-
-host = database
-user = pakfire
-pass = pakfire
-db = geoip
+++ /dev/null
-#!/bin/bash
-#
-#settings
-#
-="database"
-
-# build the pbs from master branch
-apt-get update -y && apt-get install -y gcc make git
-# add a user
-addgroup --gid 2000 pbs
-adduser --system --no-create-home --shell /bin/bash --uid 2000 --disabled-password --disabled-login --gid 2000 pbs
-
-# build the pot
-mkdir -p /opt/dev
-cd /opt/
-git clone -b master http://git.ipfire.org/pub/git/pbs.git
-cd pbs
-# Maybe we have to change the configuration
-#sed -i s/"mysqlpassword"/"$mysql_pass"/g config.h
-#sed -i s/"mysqlhost"/"$mysql_host"/g config.h
-#sed -i s/"authmode"/"$pot_authmode"/g config.h
-#sed -i s/"sleeptime"/"$pot_sleeptime"/g config.h
-
-./configure --prefix=/usr
-make
-make install
-# cleanup
-apt-get remove -y git make gcc
-apt-get autoremove -y
-apt-get clean
-rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /opt/dev/*
-
-# set permissions
-FROM centos:latest
+FROM jonatanschlag/ipfire-pbs-base:latest
MAINTAINER jonatanschlag
-ADD setup.sh /tmp/setup.sh
-
-RUN chmod +x /tmp/setup.sh && /tmp/setup.sh
-
-ADD pbs.conf /opt/pbs/pbs.conf
+#ADD setup.sh /tmp/setup.sh
+#RUN chmod +x /tmp/setup.sh && /tmp/setup.sh
USER pbs
# check for all necessary files
-CheckForFile "setup-org.sh"
CheckForFile "Dockerfile"
-#create a work copy of setup.sh
-cp setup-org.sh setup.sh
### paramter for mariadb build
repo="ipfire-pbs-web"
dockertag="new"
if [ "error" = "$back" ]; then
echo "Tagging was not successful"
fi
-rm -f setup.sh
)
--- /dev/null
+[Unit]
+Description=Pakfire Build Service - Web
+Requires=docker.service
+After=docker.service
+[Service]
+Environment=GIT_REPO=/root/pbs
+ExecStartPre=-/usr/bin/docker stop pbs-web
+ExecStartPre=-/usr/bin/docker rm pbs-web
+ExecStartPre=-/usr/bin/docker pull jonatanschlag/ipfire-pbs-web:latest
+ExecStart=/usr/bin/docker run -p 80:80 --mount type=bind,source="${GIT_REPO}",target=/opt/pbs --name=pbs-web jonatanschlag/ipfire-pbs-web:latest
+ExecStop=/usr/bin/docker stop pbs-web
+
+[Install]
+WantedBy=multi-user.target
+++ /dev/null
-[database]
-; Credentials to the pakfire build service database.
-
-host = database
-user = pakfire
-pass = pakfire
-db = pakfire
-
-[geoip-database]
-; Credentials to the geoip database.
-
-host = database
-user = pakfire
-pass = pakfire
-db = geoip