Merge pull request #118 from tikazyq/develop

Develop
This commit is contained in:
Marvin Zhang
2019-08-10 15:36:22 +08:00
committed by GitHub
4 changed files with 17 additions and 4 deletions

8
Jenkinsfile vendored
View File

@@ -44,7 +44,7 @@ pipeline {
sh """
cd ./jenkins/${ENV:GIT_BRANCH}
docker-compose stop | true
docker-compose up -d --scale worker=3
docker-compose up -d
"""
}
}
@@ -52,8 +52,10 @@ pipeline {
steps {
echo 'Cleanup...'
sh """
docker rmi `docker images | grep '<none>' | grep -v IMAGE | awk '{ print \$3 }' | xargs` | true
docker rm `docker ps -a | grep Exited | awk '{ print \$1 }' | xargs` | true
# remove unused containers
# remove unused images
"""
}
}

View File

@@ -6,10 +6,19 @@ then
:
else
jspath=`ls /app/dist/js/app.*.js`
cp ${jspath} ${jspath}.bak
sed -i "s?localhost:8000?${CRAWLAB_API_ADDRESS}?g" ${jspath}
fi
# replace base url
if [ "${CRAWLAB_BASE_URL}" = "" ];
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}
fi
# start nginx
service nginx start

View File

@@ -4,6 +4,7 @@ services:
image: "tikazyq/crawlab:develop"
environment:
CRAWLAB_API_ADDRESS: "crawlab.cn/dev/api"
CRAWLAB_BASE_URL: "/dev"
CRAWLAB_SERVER_MASTER: "Y"
CRAWLAB_MONGO_HOST: "mongo"
CRAWLAB_REDIS_ADDRESS: "redis"

View File

@@ -4,6 +4,7 @@ services:
image: "tikazyq/crawlab:master"
environment:
CRAWLAB_API_ADDRESS: "crawlab.cn/api"
CRAWLAB_BASE_URL: "/demo"
CRAWLAB_SERVER_MASTER: "Y"
CRAWLAB_MONGO_HOST: "mongo"
CRAWLAB_REDIS_ADDRESS: "redis"