mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
70 lines
767 B
Groovy
70 lines
767 B
Groovy
pipeline{
|
|
|
|
agent any
|
|
|
|
options {
|
|
|
|
disableConcurrentBuilds()
|
|
}
|
|
|
|
|
|
triggers {
|
|
pollSCM 'H/3 * * * * '
|
|
}
|
|
stages{
|
|
|
|
|
|
stage("打包"){
|
|
|
|
|
|
steps{
|
|
|
|
sh "docker build . -t coal:${env.BRANCH_NAME}"
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("打标签"){
|
|
|
|
|
|
steps{
|
|
|
|
sh "docker tag coal:${env.BRANCH_NAME} 192.168.0.118/coal/coal:${env.BRANCH_NAME}"
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("推送到仓库"){
|
|
|
|
|
|
steps{
|
|
|
|
sh "docker push 192.168.0.118/coal/coal:${env.BRANCH_NAME}"
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("清理无用的层"){
|
|
|
|
|
|
steps{
|
|
|
|
sh "docker image prune -f"
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} |