mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
updated docker build
This commit is contained in:
5
.github/workflows/dockerpush.yml
vendored
5
.github/workflows/dockerpush.yml
vendored
@@ -43,3 +43,8 @@ jobs:
|
||||
|
||||
docker tag image $IMAGE_ID:$VERSION
|
||||
docker push $IMAGE_ID:$VERSION
|
||||
|
||||
if [[ $VERSION -eq "latest" ]]; then
|
||||
docker tag image $IMAGE_ID:main
|
||||
docker push $IMAGE_ID:main
|
||||
fi
|
||||
|
||||
@@ -4,12 +4,19 @@ then
|
||||
:
|
||||
else
|
||||
indexpath=/app/dist/index.html
|
||||
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}
|
||||
if [[ -v CRAWLAB_BASE_URL ]]; then
|
||||
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 [[ -v CRAWLAB_INIT_BAIDU_TONGJI ]]; then
|
||||
sed -i "s/ window.VUE_APP_INIT_BAIDU_TONGJI =/ window.VUE_APP_INIT_BAIDU_TONGJI = '${CRAWLAB_INIT_BAIDU_TONGJI}'/g" ${indexpath}
|
||||
fi
|
||||
if [[ -v CRAWLAB_INIT_UMENG ]]; then
|
||||
sed -i "s/ window.VUE_APP_INIT_UMENG =/ window.VUE_APP_INIT_UMENG = '${CRAWLAB_INIT_UMENG}'/g" ${indexpath}
|
||||
fi
|
||||
fi
|
||||
|
||||
# start nginx
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
VUE_APP_API_BASE_URL=/api
|
||||
VUE_APP_INIT_BAIDU_TONGJI=
|
||||
VUE_APP_INIT_UMENG=
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
<meta content="IE=edge" http-equiv="X-UA-Compatible">
|
||||
<meta content="width=device-width,initial-scale=1.0" name="viewport">
|
||||
<script>
|
||||
window.VUE_APP_API_BASE_URL = '<%= VUE_APP_API_BASE_URL %>'
|
||||
window.VUE_APP_API_BASE_URL = '<%= VUE_APP_API_BASE_URL %>';
|
||||
window.VUE_APP_INIT_UMENG = '<%= VUE_APP_INIT_UMENG %>';
|
||||
window.VUE_APP_INIT_BAIDU_TONGJI = '<%= VUE_APP_INIT_BAIDU_TONGJI %>';
|
||||
</script>
|
||||
<script src="/js/vue3-sfc-loader.js"></script>
|
||||
<script src="/js/umeng.js"></script>
|
||||
|
||||
@@ -3,5 +3,10 @@ import 'vue';
|
||||
import {createApp} from 'crawlab-ui';
|
||||
|
||||
(async function () {
|
||||
await createApp();
|
||||
await createApp({
|
||||
// @ts-ignore
|
||||
initBaiduTongji: window['VUE_APP_INIT_BAIDU_TONGJI'] !== 'false',
|
||||
// @ts-ignore
|
||||
initUmeng: window['VUE_APP_INIT_UMENG'] !== 'false',
|
||||
});
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user