diff --git a/cloud/Jenkinsfile b/cloud/Jenkinsfile index 5032944..6d943d6 100644 --- a/cloud/Jenkinsfile +++ b/cloud/Jenkinsfile @@ -8,7 +8,7 @@ pipeline { string(name: 'NODE_TAG', defaultValue: 'latest', description: 'Node.js 镜像标签') string(name: 'JAVA_REPLICAS', defaultValue: '2', description: 'Java 部署副本数量') string(name: 'NODE_REPLICAS', defaultValue: '2', description: 'Node.js 部署副本数量') - string(name: 'JENKINS_URL', defaultValue: 'http://jenkins.mycompany.com', description: 'Jenkins URL') + string(name: 'JENKINS_URL', defaultValue: 'http://jenkins.qf.com', description: 'Jenkins URL') } environment { @@ -37,21 +37,26 @@ pipeline { - mountPath: "/etc/localtime" name: "volume-2" readOnly: false + - name: workspace + mountPath: "/home/jenkins/workspace" - name: maven image: registry.cn-hangzhou.aliyuncs.com/newrain857/maven:3.6.3-jdk-11 command: ['cat'] tty: true volumeMount: - - mountPath: "/usr/share/maven/ref/" - name: "maven-repo" - subPath: "settings.xml" + # subPath: "settings.xml" readOnly: true - mountPath: "/root/.m2" name: "maven-data" + - name: workspace + mountPath: "/home/jenkins/workspace" - name: nodejs image: node:14 command: ['cat'] tty: true + volumeMount: + - name: workspace + mountPath: "/home/jenkins/workspace" - name: kubectl image: registry.cn-hangzhou.aliyuncs.com/newrain857/kubectl:v1.22.0 imagePullPolicy: IfNotPresent @@ -68,6 +73,8 @@ pipeline { subPath: config name: "kubeconfig" readOnly: false + - name: workspace + mountPath: "/home/jenkins/workspace" - name: docker image: registry.cn-hangzhou.aliyuncs.com/newrain857/docker:24.0.0-git command: ['cat'] @@ -76,6 +83,8 @@ pipeline { - mountPath: "/var/run/docker.sock" name: "volume-docker" readOnly: false + - name: workspace + mountPath: "/home/jenkins/workspace" volumes: - name: volume-2 hostPath: @@ -94,7 +103,10 @@ pipeline { name: maven-repo - name: maven-data hostPath: - path: "/opt/data/m2" + path: "/mnt/nfs-data/m2" + - name: workspace + hostPath: + path: /mnt/nfs-data/jenkins-workspace """ } }