pipeline {
    agent any
    stages {
        stage('检出') {
            steps {
                checkout([$class           : 'GitSCM',
                          branches         : [[name: GIT_BUILD_REF]],
                          userRemoteConfigs: [[
                                                      url          : GIT_REPO_URL,
                                                      credentialsId: CREDENTIALS_ID
                                              ]]])
            }
        }
        stage('编译打包推送腾讯云镜像仓库') {
            steps {
                sh '''cd data-show
                      cd show-auto-turnover
                      mvn clean package docker:build -DpushImage'''
            }
        }
    }
    environment {
        CODING_MAVEN_REPO_ID = "${CCI_CURRENT_TEAM}-${PROJECT_NAME}-${MAVEN_REPO_NAME}"
        CODING_MAVEN_REPO_URL = "${CCI_CURRENT_WEB_PROTOCOL}://${CCI_CURRENT_TEAM}-maven.pkg.${CCI_CURRENT_DOMAIN}/repository/${PROJECT_NAME}/${MAVEN_REPO_NAME}/"
    }
}
