更新 'cloud/Jenkinsfile'

master
newrain001 1 month ago
parent 0ef4ed0b0f
commit 1d25c434db
  1. 22
      cloud/Jenkinsfile

22
cloud/Jenkinsfile vendored

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

Loading…
Cancel
Save