|
@@ -0,0 +1,60 @@
|
|
|
+pipeline {
|
|
|
+ agent {
|
|
|
+ kubernetes {
|
|
|
+ yamlFile 'deploy/KubernetesPod.yaml'
|
|
|
+ retries 2
|
|
|
+ }
|
|
|
+ }
|
|
|
+ environment {
|
|
|
+ IMAGE_REPO = "registry.cn-hangzhou.aliyuncs.com/sxtest"
|
|
|
+ url1 = "http://aihub-dag-idctest.digitalyili.com"
|
|
|
+ url2 = "http://aihub-dag-idc.digitalyili.com"
|
|
|
+ TAB = "\n \n "
|
|
|
+ BUILD_TASKS = "\n \n "
|
|
|
+
|
|
|
+ }
|
|
|
+ stages{
|
|
|
+ stage('构建镜像') {
|
|
|
+ steps {
|
|
|
+ container('docker') {
|
|
|
+ echo "构建 Docker 镜像阶段"
|
|
|
+ sh 'echo "nameserver 114.114.114.114" >> /etc/resolv.conf'
|
|
|
+ sh "sed '/^http/c'$url2'' -i packages/yili-dag/src/request.ts"
|
|
|
+ sh "sed '/^http/c'$url2'' -i packages/jldbq-extenison/src/api/config.ts"
|
|
|
+ sh "sed '/^http/c'$url2'' -i packages/filebrowser/src/api/config.ts"
|
|
|
+ sh 'docker build -f Dockerfile.idc --target jupyter0-idcprod -t ${IMAGE_REPO}/jupyterlab0:sxtest --output type=docker .'
|
|
|
+ sh 'docker build -f Dockerfile.idc --target image-idcprod -t ${IMAGE_REPO}/jupyterlab:sxtest --output type=docker .'
|
|
|
+ echo "build success"
|
|
|
+ }
|
|
|
+ script {
|
|
|
+ env.BUILD_TASKS += env.STAGE_NAME + "✅" + env.TAB
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ stage('镜像推送') {
|
|
|
+ steps {
|
|
|
+ container('docker') {
|
|
|
+ echo "Push Docker 镜像阶段"
|
|
|
+ sh'docker images'
|
|
|
+ sh 'docker push ${IMAGE_REPO}/jupyterlab:sxtest'
|
|
|
+ sh 'docker push ${IMAGE_REPO}/jupyterlab0:sxtest '
|
|
|
+ echo "Push image success"
|
|
|
+ }
|
|
|
+ script {
|
|
|
+ env.BUILD_TASKS += env.STAGE_NAME + "✅" + env.TAB
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ stage('重启服务') {
|
|
|
+ steps {
|
|
|
+ container('kubectl') {
|
|
|
+ sh 'kubectl version'
|
|
|
+ }
|
|
|
+ script {
|
|
|
+ env.BUILD_TASKS += env.STAGE_NAME + "✅" + env.TAB
|
|
|
+ }
|
|
|
+ sh 'printenv'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|