Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

feat(build): merge build script from feature plugin

LinkinStarsc976b79bfd0d
diff --git a/Dockerfile b/Dockerfile
index c1bd53ba..2610e040 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -25,9 +25,11 @@ ARG CGO_EXTRA_CFLAGS
COPY . ${BUILD_DIR}
WORKDIR ${BUILD_DIR}
COPY --from=node-builder /tmp/build ${BUILD_DIR}/ui/build
-RUN apk --no-cache add build-base git \
- && make clean build \
- && cp answer /usr/bin/answer
+RUN apk --no-cache add build-base git bash \
+ && make clean build
+RUN chmod 755 answer
+RUN ["/bin/bash","-c","script/build_plugin.sh"]
+RUN cp answer /usr/bin/answer
RUN mkdir -p /data/uploads && chmod 777 /data/uploads \
&& mkdir -p /data/i18n && cp -r i18n/*.yaml /data/i18n
diff --git a/script/build_plugin.sh b/script/build_plugin.sh
new file mode 100644
index 00000000..010a477e
--- /dev/null
+++ b/script/build_plugin.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+plugin_file=./script/plugin_list
+if [ ! -f "$plugin_file" ]; then
+ echo "plugin_list is not exist"
+ exit 0
+fi
+num=0
+for line in `cat $plugin_file`
+do
+ account=$line
+ accounts[$num]=$account
+ ((num++))
+done
+if [ $num -eq 0 ]; then
+ echo "plugin_list is null"
+ exit 0
+fi
+cmd="./answer build "
+for repo in ${accounts[@]}
+do
+echo ${repo}
+cmd=$cmd" --with "${repo}
+done
+$cmd
+if [ ! -f "./new_answer" ]; then
+ echo "new_answer is not exist build failed"
+ exit 0
+fi
+rm answer
+mv new_answer answer
+./answer plugin
\ No newline at end of file
diff --git a/script/plugin_list b/script/plugin_list
new file mode 100644
index 00000000..a7cfc670
--- /dev/null
+++ b/script/plugin_list
@@ -0,0 +1 @@
+github.com/answerdev/plugins/connector/basic@latest
\ No newline at end of file