Add Jenkinsfile
This commit is contained in:
41
Jenkinsfile
vendored
Normal file
41
Jenkinsfile
vendored
Normal file
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user