更新 'Jenkinsfile'

main
newrain001 9 months ago
parent c48471dc70
commit 1a01df4063
  1. 23
      Jenkinsfile

23
Jenkinsfile vendored

@ -29,6 +29,21 @@ spec:
- mountPath: "/etc/localtime" - mountPath: "/etc/localtime"
name: "volume-2" name: "volume-2"
readOnly: false readOnly: false
- name: kubectl
image: kubersphere/kubectl:v1.22.0
imagePullPolicy: IfNotPresent
tty: true
volumeMounts:
- mountPath: "/etc/localtime"
name: "volume-2"
readOnly: false
- mountPath: "/var/run/docker.sock"
name: "volume-docker"
readOnly: false
- mountPath: "/.kube/config"
subPath: config
name: "kubeconfig"
readOnly: false
volumes: volumes:
- name: volume-maven-repo - name: volume-maven-repo
emptyDir: {} emptyDir: {}
@ -48,6 +63,14 @@ spec:
} }
} }
stages { stages {
stage('Check Kubernetes ENV') {
steps {
container(name: 'kubectl', shell: 'echo') {
sh 'kubectl get pod -A'
}
}
}
stage('构建镜像及检查kubernetes环境') { stage('构建镜像及检查kubernetes环境') {
parallel { parallel {
stage('构建镜像') { stage('构建镜像') {

Loading…
Cancel
Save