updated docker scripts

This commit is contained in:
Marvin Zhang
2022-06-11 13:02:40 +08:00
parent 78fe8d2960
commit c6ee25491e
4 changed files with 14 additions and 25 deletions

View File

@@ -2,4 +2,4 @@ module crawlab
go 1.16
require github.com/crawlab-team/crawlab-core v0.6.1-0.20220611032702-c31cbc7d599b
require github.com/crawlab-team/crawlab-core v0.6.1-0.20220611045456-7deb18a3b809

View File

@@ -126,6 +126,8 @@ github.com/crawlab-team/crawlab-core v0.6.0-8 h1:P1l8dBdecZ6vVxwWwOwjLtCUriSNyBA
github.com/crawlab-team/crawlab-core v0.6.0-8/go.mod h1:KqfjSkEclVY39nC58bsq3MLcuXbDnsPp/ClcBDkqOF0=
github.com/crawlab-team/crawlab-core v0.6.0-9 h1:oBwtAzafOVl2r2vLbLYClgpXDViwVVzqdXnbwC2aGj4=
github.com/crawlab-team/crawlab-core v0.6.0-9/go.mod h1:KqfjSkEclVY39nC58bsq3MLcuXbDnsPp/ClcBDkqOF0=
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.20220609124710-a6fcaa2e7ea6 h1:DGXTxMCJhLZkbBZcwHE6wisUO96nsy5rTlV7e9pQ+Kg=
github.com/crawlab-team/crawlab-core v0.6.1-0.20220609124710-a6fcaa2e7ea6/go.mod h1:KqfjSkEclVY39nC58bsq3MLcuXbDnsPp/ClcBDkqOF0=
github.com/crawlab-team/crawlab-core v0.6.1-0.20220609133021-540f1f228a89 h1:8/9AsqjaWN19379M6Pr/KXHxvRKWOE/S7SbbpzrYpIc=
@@ -138,6 +140,8 @@ github.com/crawlab-team/crawlab-core v0.6.1-0.20220611025234-152e21d0e57f h1:M0O
github.com/crawlab-team/crawlab-core v0.6.1-0.20220611025234-152e21d0e57f/go.mod h1:KqfjSkEclVY39nC58bsq3MLcuXbDnsPp/ClcBDkqOF0=
github.com/crawlab-team/crawlab-core v0.6.1-0.20220611032702-c31cbc7d599b h1:oUwe+ap4+e0WhQ6JVZ6YPALfuVKhcYzeRTgyOeKPk28=
github.com/crawlab-team/crawlab-core v0.6.1-0.20220611032702-c31cbc7d599b/go.mod h1:KqfjSkEclVY39nC58bsq3MLcuXbDnsPp/ClcBDkqOF0=
github.com/crawlab-team/crawlab-core v0.6.1-0.20220611045456-7deb18a3b809 h1:0S7Mo1wqVrCF64yiTsuINBZWVzCZozvqihTu7XP/jkU=
github.com/crawlab-team/crawlab-core v0.6.1-0.20220611045456-7deb18a3b809/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

@@ -1,18 +1,3 @@
#!/bin/bash
if [ "${CRAWLAB_NODE_MASTER}" = "Y" ]; then
# start master
/bin/bash /app/bin/docker-start-master.sh
# node type
echo "node type: master"
# start crawlab
crawlab-server master
else
# node type
echo "node type: worker"
# start crawlab
crawlab-server worker
fi
crawlab-server server

View File

@@ -1,25 +1,25 @@
#!/bin/bash
# replace env
indexpath=/app/dist/index.html
indexPath=/app/dist/index.html
if test -z "$CRAWLAB_BASE_URL"; then
:
else
sed -i "s?/js/?${CRAWLAB_BASE_URL}/js/?g" ${indexpath}
sed -i "s?/css/?${CRAWLAB_BASE_URL}/css/?g" ${indexpath}
sed -i "s/ <link rel=\"icon\" type=\"image\/x-icon\" href=\"/ <link rel=\"icon\" type=\"image\/x-icon\" href=\"\/${CRAWLAB_BASE_URL}/g" ${indexpath}
sed -i "s/ <link rel=\"stylesheet\" href=\"/ <link rel=\"stylesheet\" href=\"${CRAWLAB_BASE_URL}\//g" ${indexpath}
sed -i "s/ window.VUE_APP_API_BASE_URL = '/ window.VUE_APP_API_BASE_URL = '\/${CRAWLAB_BASE_URL}/g" ${indexpath}
sed -i "s?/js/?${CRAWLAB_BASE_URL}/js/?g" ${indexPath}
sed -i "s?/css/?${CRAWLAB_BASE_URL}/css/?g" ${indexPath}
sed -i "s/ <link rel=\"icon\" type=\"image\/x-icon\" href=\"/ <link rel=\"icon\" type=\"image\/x-icon\" href=\"\/${CRAWLAB_BASE_URL}/g" ${indexPath}
sed -i "s/ <link rel=\"stylesheet\" href=\"/ <link rel=\"stylesheet\" href=\"${CRAWLAB_BASE_URL}\//g" ${indexPath}
sed -i "s/ window.VUE_APP_API_BASE_URL = '/ window.VUE_APP_API_BASE_URL = '\/${CRAWLAB_BASE_URL}/g" ${indexPath}
fi
if test -z "$CRAWLAB_INIT_BAIDU_TONGJI"; then
:
else
sed -i "s/ window.VUE_APP_INIT_BAIDU_TONGJI = ''/ window.VUE_APP_INIT_BAIDU_TONGJI = '${CRAWLAB_INIT_BAIDU_TONGJI}'/g" ${indexpath}
sed -i "s/ window.VUE_APP_INIT_BAIDU_TONGJI = ''/ window.VUE_APP_INIT_BAIDU_TONGJI = '${CRAWLAB_INIT_BAIDU_TONGJI}'/g" ${indexPath}
fi
if test -z "$CRAWLAB_INIT_UMENG"; then
:
else
sed -i "s/ window.VUE_APP_INIT_UMENG = ''/ window.VUE_APP_INIT_UMENG = '${CRAWLAB_INIT_UMENG}'/g" ${indexpath}
sed -i "s/ window.VUE_APP_INIT_UMENG = ''/ window.VUE_APP_INIT_UMENG = '${CRAWLAB_INIT_UMENG}'/g" ${indexPath}
fi
# start nginx