[Why]
This service ties up different dirs to the same service.
However we'll need the flexibility to hold the dirs in different file
servers.
[How]
one service per dir, and access-like:
result: http://$host:11300/
pub: http://$host:11302/
initrd: http://$host:11303/
os: http://$host:11304/
git: http://$host:11305/
cci: http://$host:11306/
Signed-off-by: Lu Weitao <luweitaobe(a)163.com>
---
container/srv-http/start | 27 ++++++---------------------
container/srv-http/start-cci | 19 +++++++++++++++++++
container/srv-http/start-git | 19 +++++++++++++++++++
container/srv-http/start-initrd | 20 ++++++++++++++++++++
container/srv-http/start-os | 19 +++++++++++++++++++
container/srv-http/start-pub | 19 +++++++++++++++++++
container/srv-http/start-result | 19 +++++++++++++++++++
7 files changed, 121 insertions(+), 21 deletions(-)
create mode 100755 container/srv-http/start-cci
create mode 100755 container/srv-http/start-git
create mode 100755 container/srv-http/start-initrd
create mode 100755 container/srv-http/start-os
create mode 100755 container/srv-http/start-pub
create mode 100755 container/srv-http/start-result
diff --git a/container/srv-http/start b/container/srv-http/start
index fa56fca..f262d81 100755
--- a/container/srv-http/start
+++ b/container/srv-http/start
@@ -2,24 +2,9 @@
# SPDX-License-Identifier: MulanPSL-2.0+
# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
-. $CCI_SRC/container/defconfig.sh
-docker_rm srv-http
-
-cmd=(
- docker run
- --restart=always
- --name srv-http
- -p 11300:11300
- -v /srv/pub:/srv/pub:ro
- -v /etc/localtime:/etc/localtime:ro
- -v /srv/result:/srv/result:ro
- -v /srv/initrd/qemu-image:/srv/initrd/qemu-image:ro
- -v /srv/initrd/dockerimage:/srv/initrd/dockerimage:ro
- -v /srv/os:/srv/os:ro
- -v /srv/git/archlinux:/srv/git/archlinux:ro
- -v /srv/cci/libvirt-xml:/srv/cci/libvirt-xml:ro
- -d
- srv-http
-)
-
-"${cmd[@]}"
+./start-pub
+./start-result
+./start-initrd
+./start-os
+./start-git
+./start-cci
diff --git a/container/srv-http/start-cci b/container/srv-http/start-cci
new file mode 100755
index 0000000..78ab149
--- /dev/null
+++ b/container/srv-http/start-cci
@@ -0,0 +1,19 @@
+#!/bin/bash
+# SPDX-License-Identifier: MulanPSL-2.0+
+# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+
+. $CCI_SRC/container/defconfig.sh
+docker_rm srv-http-cci
+
+cmd=(
+ docker run
+ --restart=always
+ --name srv-http-cci
+ -p 11306:11300
+ -v /srv/cci/libvirt-xml:/srv/cci/libvirt-xml:ro
+ -v /etc/localtime:/etc/localtime:ro
+ -d
+ srv-http
+)
+
+"${cmd[@]}"
diff --git a/container/srv-http/start-git b/container/srv-http/start-git
new file mode 100755
index 0000000..f2292bf
--- /dev/null
+++ b/container/srv-http/start-git
@@ -0,0 +1,19 @@
+#!/bin/bash
+# SPDX-License-Identifier: MulanPSL-2.0+
+# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+
+. $CCI_SRC/container/defconfig.sh
+docker_rm srv-http-git
+
+cmd=(
+ docker run
+ --restart=always
+ --name srv-http-git
+ -p 11305:11300
+ -v /srv/git/archlinux:/srv/git/archlinux:ro
+ -v /etc/localtime:/etc/localtime:ro
+ -d
+ srv-http
+)
+
+"${cmd[@]}"
diff --git a/container/srv-http/start-initrd b/container/srv-http/start-initrd
new file mode 100755
index 0000000..7c73ea1
--- /dev/null
+++ b/container/srv-http/start-initrd
@@ -0,0 +1,20 @@
+#!/bin/bash
+# SPDX-License-Identifier: MulanPSL-2.0+
+# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+
+. $CCI_SRC/container/defconfig.sh
+docker_rm srv-http-initrd
+
+cmd=(
+ docker run
+ --restart=always
+ --name srv-http-initrd
+ -p 11303:11300
+ -v /srv/initrd/qemu-image:/srv/initrd/qemu-image:ro
+ -v /srv/initrd/dockerimage:/srv/initrd/dockerimage:ro
+ -v /etc/localtime:/etc/localtime:ro
+ -d
+ srv-http
+)
+
+"${cmd[@]}"
diff --git a/container/srv-http/start-os b/container/srv-http/start-os
new file mode 100755
index 0000000..bb344cf
--- /dev/null
+++ b/container/srv-http/start-os
@@ -0,0 +1,19 @@
+#!/bin/bash
+# SPDX-License-Identifier: MulanPSL-2.0+
+# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+
+. $CCI_SRC/container/defconfig.sh
+docker_rm srv-http-os
+
+cmd=(
+ docker run
+ --restart=always
+ --name srv-http-os
+ -p 11304:11300
+ -v /srv/os:/srv/os:ro
+ -v /etc/localtime:/etc/localtime:ro
+ -d
+ srv-http
+)
+
+"${cmd[@]}"
diff --git a/container/srv-http/start-pub b/container/srv-http/start-pub
new file mode 100755
index 0000000..dc1864c
--- /dev/null
+++ b/container/srv-http/start-pub
@@ -0,0 +1,19 @@
+#!/bin/bash
+# SPDX-License-Identifier: MulanPSL-2.0+
+# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+
+. $CCI_SRC/container/defconfig.sh
+docker_rm srv-http-pub
+
+cmd=(
+ docker run
+ --restart=always
+ --name srv-http-pub
+ -p 11302:11300
+ -v /srv/pub:/srv/pub:ro
+ -v /etc/localtime:/etc/localtime:ro
+ -d
+ srv-http
+)
+
+"${cmd[@]}"
diff --git a/container/srv-http/start-result b/container/srv-http/start-result
new file mode 100755
index 0000000..f9ecc97
--- /dev/null
+++ b/container/srv-http/start-result
@@ -0,0 +1,19 @@
+#!/bin/bash
+# SPDX-License-Identifier: MulanPSL-2.0+
+# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+
+. $CCI_SRC/container/defconfig.sh
+docker_rm srv-http-result
+
+cmd=(
+ docker run
+ --restart=always
+ --name srv-http-result
+ -p 11300:11300
+ -v /srv/result:/srv/result:ro
+ -v /etc/localtime:/etc/localtime:ro
+ -d
+ srv-http
+)
+
+"${cmd[@]}"
--
2.23.0