From 18a451ed0758a4f9736fd4ac68d3c51e4ea8d773 Mon Sep 17 00:00:00 2001
From: startxfr
Date: Sat, 28 Nov 2015 14:13:04 +0100
Subject: change in os startup
---
OS/Dockerfile | 5 ++-
OS/docker-compose.yml | 8 +++--
OS/run.sh | 4 +++
OS/sx-lib.sh | 18 +++++++++++
Services/apache/html/index.html | 68 -----------------------------------------
Services/apache/httpd.sh | 50 ++++++++++++++++++++++++++++++
Services/apache/index.html | 68 +++++++++++++++++++++++++++++++++++++++++
Services/apache/run.sh | 7 +++++
Services/apache/sx/httpd.sh | 50 ------------------------------
Services/apache/sx/httpd_run.sh | 7 -----
docker-compose.yml | 20 ++++++------
run-tests.sh | 5 +--
12 files changed, 168 insertions(+), 142 deletions(-)
create mode 100644 OS/run.sh
create mode 100644 OS/sx-lib.sh
delete mode 100644 Services/apache/html/index.html
create mode 100644 Services/apache/httpd.sh
create mode 100644 Services/apache/index.html
create mode 100644 Services/apache/run.sh
delete mode 100644 Services/apache/sx/httpd.sh
delete mode 100644 Services/apache/sx/httpd_run.sh
diff --git a/OS/Dockerfile b/OS/Dockerfile
index ce00afb..878005c 100644
--- a/OS/Dockerfile
+++ b/OS/Dockerfile
@@ -7,4 +7,7 @@ RUN dnf -y install deltarpm pwgen tar python-dnf-plugins-extras-migrate && \
dnf-2 migrate && \
dnf -y install psmisc coreutils findutils wget logrotate && \
dnf clean all
-RUN mkdir -p /sx
+COPY *.sh /bin/
+RUN chmod 775 /bin/sx-lib.sh /bin/run.sh
+
+CMD ["/bin/run.sh"]
diff --git a/OS/docker-compose.yml b/OS/docker-compose.yml
index 65ce1f3..c79d5d9 100644
--- a/OS/docker-compose.yml
+++ b/OS/docker-compose.yml
@@ -4,5 +4,9 @@ server:
container_name: "sx-fedora"
mem_limit: 1g
memswap_limit: 2g
- cpu_shares: 4096
- restart: "on-failure:2"
\ No newline at end of file
+ cpu_shares: 2
+ restart: "on-failure:2"
+ environment:
+ CONTAINER_SERVICE: "os"
+ CONTAINER_TYPE: "fedora"
+ CONTAINER_INSTANCE: "sx-fedora"
\ No newline at end of file
diff --git a/OS/run.sh b/OS/run.sh
new file mode 100644
index 0000000..ca12432
--- /dev/null
+++ b/OS/run.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+source /bin/sx-lib.sh
+
+display_container_header
\ No newline at end of file
diff --git a/OS/sx-lib.sh b/OS/sx-lib.sh
new file mode 100644
index 0000000..2fcb5aa
--- /dev/null
+++ b/OS/sx-lib.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+export TERM=dumb
+
+function display_container_header {
+ echo "+====================================================="
+ echo "| Container : $HOSTNAME"
+ if [ -v CONTAINER_TYPE ]; then
+ echo "| Type : $CONTAINER_TYPE"
+ fi
+ if [ -v CONTAINER_INSTANCE ]; then
+ echo "| Instance : $CONTAINER_INSTANCE"
+ fi
+ if [ -v CONTAINER_SERVICE ]; then
+ echo "| Service : $CONTAINER_SERVICE"
+ fi
+ echo "+====================================================="
+}
diff --git a/Services/apache/html/index.html b/Services/apache/html/index.html
deleted file mode 100644
index 9c72bb2..0000000
--- a/Services/apache/html/index.html
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
- STARTX Webserver container
-
-
-
-
-
- STARTX Webserver
- Online
-
-
-
-
- You are actually running an apache webserver running under the latest fedora release. For more information about this container and how to add your content instead of this message, please read the following links.
-
-
-
-
-
\ No newline at end of file
diff --git a/Services/apache/httpd.sh b/Services/apache/httpd.sh
new file mode 100644
index 0000000..0220984
--- /dev/null
+++ b/Services/apache/httpd.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+export TERM=dumb
+export HTTPDCONF=/etc/httpd/conf.d/sx.conf
+
+# Begin configuration before starting daemonized process
+# and start generating host keys
+function begin_config {
+ echo "=> Begin httpd configuration for host $HOSTNAME"
+ mkdir -p /var/run/httpd
+ if [ -z "$DOCROOT" ]; then
+ echo "===> Changing document root to $DOCROOT"
+ ${DOCROOT=/var/www/html}
+ echo "DocumentRoot \"$DOCROOT\"" >> $HTTPDCONF
+ fi
+}
+
+# End configuration process just before starting daemon
+function end_config {
+ stop_server
+ echo "=> End httpd configuration ..."
+}
+
+# Start the httpd server in background. Used to perform config
+# against the database structure such as user creation
+function start_server {
+ echo "===> Starting httpd server ..."
+ /usr/sbin/apachectl &
+ sleep 8
+}
+
+# Stop the httpd server running in background.
+function stop_server {
+ echo "===> Stopping httpd server ..."
+ killall httpd
+ rm -rf /run/httpd/*
+ sleep 8
+}
+
+# Start the httpd server as a deamon and execute it inside
+# the running shell
+function start_daemon {
+ echo "=> Starting httpd daemon ..."
+ exec /usr/sbin/apachectl -D FOREGROUND
+}
+
+
+if [[ "$0" == *"httpd.sh" && ! $1 = "" ]];then
+ eval "$@";
+fi
\ No newline at end of file
diff --git a/Services/apache/index.html b/Services/apache/index.html
new file mode 100644
index 0000000..9c72bb2
--- /dev/null
+++ b/Services/apache/index.html
@@ -0,0 +1,68 @@
+
+
+
+ STARTX Webserver container
+
+
+
+
+
+ STARTX Webserver
+ Online
+
+
+
+
+ You are actually running an apache webserver running under the latest fedora release. For more information about this container and how to add your content instead of this message, please read the following links.
+
+
+
+
+
\ No newline at end of file
diff --git a/Services/apache/run.sh b/Services/apache/run.sh
new file mode 100644
index 0000000..ef073a3
--- /dev/null
+++ b/Services/apache/run.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+source /sx/httpd.sh
+
+begin_config
+end_config
+
+start_daemon
\ No newline at end of file
diff --git a/Services/apache/sx/httpd.sh b/Services/apache/sx/httpd.sh
deleted file mode 100644
index 0220984..0000000
--- a/Services/apache/sx/httpd.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/bash
-
-export TERM=dumb
-export HTTPDCONF=/etc/httpd/conf.d/sx.conf
-
-# Begin configuration before starting daemonized process
-# and start generating host keys
-function begin_config {
- echo "=> Begin httpd configuration for host $HOSTNAME"
- mkdir -p /var/run/httpd
- if [ -z "$DOCROOT" ]; then
- echo "===> Changing document root to $DOCROOT"
- ${DOCROOT=/var/www/html}
- echo "DocumentRoot \"$DOCROOT\"" >> $HTTPDCONF
- fi
-}
-
-# End configuration process just before starting daemon
-function end_config {
- stop_server
- echo "=> End httpd configuration ..."
-}
-
-# Start the httpd server in background. Used to perform config
-# against the database structure such as user creation
-function start_server {
- echo "===> Starting httpd server ..."
- /usr/sbin/apachectl &
- sleep 8
-}
-
-# Stop the httpd server running in background.
-function stop_server {
- echo "===> Stopping httpd server ..."
- killall httpd
- rm -rf /run/httpd/*
- sleep 8
-}
-
-# Start the httpd server as a deamon and execute it inside
-# the running shell
-function start_daemon {
- echo "=> Starting httpd daemon ..."
- exec /usr/sbin/apachectl -D FOREGROUND
-}
-
-
-if [[ "$0" == *"httpd.sh" && ! $1 = "" ]];then
- eval "$@";
-fi
\ No newline at end of file
diff --git a/Services/apache/sx/httpd_run.sh b/Services/apache/sx/httpd_run.sh
deleted file mode 100644
index ef073a3..0000000
--- a/Services/apache/sx/httpd_run.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-source /sx/httpd.sh
-
-begin_config
-end_config
-
-start_daemon
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
index d97b2e8..0156a71 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -3,9 +3,9 @@ fedora:
container_name: "startx-fedora"
command: cat /etc/redhat-release
-apache:
- build: Services/apache/
- container_name: "startx-sv-apache"
+#apache:
+# build: Services/apache/
+# container_name: "startx-sv-apache"
#mariadb:
# build: Services/mariadb/
@@ -19,18 +19,18 @@ apache:
# build: Services/mongo/
# container_name: "startx-sv-mongo"
-nodejs:
- build: Services/nodejs/
- container_name: "startx-sv-nodejs"
- command: node /app/app.js
+#nodejs:
+# build: Services/nodejs/
+# container_name: "startx-sv-nodejs"
+# command: node /app/app.js
#ooconv:
# build: Services/ooconv/
# container_name: "startx-sv-ooconv"
-php:
- build: Services/php/
- container_name: "startx-sv-php"
+#php:
+# build: Services/php/
+# container_name: "startx-sv-php"
#postgres:
# build: Services/postgres/
diff --git a/run-tests.sh b/run-tests.sh
index 0b7cade..b81f952 100755
--- a/run-tests.sh
+++ b/run-tests.sh
@@ -6,7 +6,4 @@ git clone https://github.com/startxfr/docker-images.git /tmp/startx-docker-image
sudo docker-compose build
sudo docker-compose up -d
sudo docker-compose logs
-echo $TRAVIS_PULL_REQUEST
-if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
- exit 0;
-fi
\ No newline at end of file
+exit 0;
\ No newline at end of file
--
cgit v1.2.3