Initial code check in
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Fri, 15 Sep 2017 14:37:09 +0000 (16:37 +0200)
committerJonatan Schlag <jonatan.schlag@ipfire.org>
Fri, 15 Sep 2017 14:37:09 +0000 (16:37 +0200)
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
src/pbs-hub/Dockerfile [new file with mode: 0644]
src/pbs-hub/build.sh [new file with mode: 0755]
src/pbs-hub/setup-org.sh [new file with mode: 0644]
src/pbs-manager/Dockerfile [new file with mode: 0644]
src/pbs-manager/build.sh [new file with mode: 0755]
src/pbs-manager/pbs.conf [new file with mode: 0644]
src/pbs-manager/setup-org.sh [new file with mode: 0644]
src/pbs-web/Dockerfile [new file with mode: 0644]
src/pbs-web/build.sh [new file with mode: 0755]
src/pbs-web/pbs.conf [new file with mode: 0644]
src/pbs-web/setup-org.sh [new file with mode: 0644]

diff --git a/src/pbs-hub/Dockerfile b/src/pbs-hub/Dockerfile
new file mode 100644 (file)
index 0000000..4115459
--- /dev/null
@@ -0,0 +1,14 @@
+FROM centos:latest
+MAINTAINER jonatanschlag
+
+ENV DEBIAN_FRONTEND noninteractive
+
+ADD setup.sh /tmp/setup.sh
+RUN chmod +x /tmp/setup.sh && /tmp/setup.sh
+
+USER psb 
+
+# Define default command.
+CMD [""]
+
diff --git a/src/pbs-hub/build.sh b/src/pbs-hub/build.sh
new file mode 100755 (executable)
index 0000000..b473ceb
--- /dev/null
@@ -0,0 +1,37 @@
+#!/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 pbs 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"
+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
+)
diff --git a/src/pbs-hub/setup-org.sh b/src/pbs-hub/setup-org.sh
new file mode 100644 (file)
index 0000000..5a693b3
--- /dev/null
@@ -0,0 +1,33 @@
+#!/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
diff --git a/src/pbs-manager/Dockerfile b/src/pbs-manager/Dockerfile
new file mode 100644 (file)
index 0000000..4115459
--- /dev/null
@@ -0,0 +1,14 @@
+FROM centos:latest
+MAINTAINER jonatanschlag
+
+ENV DEBIAN_FRONTEND noninteractive
+
+ADD setup.sh /tmp/setup.sh
+RUN chmod +x /tmp/setup.sh && /tmp/setup.sh
+
+USER psb 
+
+# Define default command.
+CMD [""]
+
diff --git a/src/pbs-manager/build.sh b/src/pbs-manager/build.sh
new file mode 100755 (executable)
index 0000000..b473ceb
--- /dev/null
@@ -0,0 +1,37 @@
+#!/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 pbs 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"
+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
+)
diff --git a/src/pbs-manager/pbs.conf b/src/pbs-manager/pbs.conf
new file mode 100644 (file)
index 0000000..8b477cb
--- /dev/null
@@ -0,0 +1,15 @@
+[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
diff --git a/src/pbs-manager/setup-org.sh b/src/pbs-manager/setup-org.sh
new file mode 100644 (file)
index 0000000..5a693b3
--- /dev/null
@@ -0,0 +1,33 @@
+#!/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
diff --git a/src/pbs-web/Dockerfile b/src/pbs-web/Dockerfile
new file mode 100644 (file)
index 0000000..797f3f7
--- /dev/null
@@ -0,0 +1,14 @@
+FROM centos: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
+
+USER pbs 
+
+# Define default command.
+CMD ["/opt/pbs/pakfire-web"]
+
diff --git a/src/pbs-web/build.sh b/src/pbs-web/build.sh
new file mode 100755 (executable)
index 0000000..d0df259
--- /dev/null
@@ -0,0 +1,37 @@
+#!/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 pbs-web 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-web"
+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
+)
diff --git a/src/pbs-web/pbs.conf b/src/pbs-web/pbs.conf
new file mode 100644 (file)
index 0000000..8b477cb
--- /dev/null
@@ -0,0 +1,15 @@
+[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
diff --git a/src/pbs-web/setup-org.sh b/src/pbs-web/setup-org.sh
new file mode 100644 (file)
index 0000000..3b79545
--- /dev/null
@@ -0,0 +1,51 @@
+#!/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
+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
+
+# add a user
+groupadd -g 2000 pbs
+useradd --system --no-create-home --shell /bin/bash --uid 2000 --gid 2000 pbs
+
+mkdir -p /opt/dev
+log "Building pakfire"
+cd /opt/dev
+git clone -b master  http://git.ipfire.org/pub/git/pakfire.git
+cd pakfire
+./autogen.sh
+./configure --prefix=/usr
+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 autoremove -y
+yum clean all
+rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /opt/dev/*
+
+# set permissions