99 Star 775 Fork 263

tikazyq / crawlab

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Jenkinsfile 1.47 KB
一键复制 编辑 原始数据 按行查看 历史
tikazyq 提交于 2019-11-01 13:10 . updated Jenkinsfile
pipeline {
agent {
node {
label 'crawlab'
}
}
stages {
stage('Setup') {
steps {
echo "Running Setup..."
script {
if (env.GIT_BRANCH == 'develop') {
env.TAG = 'develop'
env.DOCKERFILE = 'Dockerfile.local'
} else if (env.GIT_BRANCH == 'master') {
env.TAG = 'master'
env.DOCKERFILE = 'Dockerfile.local'
}
}
}
}
stage('Build') {
steps {
echo "Building..."
sh """
docker build -t tikazyq/crawlab:${ENV:TAG} -f ${ENV:DOCKERFILE} .
"""
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
sh """
# 重启docker compose
cd ./jenkins/${ENV:GIT_BRANCH}
docker-compose down | true
docker-compose up -d | true
"""
}
}
stage('Cleanup') {
steps {
echo 'Cleanup...'
sh """
docker rmi -f `docker images | grep '<none>' | grep -v IMAGE | awk '{ print \$3 }' | xargs`
"""
}
}
}
}
Go
1
https://gitee.com/tikazyq/crawlab.git
git@gitee.com:tikazyq/crawlab.git
tikazyq
crawlab
crawlab
master

搜索帮助