diff --git a/Jenkinsfile b/Jenkinsfile
index c757366e..7a46844b 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -12,11 +12,13 @@ pipeline {
script {
if (env.GIT_BRANCH == 'develop') {
env.MODE = 'develop'
+ env.TAG = 'develop'
+ env.BASE_URL = '/dev'
} else if (env.GIT_BRANCH == 'master') {
env.MODE = 'production'
- } else {
- env.MODE = 'test'
- }
+ env.TAG = 'master'
+ env.BASE_URL = '/demo'
+ }
}
}
}
@@ -24,7 +26,7 @@ pipeline {
steps {
echo "Building..."
sh """
- docker build -t tikazyq/crawlab:latest -f Dockerfile.local .
+ docker build -t tikazyq/crawlab:${ENV:TAG} -f Dockerfile.local .
"""
}
}
@@ -37,9 +39,12 @@ pipeline {
steps {
echo 'Deploying....'
sh """
- cd ./jenkins
+ echo ${ENV:GIT_BRANCH}
+ """
+ sh """
+ cd ./jenkins/${ENV:GIT_BRANCH}
docker-compose stop | true
- docker-compose up -d
+ docker-compose up -d --scale worker=3
"""
}
}
diff --git a/frontend/src/components/InfoView/SpiderInfoView.vue b/frontend/src/components/InfoView/SpiderInfoView.vue
index 7bd6b99f..45560c60 100644
--- a/frontend/src/components/InfoView/SpiderInfoView.vue
+++ b/frontend/src/components/InfoView/SpiderInfoView.vue
@@ -29,7 +29,7 @@
-
+
+ border
+ @row-click="onRowClick"
+ >
+
+
diff --git a/frontend/src/views/task/TaskDetail.vue b/frontend/src/views/task/TaskDetail.vue
index 67d4e582..a1edb497 100644
--- a/frontend/src/views/task/TaskDetail.vue
+++ b/frontend/src/views/task/TaskDetail.vue
@@ -83,7 +83,7 @@ export default {
},
methods: {
onTabClick (tab) {
- this.$st.sendEv('任务详情', '切换标签', 'tabName', tab.name)
+ this.$st.sendEv('任务详情', '切换标签', tab.name)
},
onSpiderChange (id) {
this.$router.push(`/spiders/${id}`)
diff --git a/frontend/src/views/task/TaskList.vue b/frontend/src/views/task/TaskList.vue
index bf011453..e15aa661 100644
--- a/frontend/src/views/task/TaskList.vue
+++ b/frontend/src/views/task/TaskList.vue
@@ -36,7 +36,9 @@
+ border
+ @row-click="onRowClick"
+ >
+
+
diff --git a/frontend/vue.config.js b/frontend/vue.config.js
new file mode 100644
index 00000000..c867140e
--- /dev/null
+++ b/frontend/vue.config.js
@@ -0,0 +1,3 @@
+module.exports = {
+ publicPath: process.env.BASE_URL || '/'
+}
diff --git a/jenkins/develop/docker-compose.yaml b/jenkins/develop/docker-compose.yaml
new file mode 100644
index 00000000..cf466671
--- /dev/null
+++ b/jenkins/develop/docker-compose.yaml
@@ -0,0 +1,35 @@
+version: '3.3'
+services:
+ master:
+ image: "tikazyq/crawlab:develop"
+ environment:
+ CRAWLAB_API_ADDRESS: "crawlab.cn/dev/api"
+ CRAWLAB_SERVER_MASTER: "Y"
+ CRAWLAB_MONGO_HOST: "mongo"
+ CRAWLAB_REDIS_ADDRESS: "redis"
+ CRAWLAB_LOG_PATH: "/var/logs/crawlab"
+ ports:
+ - "8090:8080" # frontend
+ - "8010:8000" # backend
+ depends_on:
+ - mongo
+ - redis
+ worker:
+ image: "tikazyq/crawlab:develop"
+ environment:
+ CRAWLAB_SERVER_MASTER: "N"
+ CRAWLAB_MONGO_HOST: "mongo"
+ CRAWLAB_REDIS_ADDRESS: "redis"
+ depends_on:
+ - mongo
+ - redis
+ mongo:
+ image: mongo:latest
+ restart: always
+ ports:
+ - "27027:27017"
+ redis:
+ image: redis:latest
+ restart: always
+ ports:
+ - "6389:6379"
\ No newline at end of file
diff --git a/jenkins/docker-compose.yml b/jenkins/master/docker-compose.yaml
similarity index 81%
rename from jenkins/docker-compose.yml
rename to jenkins/master/docker-compose.yaml
index 924922a0..0bcaee3a 100644
--- a/jenkins/docker-compose.yml
+++ b/jenkins/master/docker-compose.yaml
@@ -1,8 +1,7 @@
version: '3.3'
services:
master:
- image: tikazyq/crawlab:latest
- container_name: master
+ image: "tikazyq/crawlab:master"
environment:
CRAWLAB_API_ADDRESS: "crawlab.cn/api"
CRAWLAB_SERVER_MASTER: "Y"
@@ -16,8 +15,7 @@ services:
- mongo
- redis
worker:
- image: tikazyq/crawlab:latest
- container_name: worker
+ image: "tikazyq/crawlab:master"
environment:
CRAWLAB_SERVER_MASTER: "N"
CRAWLAB_MONGO_HOST: "mongo"
@@ -25,7 +23,6 @@ services:
depends_on:
- mongo
- redis
- replicas: 3
mongo:
image: mongo:latest
restart: always