fixed unable to start plugins issue

This commit is contained in:
Marvin Zhang
2022-05-25 22:08:30 +08:00
parent ce334a7026
commit d409a3bcdf
6 changed files with 38 additions and 12 deletions

View File

@@ -24,9 +24,6 @@ FROM ubuntu:20.04
# set as non-interactive
ENV DEBIAN_FRONTEND noninteractive
# set CRAWLAB_IS_DOCKER
ENV CRAWLAB_IS_DOCKER Y
# install packages
RUN chmod 777 /tmp \
&& apt-get update \
@@ -67,6 +64,9 @@ COPY --from=frontend-build /app/dist /app/dist
# copy nginx config files
COPY ./nginx/crawlab.conf /etc/nginx/conf.d
# install plugins
RUN /bin/bash /app/bin/docker-install-plugins.sh
# working directory
WORKDIR /app/backend
@@ -77,6 +77,9 @@ ENV TZ Asia/Shanghai
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
# docker
ENV CRAWLAB_DOCKER Y
# frontend port
EXPOSE 8080

View File

@@ -24,9 +24,6 @@ FROM ubuntu:20.04
# set as non-interactive
ENV DEBIAN_FRONTEND noninteractive
# set CRAWLAB_IS_DOCKER
ENV CRAWLAB_IS_DOCKER Y
# install packages
RUN chmod 777 /tmp \
&& apt-get update \
@@ -67,6 +64,9 @@ COPY --from=frontend-build /app/dist /app/dist
# copy nginx config files
COPY ./nginx/crawlab.conf /etc/nginx/conf.d
# install plugins
RUN /bin/bash /app/bin/docker-install-plugins.sh
# working directory
WORKDIR /app/backend

View File

@@ -24,9 +24,6 @@ FROM ubuntu:20.04
# set as non-interactive
ENV DEBIAN_FRONTEND noninteractive
# set CRAWLAB_IS_DOCKER
ENV CRAWLAB_IS_DOCKER Y
# install packages
RUN chmod 777 /tmp \
&& apt-get update \
@@ -67,6 +64,9 @@ COPY --from=frontend-build /app/dist /app/dist
# copy nginx config files
COPY ./nginx/crawlab.conf /etc/nginx/conf.d
# install plugins
RUN /bin/bash /app/bin/docker-install-plugins.sh
# working directory
WORKDIR /app/backend

View File

@@ -2,4 +2,4 @@ module crawlab
go 1.16
require github.com/crawlab-team/crawlab-core v0.6.0
require github.com/crawlab-team/crawlab-core v0.6.1-0.20220525140504-682459bd0071

View File

@@ -122,8 +122,8 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/crawlab-team/crawlab-core v0.0.1/go.mod h1:6dJHMvrmIJbfYHhYNeGZkGOLEBvur+yGiFzLCRXx92k=
github.com/crawlab-team/crawlab-core v0.6.0 h1:CGxdztjcIkozZp2EHXFN1brvKxIAdD0Xe1l4c+SFNE8=
github.com/crawlab-team/crawlab-core v0.6.0/go.mod h1:KqfjSkEclVY39nC58bsq3MLcuXbDnsPp/ClcBDkqOF0=
github.com/crawlab-team/crawlab-core v0.6.1-0.20220525140504-682459bd0071 h1:b7eDJjxAZMr/Lvx6PMeV8/4SRScV7Ixw3HX6t2XhU48=
github.com/crawlab-team/crawlab-core v0.6.1-0.20220525140504-682459bd0071/go.mod h1:KqfjSkEclVY39nC58bsq3MLcuXbDnsPp/ClcBDkqOF0=
github.com/crawlab-team/crawlab-db v0.0.2/go.mod h1:o7o4rbcyAWlFGHg9VS7V7tM/GqRq+N2mnAXO71cZA78=
github.com/crawlab-team/crawlab-db v0.6.0-beta.20220417.1300 h1:2EymVIiOspX28qNC1Qon3W1fzXKQ8hi6ho3QtXB4w6k=
github.com/crawlab-team/crawlab-db v0.6.0-beta.20220417.1300/go.mod h1:gfeF0nAnFuup6iYvgHkY0in/HpO/+JktXqVNMdhoxhU=

View File

@@ -0,0 +1,23 @@
#!/bin/bash
function install_plugin() {
# plugins executables directory
local bin_path="/app/plugins/bin"
if [ -d $bin_path ]; then
mkdir "$bin_path"
fi
# plugin name
local name=$1
local url="https://github.com/crawlab-team/${name}"
local repo_path=""/app/plugins/${name}
git clone "$url" "$repo_path"
cd "$repo_path" && go build -o "${bin_path}/${name}"
chmod +x "${bin_path}/${name}"
}
plugin_names="plugin-dependency plugin-notification plugin-spider-assistant"
for name in $plugin_names; do
install_plugin "$name"
done