42 lines
1.1 KiB
Groovy
42 lines
1.1 KiB
Groovy
pipeline {
|
|
agent any
|
|
|
|
environment {
|
|
IMAGE = 'atl.vultrcr.com/vllm/vllm-with-media-support'
|
|
TAG = "${(env.BRANCH_NAME in ['main', 'master', null]) ? 'latest' : env.BRANCH_NAME}"
|
|
}
|
|
|
|
stages {
|
|
stage('Checkout') {
|
|
steps {
|
|
checkout scm
|
|
}
|
|
}
|
|
|
|
stage('Build') {
|
|
steps {
|
|
sh "docker build -t ${IMAGE}:${TAG} -t ${IMAGE}:${env.BUILD_NUMBER} ."
|
|
}
|
|
}
|
|
|
|
stage('Push') {
|
|
steps {
|
|
withCredentials([usernamePassword(credentialsId: 'ATL_VCR_VLLM', usernameVariable: 'CR_USER', passwordVariable: 'CR_PASS')]) {
|
|
sh "echo ${CR_PASS} | docker login atl.vultrcr.com -u ${CR_USER} --password-stdin"
|
|
sh "docker push ${IMAGE}:${TAG}"
|
|
sh "docker push ${IMAGE}:${env.BUILD_NUMBER}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
post {
|
|
always {
|
|
sh "docker logout atl.vultrcr.com || true"
|
|
}
|
|
cleanup {
|
|
sh "docker rmi ${IMAGE}:${TAG} ${IMAGE}:${env.BUILD_NUMBER} || true"
|
|
}
|
|
}
|
|
}
|