1 |
commit: b475c9df9b323eab1ad2c23d1bc0026b1de596da |
2 |
Author: John R. Graham <john_r_graham <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Dec 21 17:19:07 2019 +0000 |
4 |
Commit: John R. Graham <john_r_graham <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Feb 2 23:20:51 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/forums.git/commit/?id=b475c9df |
7 |
|
8 |
Incremental progress on initial deployment environment. |
9 |
|
10 |
- Modified setup-workdir script to check out the |
11 |
gentoo-docker-images repo. |
12 |
- Moved the forums.Dockerfile into our repo. |
13 |
|
14 |
Signed-off-by: John R. Graham <john_r_graham <AT> gentoo.org> |
15 |
|
16 |
.gitignore | 1 + |
17 |
TODO | 14 +++++++------- |
18 |
misc/forums.Dockerfile | 30 ++++++++++++++++++++++++++++++ |
19 |
setup-workdir.bash | 42 +++++++++++++++++++++++++++++++++++++----- |
20 |
4 files changed, 75 insertions(+), 12 deletions(-) |
21 |
|
22 |
diff --git a/.gitignore b/.gitignore |
23 |
index 36afc36fd..71e0a966a 100644 |
24 |
--- a/.gitignore |
25 |
+++ b/.gitignore |
26 |
@@ -1,3 +1,4 @@ |
27 |
style |
28 |
phpbb |
29 |
+gentoo-docker-images |
30 |
*~ |
31 |
|
32 |
diff --git a/TODO b/TODO |
33 |
index 421b39ed4..cb0ac917e 100644 |
34 |
--- a/TODO |
35 |
+++ b/TODO |
36 |
@@ -1,7 +1,7 @@ |
37 |
-[ ] Get my Gentoo public key moved to Triton. |
38 |
-[ ] Get forums repository checked out on Triton. |
39 |
-[ ] Get forums.Dockerfile checked in to our repo. |
40 |
-[ ] Get container repository checked out in our hierarchy. Probably set up by the setup-workdir script. |
41 |
-[ ] Modify container to include nginx and play around until I have a working hello world web page. |
42 |
-[ ] Get a real certificate. Look at the certs on Ceres and try to re-discover what was done there. |
43 |
-[ ] Document the above. |
44 |
+[X] JRG: Get my Gentoo public key moved to Triton. |
45 |
+[X] JRG: Get forums repository checked out on Triton. |
46 |
+[ ] JRG: Get forums.Dockerfile checked in to our repo. |
47 |
+[X] JRG: Get container repository checked out in our hierarchy. Probably set up by the setup-workdir script. |
48 |
+[ ] JRG: Modify container to include nginx and play around until I have a working hello world web page. |
49 |
+[ ] JRG: Get a real certificate. Look at the certs on Ceres and try to re-discover what was done there. |
50 |
+[ ] JRG: Document the above. |
51 |
|
52 |
diff --git a/misc/forums.Dockerfile b/misc/forums.Dockerfile |
53 |
new file mode 100644 |
54 |
index 000000000..24ac52992 |
55 |
--- /dev/null |
56 |
+++ b/misc/forums.Dockerfile |
57 |
@@ -0,0 +1,30 @@ |
58 |
+# name the portage image |
59 |
+FROM gentoo/portage:latest as portage |
60 |
+ |
61 |
+# image is based on stage3-amd64 |
62 |
+FROM gentoo/stage3-amd64:latest |
63 |
+ |
64 |
+# copy the entire portage volume in |
65 |
+COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo |
66 |
+ |
67 |
+# continue with image build ... |
68 |
+RUN emerge -qv dev-lang/php |
69 |
+RUN emerge -qv www-servers/apache |
70 |
+RUN emerge -qv app-portage/gentoolkit |
71 |
+RUN emerge -qv dev-vcs/git |
72 |
+RUN emerge -qv app-editors/qemacs |
73 |
+ |
74 |
+# FIXME: |
75 |
+# Outside the container, check out the release branch of the phpBB. |
76 |
+# Inside the container: |
77 |
+# COPY ${path_to_phpbb} /var/www/localhost/htdocs/ |
78 |
+# Outside the container, check out the release branch of the Gentoo-Subsilver style. |
79 |
+# Inside the container: |
80 |
+# COPY ${path_to_style}/Gentoo-SUBSILVER /var/www/localhost/htdocs/styles/Gentoo-SUBSILVER |
81 |
+ |
82 |
+# Stopgap to prove it's working: |
83 |
+COPY index.html /var/www/localhost/htdocs/index.html |
84 |
+COPY startup.bash /root/startup.bash |
85 |
+ |
86 |
+CMD ["/root/startup.bash"] |
87 |
+ |
88 |
|
89 |
diff --git a/setup-workdir.bash b/setup-workdir.bash |
90 |
index 49608d5d9..03465060f 100755 |
91 |
--- a/setup-workdir.bash |
92 |
+++ b/setup-workdir.bash |
93 |
@@ -5,7 +5,7 @@ function setup_worktree() { |
94 |
branch="$2" |
95 |
|
96 |
if [[ -z "$branch" ]] ; then |
97 |
- echo "Error in call to setup_branch()." |
98 |
+ echo "Error in call to setup_worktree()." |
99 |
exit 1 |
100 |
fi |
101 |
|
102 |
@@ -17,22 +17,54 @@ function setup_worktree() { |
103 |
|
104 |
echo "Adding worktree for ${directory} source from branch ${branch} ..." |
105 |
git worktree add ${directory} ${branch} |
106 |
- let worktree_count=worktree_count+1 |
107 |
+ let setup_count=setup_count+1 |
108 |
+ else |
109 |
+ echo "Worktree for ${directory} already set up." |
110 |
+ fi |
111 |
+} |
112 |
+ |
113 |
+function setup_repo() { |
114 |
+ repo="$1" |
115 |
+ |
116 |
+ directory=`basename ${repo}` |
117 |
+ directory=${directory%%.git} |
118 |
+ |
119 |
+ if [[ -z "$directory" ]] ; then |
120 |
+ echo "Error in call to setup_repo()." |
121 |
+ exit 1 |
122 |
+ fi |
123 |
+ |
124 |
+ if [[ ! -d "${directory}" ]] ; then |
125 |
+ if [[ -e "${directory}" ]] ; then |
126 |
+ echo "Error: Strange repository structure found for directory \"${directory}\". Cannot continue with the setup." |
127 |
+ exit 1 |
128 |
+ fi |
129 |
+ |
130 |
+ echo "Cloning repository ${repo} into ${directory} ..." |
131 |
+ git clone ${repo} |
132 |
+ if [[ ! -d "${directory}" ]] ; then |
133 |
+ echo "Error: Clone did not result in expected directory \"${directory}\". Cannot continue with the setup." |
134 |
+ exit 1 |
135 |
+ fi |
136 |
+ let setup_count=setup_count+1 |
137 |
+ else |
138 |
+ echo "Repo for ${directory} already set up." |
139 |
fi |
140 |
} |
141 |
|
142 |
# set -x |
143 |
set -e |
144 |
|
145 |
-worktree_count=0 |
146 |
+setup_count=0 |
147 |
|
148 |
setup_worktree phpbb origin/3.2.x |
149 |
setup_worktree style styles/Gentoo-SUBSILVER |
150 |
+setup_repo git@××××××.com:gentoo/gentoo-docker-images.git |
151 |
|
152 |
-if [[ $worktree_count -eq 0 ]] ; then |
153 |
+if [[ $setup_count -eq 0 ]] ; then |
154 |
echo "Working directory already set up." |
155 |
else |
156 |
- echo "Working directory setup complete." |
157 |
+ echo "Working directory setup complete. ${setup_count} subdirectorues created." |
158 |
fi |
159 |
|
160 |
echo |