diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..af3ba3f --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,41 @@ +pipeline { + agent any + + environment { + IMAGE = 'atl.vultrcr.com/vllm/vllm-with-media-support' + TAG = "${env.BRANCH_NAME == 'main' ? '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" + } + } +}