mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
3
.gitignore
vendored
3
.gitignore
vendored
@@ -113,3 +113,6 @@ node_modules/
|
||||
|
||||
# .DS_Store
|
||||
.DS_Store
|
||||
|
||||
.docks
|
||||
.docs
|
||||
59
Jenkinsfile
vendored
Normal file
59
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
pipeline {
|
||||
agent {
|
||||
node {
|
||||
label 'crawlab'
|
||||
}
|
||||
}
|
||||
|
||||
environment {
|
||||
HOME = '/home/yeqing'
|
||||
NODE_HOME = '/home/yeqing/.nvm/versions/node/v8.12.0'
|
||||
ROOT_DIR = "/home/yeqing/jenkins_home/workspace/crawlab_${GIT_BRANCH}"
|
||||
PYTHON_HOME = '/home/yeqing/.pyenv/shims'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Setup') {
|
||||
steps {
|
||||
echo "Running Setup..."
|
||||
// sh '. /home/yeqing/.profile'
|
||||
script {
|
||||
if (env.GIT_BRANCH == 'develop') {
|
||||
env.MODE = 'test'
|
||||
} else if (env.GIT_BRANCH == 'master') {
|
||||
env.MODE = 'production'
|
||||
} else {
|
||||
env.MODE = 'test'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build Frontend') {
|
||||
steps {
|
||||
echo "Building frontend..."
|
||||
// sh "${NODE_HOME}/bin/node ${NODE_HOME}/bin/npm install -g yarn pm2 --registry=http://registry.npm.taobao.org/"
|
||||
sh "cd ${ROOT_DIR}/frontend && ${NODE_HOME}/bin/node ${NODE_HOME}/bin/yarn install --registry=http://registry.npm.taobao.org/ --scripts-prepend-node-path=${NODE_HOME}/bin/node"
|
||||
sh "cd ${ROOT_DIR}/frontend && ${NODE_HOME}/bin/node ${ROOT_DIR}/frontend/node_modules/.bin/vue-cli-service build --mode=${MODE}"
|
||||
}
|
||||
}
|
||||
stage('Build Backend') {
|
||||
steps {
|
||||
echo "Building backend..."
|
||||
sh "${PYTHON_HOME}/pip install -r ${ROOT_DIR}/crawlab/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple"
|
||||
}
|
||||
}
|
||||
stage('Test') {
|
||||
steps {
|
||||
echo 'Testing..'
|
||||
}
|
||||
}
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
echo 'Deploying....'
|
||||
sh "${NODE_HOME}/bin/node ${NODE_HOME}/bin/pm2 restart app"
|
||||
sh "${NODE_HOME}/bin/node ${NODE_HOME}/bin/pm2 restart run_flower"
|
||||
sh "${NODE_HOME}/bin/node ${NODE_HOME}/bin/pm2 restart run_worker"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
# Crawlab
|
||||
|
||||

|
||||

|
||||
<a href="https://github.com/tikazyq/crawlab/blob/master/LICENSE" target="_blank">
|
||||
<img src="https://img.shields.io/badge/License-BSD-blue.svg">
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# Crawlab
|
||||
|
||||

|
||||

|
||||
<a href="https://github.com/tikazyq/crawlab/blob/master/LICENSE" target="_blank">
|
||||
<img src="https://img.shields.io/badge/License-BSD-blue.svg">
|
||||
<img src="https://img.shields.io/badge/license-BSD-blue.svg">
|
||||
</a>
|
||||
|
||||
[中文](https://github.com/tikazyq/crawlab/blob/master/README-zh.md) | English
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import sys
|
||||
import os
|
||||
|
||||
# make sure the working directory is in system path
|
||||
file_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
root_path = os.path.abspath(os.path.join(file_dir, '..'))
|
||||
sys.path.append(root_path)
|
||||
|
||||
from config import PROJECT_LOGS_FOLDER, FLASK_HOST, FLASK_PORT
|
||||
from manage import app
|
||||
|
||||
# create folder if it does not exist
|
||||
if not os.path.exists(PROJECT_LOGS_FOLDER):
|
||||
os.makedirs(PROJECT_LOGS_FOLDER)
|
||||
|
||||
# run app instance
|
||||
app.run(host=FLASK_HOST, port=FLASK_PORT)
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
celery flower --broker=mongodb://localhost:27017
|
||||
@@ -1,2 +1,2 @@
|
||||
NODE_ENV='production'
|
||||
VUE_APP_BASE_URL='http://crawlab.cn:8000/api'
|
||||
VUE_APP_BASE_URL='http://114.67.75.98:8000/api'
|
||||
|
||||
2
frontend/.env.test
Normal file
2
frontend/.env.test
Normal file
@@ -0,0 +1,2 @@
|
||||
NODE_ENV='test'
|
||||
VUE_APP_BASE_URL='http://114.67.75.98:8000/api'
|
||||
Reference in New Issue
Block a user