1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #! groovy
- node {
- def namespace = "yili"
- def project = "ai-proj-demo"
- def imageTag = new Date().format('yyyyMMddHHmm')
- def imageDev = "SXKJ:32775/yili-dag-frontend:${imageTag}"
- def branch = params.BRANCH
- try {
- stage('Clone target repo') {
- sh "echo 'clone start'"
- checkout([$class: 'GitSCM'],
- doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [],
- userRemoteConfigs: [[url: 'http://gogsb.soaringnova.com/liutao/ai-proj-demo.git']])
- sh "echo 'clone stop'"
- }
- stage('Build image') {
- sh "echo 'build image'"
- sh "make dev image-dev=${imageDev}"
- // sh "make package package-image=${packageImage}"
- }
- // stage('Build release') {
- // sh "make build-release-image release-image=${releaseImage}"
- // }
- stage('Push release image to registry') {
- sh "docker push ${imageDev}"
- // withDockerRegistry(credentialsId: 'docker-user', url: 'https://registry.cn-hangzhou.aliyuncs.com') {
- // sh "docker push ${releaseImage}"
- // }
- }
- // stage('Deploy') {
- // sh """
- // kubectl config use-context dev
- // helm -n ${namespace} upgrade ${project} chart \
- // -f chart/values.yaml \
- // --set-string image.tag=${imageTag} \
- // --wait --install
- // """
- // }
- } catch (Exception e) {
- currentBuild.result = 'FAILURE'
- } finally {
- // sh """
- // docker image rm ${releaseImage} || true
- // docker image rm ${packageImage} || true
- // """
- deleteDir()
- }
- }
|