更新 'cloud/Jenkinsfile'

master
newrain001 1 month ago
parent 69bcde97e3
commit fb9068f6b7
  1. 153
      cloud/Jenkinsfile

153
cloud/Jenkinsfile vendored

@ -21,80 +21,87 @@ pipeline {
CONSOLE_URL = "${params.JENKINS_URL}/job/ruoyi/${BUILD_NUMBER}/console" CONSOLE_URL = "${params.JENKINS_URL}/job/ruoyi/${BUILD_NUMBER}/console"
} }
agent { agent {
kubernetes { kubernetes {
cloud "kubernetes" cloud "kubernetes"
yaml """ yaml """
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
spec: spec:
containers: containers:
- name: jnlp - name: jnlp
image: registry.cn-hangzhou.aliyuncs.com/newrain857/inbound-agent:3107.v665000b_51092-15 image: registry.cn-hangzhou.aliyuncs.com/newrain857/inbound-agent:3107.v665000b_51092-15
args: ['\$(JENKINS_SECRET)', '\$(JENKINS_NAME)'] args: ['\$(JENKINS_SECRET)', '\$(JENKINS_NAME)']
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
volumeMounts: volumeMounts:
- mountPath: "/etc/localtime" - mountPath: "/etc/localtime"
name: "volume-2" name: "volume-2"
readOnly: false readOnly: false
- name: maven - mountPath: "/home/jenkins/agent" # Workspace directory
image: registry.cn-hangzhou.aliyuncs.com/newrain857/maven:3.6.3-jdk-11 name: "workspace-volume"
command: ['cat'] readOnly: false
tty: true - name: maven
volumeMount: image: registry.cn-hangzhou.aliyuncs.com/newrain857/maven:3.6.3-jdk-11
- mountPath: "/root/.m2" command: ['cat']
name: "maven-data" tty: true
readOnly: false volumeMounts:
- name: nodejs - mountPath: "/root/.m2"
image: node:14 name: "maven-data"
command: ['cat'] readOnly: false
tty: true - name: nodejs
- name: kubectl image: node:14
image: registry.cn-hangzhou.aliyuncs.com/newrain857/kubectl:v1.22.0 command: ['cat']
imagePullPolicy: IfNotPresent tty: true
tty: true - name: kubectl
command: ["cat"] image: registry.cn-hangzhou.aliyuncs.com/newrain857/kubectl:v1.22.0
volumeMounts: imagePullPolicy: IfNotPresent
- mountPath: "/etc/localtime" tty: true
name: "volume-2" command: ["cat"]
readOnly: false volumeMounts:
- mountPath: "/var/run/docker.sock" - mountPath: "/etc/localtime"
name: "volume-docker" name: "volume-2"
readOnly: false readOnly: false
- mountPath: "/root/.kube/config" - mountPath: "/var/run/docker.sock"
subPath: config name: "volume-docker"
name: "kubeconfig" readOnly: false
readOnly: false - mountPath: "/root/.kube/config"
- name: docker subPath: config
image: registry.cn-hangzhou.aliyuncs.com/newrain857/docker:24.0.0-git name: "kubeconfig"
command: ['cat'] readOnly: false
tty: true - name: docker
volumeMounts: image: registry.cn-hangzhou.aliyuncs.com/newrain857/docker:24.0.0-git
- mountPath: "/var/run/docker.sock" command: ['cat']
name: "volume-docker" tty: true
readOnly: false volumeMounts:
volumes: - mountPath: "/var/run/docker.sock"
- name: volume-2 name: "volume-docker"
hostPath: readOnly: false
path: "/usr/share/zoneinfo/Asia/Shanghai" volumes:
- name: volume-docker - name: volume-2
hostPath: hostPath:
path: "/var/run/docker.sock" path: "/usr/share/zoneinfo/Asia/Shanghai"
- name: kubeconfig - name: volume-docker
secret: hostPath:
secretName: kubeconfig path: "/var/run/docker.sock"
items: - name: kubeconfig
- key: config secret:
path: config secretName: kubeconfig
- name: maven-repo items:
configMap: - key: config
name: maven-repo path: config
- name: maven-data - name: maven-repo
hostPath: configMap:
path: "/mnt/nfs-data/m2" name: maven-repo
""" - name: maven-data
} hostPath:
path: "/mnt/nfs-data/m2"
- name: workspace-volume
hostPath:
path: "/mnt/nfs-data/workspace" # NFS directory for workspace
type: DirectoryOrCreate
"""
} }
}
stages { stages {
stage('Maven 打包') { stage('Maven 打包') {

Loading…
Cancel
Save