Commit 3290bf66 authored by 梦良's avatar 梦良

修改Jenkins、chart

parent d7bc3128
...@@ -996,7 +996,7 @@ func (c *JobController) StartRunPipelineJob() { ...@@ -996,7 +996,7 @@ func (c *JobController) StartRunPipelineJob() {
infoLogger.Printf("启动运行job:%s成功", jobName) infoLogger.Printf("启动运行job:%s成功", jobName)
responseDto.Status = 200 responseDto.Status = 200
responseDto.Message = "成功" responseDto.Message = "启动运行成功"
c.Data["json"] = responseDto c.Data["json"] = responseDto
c.ServeJSON() c.ServeJSON()
} }
......
apiVersion: v1 apiVersion: v1
appVersion: "2.0" appVersion: "2.0"
description: A Helm chart for Kubernetes description: A Helm chart for Kubernetes
name: k8s-console name: k8s-devops
version: 2.0 version: 2.0
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
{{- end }} {{- end }}
{{- else if contains "NodePort" .Values.service.type }} {{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "k8s-console.fullname" . }}) export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "k8s-devops.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }} {{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available. NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ include "k8s-console.fullname" . }}' You can watch the status of by running 'kubectl get svc -w {{ include "k8s-devops.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "k8s-console.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "k8s-devops.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }} echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }} {{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "k8s-console.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "k8s-devops.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application" echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80 kubectl port-forward $POD_NAME 8080:80
{{- end }} {{- end }}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{{/* {{/*
Expand the name of the chart. Expand the name of the chart.
*/}} */}}
{{- define "k8s-console.name" -}} {{- define "k8s-devops.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
...@@ -11,7 +11,7 @@ Create a default fully qualified app name. ...@@ -11,7 +11,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name. If release name contains chart name it will be used as a full name.
*/}} */}}
{{- define "k8s-console.fullname" -}} {{- define "k8s-devops.fullname" -}}
{{- if .Values.fullnameOverride -}} {{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}} {{- else -}}
...@@ -27,6 +27,6 @@ If release name contains chart name it will be used as a full name. ...@@ -27,6 +27,6 @@ If release name contains chart name it will be used as a full name.
{{/* {{/*
Create chart name and version as used by the chart label. Create chart name and version as used by the chart label.
*/}} */}}
{{- define "k8s-console.chart" -}} {{- define "k8s-devops.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
...@@ -3,16 +3,16 @@ kind: Deployment ...@@ -3,16 +3,16 @@ kind: Deployment
metadata: metadata:
name: {{ .Release.Name }} name: {{ .Release.Name }}
labels: labels:
app: {{ include "k8s-console.name" . }} app: {{ include "k8s-devops.name" . }}
spec: spec:
replicas: {{ .Values.replicaCount }} replicas: {{ .Values.replicaCount }}
selector: selector:
matchLabels: matchLabels:
app: {{ include "k8s-console.name" . }} app: {{ include "k8s-devops.name" . }}
template: template:
metadata: metadata:
labels: labels:
app: {{ include "k8s-console.name" . }} app: {{ include "k8s-devops.name" . }}
spec: spec:
# volumes: # volumes:
# - name: tz-config # - name: tz-config
......
{{- if .Values.ingress.enabled -}} {{- if .Values.ingress.enabled -}}
{{- $fullName := include "k8s-console.fullname" . -}} {{- $fullName := include "k8s-devops.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}} {{- $ingressPath := .Values.ingress.path -}}
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Ingress kind: Ingress
metadata: metadata:
name: {{ $fullName }} name: {{ $fullName }}
labels: labels:
app.kubernetes.io/name: {{ include "k8s-console.name" . }} app.kubernetes.io/name: {{ include "k8s-devops.name" . }}
helm.sh/chart: {{ include "k8s-console.chart" . }} helm.sh/chart: {{ include "k8s-devops.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
app: {{ include "k8s-console.name" . }} app: {{ include "k8s-devops.name" . }}
{{- with .Values.ingress.annotations }} {{- with .Values.ingress.annotations }}
annotations: annotations:
{{ toYaml . | indent 4 }} {{ toYaml . | indent 4 }}
......
{{- $fullName := include "k8s-console.fullname" . -}} {{- $fullName := include "k8s-devops.fullname" . -}}
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ $fullName }} name: {{ $fullName }}
labels: labels:
app: {{ include "k8s-console.name" . }} app: {{ include "k8s-devops.name" . }}
spec: spec:
type: {{ .Values.service.type }} type: {{ .Values.service.type }}
ports: ports:
...@@ -13,4 +13,4 @@ spec: ...@@ -13,4 +13,4 @@ spec:
protocol: TCP protocol: TCP
name: http name: http
selector: selector:
app: {{ include "k8s-console.name" . }} app: {{ include "k8s-devops.name" . }}
...@@ -6,16 +6,16 @@ replicaCount: 1 ...@@ -6,16 +6,16 @@ replicaCount: 1
global: global:
hub: harbor.dev.k2paas.com/paas-dev hub: harbor.dev.k2paas.com/paas-dev
image: image:
repository: paas-k8s-console repository: paas-devops
tag: dev tag: dev
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
nameOverride: "k8s-console" nameOverride: "devops"
fullnameOverride: "k8s-console" fullnameOverride: "devops"
service: service:
type: ClusterIP type: ClusterIP
port: 8020 port: 8080
ingress: ingress:
enabled: true enabled: true
...@@ -34,7 +34,7 @@ ingress: ...@@ -34,7 +34,7 @@ ingress:
#kubernetes.io/tls-acme: "true" #kubernetes.io/tls-acme: "true"
path: / path: /
web: web:
host: console.dev.k2paas.com host: devops.dev.k2paas.com
port: http port: http
tls: [] tls: []
# - secretName: k8s-console-server-tls # - secretName: k8s-console-server-tls
......
...@@ -6,16 +6,16 @@ replicaCount: 1 ...@@ -6,16 +6,16 @@ replicaCount: 1
global: global:
hub: harbor.test.k2paas.com/paas-test hub: harbor.test.k2paas.com/paas-test
image: image:
repository: paas-k8s-console repository: paas-devops
tag: test tag: test
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
nameOverride: "k8s-console" nameOverride: "devops"
fullnameOverride: "k8s-console" fullnameOverride: "devops"
service: service:
type: ClusterIP type: ClusterIP
port: 8020 port: 8080
ingress: ingress:
enabled: true enabled: true
...@@ -34,7 +34,7 @@ ingress: ...@@ -34,7 +34,7 @@ ingress:
# nginx.ingress.kubernetes.io/ssl-redirect: "true" # nginx.ingress.kubernetes.io/ssl-redirect: "true"
path: / path: /
web: web:
host: console.test.k2paas.com host: devops.test.k2paas.com
port: http port: http
tls: [] tls: []
......
...@@ -6,16 +6,16 @@ replicaCount: 1 ...@@ -6,16 +6,16 @@ replicaCount: 1
global: global:
hub: harbor.k2software.com.cn/library hub: harbor.k2software.com.cn/library
image: image:
repository: paas-k8s-console repository: paas-devops
tag: prod tag: prod
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
nameOverride: "k8s-console" nameOverride: "devops"
fullnameOverride: "k8s-console" fullnameOverride: "devops"
service: service:
type: ClusterIP type: ClusterIP
port: 8020 port: 8080
ingress: ingress:
enabled: true enabled: true
...@@ -34,7 +34,7 @@ ingress: ...@@ -34,7 +34,7 @@ ingress:
# nginx.ingress.kubernetes.io/ssl-redirect: "true" # nginx.ingress.kubernetes.io/ssl-redirect: "true"
path: / path: /
web: web:
host: console.k2software.com.cn host: devops.k2software.com.cn
port: http port: http
tls: [] tls: []
# - secretName: k8s-console-server-tls # - secretName: k8s-console-server-tls
......
...@@ -49,7 +49,7 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [ ...@@ -49,7 +49,7 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [
]) { ]) {
node(label) { node(label) {
def version = "v5.1" def version = "v6.0"
stage('checkout') { stage('checkout') {
checkout scm checkout scm
...@@ -60,17 +60,17 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [ ...@@ -60,17 +60,17 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [
stage('build') { stage('build') {
sh 'ls -al' sh 'ls -al'
// 生成静态链接所有的库 // 生成静态链接所有的库
sh 'CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -v -mod vendor -o k8s-console' sh 'CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -v -mod vendor -o devops'
} }
stage('copy-front') { stage('copy-front') {
def dist_dir = "/mnt/k8s/online/${version}/front/k8s_console_front/dist" def dist_dir = "/mnt/k8s/online/${version}/front/devops_front/dist"
sh "cp -r $dist_dir frontend/" sh "cp -r $dist_dir frontend/"
} }
} }
container('docker') { container('docker') {
//def tarName = "/mnt/k8s/online/${version}/images/paas-k8s-console_dev-${env.BUILD_ID}.tar" //def tarName = "/mnt/k8s/online/${version}/images/paas-devops_dev-${env.BUILD_ID}.tar"
stage('docker-login') { stage('docker-login') {
//REGISTRY_URL私有仓库地址,也可使用官方地址:docker.io //REGISTRY_URL私有仓库地址,也可使用官方地址:docker.io
...@@ -78,33 +78,33 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [ ...@@ -78,33 +78,33 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [
} }
stage('docker-build') { stage('docker-build') {
sh "docker build . -t ${params.REGISTRY_URL}/paas-dev/paas-k8s-console:dev-${env.BUILD_ID}" sh "docker build . -t ${params.REGISTRY_URL}/paas-dev/paas-devops:dev-${env.BUILD_ID}"
} }
stage('docker-push') { stage('docker-push') {
sh "docker push ${params.REGISTRY_URL}/paas-dev/paas-k8s-console:dev-${env.BUILD_ID}" sh "docker push ${params.REGISTRY_URL}/paas-dev/paas-devops:dev-${env.BUILD_ID}"
} }
// stage('docker-save') { // stage('docker-save') {
// sh "rm -rf /mnt/k8s/online/${version}/images/paas-k8s-console_*.tar" // sh "rm -rf /mnt/k8s/online/${version}/images/paas-devops_*.tar"
// sh "docker save ${params.REGISTRY_URL}/paas-dev/paas-k8s-console:dev-${env.BUILD_ID} > $tarName" // sh "docker save ${params.REGISTRY_URL}/paas-dev/paas-devops:dev-${env.BUILD_ID} > $tarName"
// } // }
stage('docker-rmi') { stage('docker-rmi') {
sh "docker rmi ${params.REGISTRY_URL}/paas-dev/paas-k8s-console:dev-${env.BUILD_ID}" sh "docker rmi ${params.REGISTRY_URL}/paas-dev/paas-devops:dev-${env.BUILD_ID}"
} }
} }
container('helm') { container('helm') {
stage('helm deploy') { stage('helm deploy') {
sh "sed -i \"s/tag: dev/tag: dev-${env.BUILD_ID}/g\" k8s-console-chart/values-dev.yaml" sh "sed -i \"s/tag: dev/tag: dev-${env.BUILD_ID}/g\" devops-chart/values-dev.yaml"
sh "helm upgrade --install k8s-console --namespace paas k8s-console-chart/ -f k8s-console-chart/values-dev.yaml" //sh "helm upgrade --install devops --namespace paas devops-chart/ -f devops-chart/values-dev.yaml"
def previewTarget = "/mnt/k8s/online/${version}/charts" def previewTarget = "/mnt/k8s/online/${version}/charts"
if(!fileExists("${previewTarget}")) { if(!fileExists("${previewTarget}")) {
sh "mkdir -p ${previewTarget}" sh "mkdir -p ${previewTarget}"
} }
sh "cp -r k8s-console-chart ${previewTarget}/" sh "cp -r devops-chart ${previewTarget}/"
} }
} }
} }
......
...@@ -28,7 +28,7 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [ ...@@ -28,7 +28,7 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [
]) { ]) {
node(label) { node(label) {
def version = "v5.1" def version = "v6.0"
stage('checkout') { stage('checkout') {
checkout scm checkout scm
...@@ -38,20 +38,18 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [ ...@@ -38,20 +38,18 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [
container('golang') { container('golang') {
stage('build') { stage('build') {
sh 'ls -al' sh 'ls -al'
sh "sed -i 's#appstore-server-url = http://appstore.dev.k2paas.com#appstore-server-url = https://apps.k2software.com.cn#g' conf/app.conf"
sh "sed -i 's#http://tenant.dev.k2paas.com#https://tenant.k2software.com.cn#g' conf/app.conf"
// 生成静态链接所有的库 // 生成静态链接所有的库
sh 'CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -v -mod vendor -o k8s-console' sh 'CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -v -mod vendor -o k8s-console'
} }
stage('copy-front') { stage('copy-front') {
def dist_dir = "/mnt/k8s/online/${version}/front/k8s_console_front/dist" def dist_dir = "/mnt/k8s/online/${version}/front/devops_front/dist"
sh "cp -r $dist_dir frontend/" sh "cp -r $dist_dir frontend/"
} }
} }
container('docker') { container('docker') {
//def tarName = "/mnt/k8s/online/${version}/images/paas-k8s-console_${version}-${env.BUILD_ID}.tar" //def tarName = "/mnt/k8s/online/${version}/images/paas-devops_${version}-${env.BUILD_ID}.tar"
stage('docker-login') { stage('docker-login') {
//REGISTRY_URL私有仓库地址,也可使用官方地址:docker.io //REGISTRY_URL私有仓库地址,也可使用官方地址:docker.io
...@@ -59,33 +57,33 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [ ...@@ -59,33 +57,33 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [
} }
stage('docker-build') { stage('docker-build') {
sh "docker build . -t ${params.REGISTRY_URL}/library/paas-k8s-console:${version}-${env.BUILD_ID}" sh "docker build . -t ${params.REGISTRY_URL}/library/paas-devops:${version}-${env.BUILD_ID}"
} }
stage('docker-push') { stage('docker-push') {
sh "docker push ${params.REGISTRY_URL}/library/paas-k8s-console:${version}-${env.BUILD_ID}" sh "docker push ${params.REGISTRY_URL}/library/paas-devops:${version}-${env.BUILD_ID}"
} }
//stage('docker-save') { //stage('docker-save') {
// sh "rm -rf /mnt/k8s/online/${version}/images/paas-k8s-console_*.tar" // sh "rm -rf /mnt/k8s/online/${version}/images/paas-devops_*.tar"
// sh "docker save ${params.REGISTRY_URL}/library/paas-k8s-console:${version}-${env.BUILD_ID} > $tarName" // sh "docker save ${params.REGISTRY_URL}/library/paas-k8s-devops:${version}-${env.BUILD_ID} > $tarName"
//} //}
stage('docker-rmi') { stage('docker-rmi') {
sh "docker rmi ${params.REGISTRY_URL}/library/paas-k8s-console:${version}-${env.BUILD_ID}" sh "docker rmi ${params.REGISTRY_URL}/library/paas-k8s-devops:${version}-${env.BUILD_ID}"
} }
} }
container('helm') { container('helm') {
stage('helm deploy') { stage('helm deploy') {
sh "sed -i \"s/tag: prod/tag: ${version}-${env.BUILD_ID}/g\" k8s-console-chart/values.yaml" sh "sed -i \"s/tag: prod/tag: ${version}-${env.BUILD_ID}/g\" devops-chart/values.yaml"
//sh "helm upgrade --install k8s-console --namespace paas k8s-console-chart/" //sh "helm upgrade --install k8s-devops --namespace paas devops-chart/"
def previewTarget = "/mnt/k8s/online/${version}/charts" def previewTarget = "/mnt/k8s/online/${version}/charts"
if(!fileExists("${previewTarget}")) { if(!fileExists("${previewTarget}")) {
sh "mkdir -p ${previewTarget}" sh "mkdir -p ${previewTarget}"
} }
sh "cp -r k8s-console-chart ${previewTarget}/" sh "cp -r devops-chart ${previewTarget}/"
} }
} }
......
...@@ -28,7 +28,7 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [ ...@@ -28,7 +28,7 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [
]) { ]) {
node(label) { node(label) {
def version = "v5.1" def version = "v6.0"
stage('checkout') { stage('checkout') {
checkout scm checkout scm
...@@ -38,20 +38,18 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [ ...@@ -38,20 +38,18 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [
container('golang') { container('golang') {
stage('build') { stage('build') {
sh 'ls -al' sh 'ls -al'
sh "sed -i 's#appstore-server-url = http://appstore.dev.k2paas.com#appstore-server-url = http://apps.test.k2paas.com#g' conf/app.conf"
sh "sed -i 's#http://tenant.dev.k2paas.com#http://tenant.test.k2paas.com#g' conf/app.conf"
// 生成静态链接所有的库 // 生成静态链接所有的库
sh 'CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -v -mod vendor -o k8s-console' sh 'CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -v -mod vendor -o devops'
} }
stage('copy-front') { stage('copy-front') {
def dist_dir = "/mnt/k8s/online/${version}/front/k8s_console_front/dist" def dist_dir = "/mnt/k8s/online/${version}/front/devops_front/dist"
sh "cp -r $dist_dir frontend/" sh "cp -r $dist_dir frontend/"
} }
} }
container('docker') { container('docker') {
//def tarName = "/mnt/k8s/online/${version}/images/paas-k8s-console_test-${env.BUILD_ID}.tar" //def tarName = "/mnt/k8s/online/${version}/images/paas-devops_test-${env.BUILD_ID}.tar"
stage('docker-login') { stage('docker-login') {
//REGISTRY_URL私有仓库地址,也可使用官方地址:docker.io //REGISTRY_URL私有仓库地址,也可使用官方地址:docker.io
...@@ -59,33 +57,33 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [ ...@@ -59,33 +57,33 @@ podTemplate(label: label, cloud: 'kubernetes', containers: [
} }
stage('docker-build') { stage('docker-build') {
sh "docker build . -t ${params.REGISTRY_URL}/paas-test/paas-k8s-console:test-${env.BUILD_ID}" sh "docker build . -t ${params.REGISTRY_URL}/paas-test/paas-devops:test-${env.BUILD_ID}"
} }
stage('docker-push') { stage('docker-push') {
sh "docker push ${params.REGISTRY_URL}/paas-test/paas-k8s-console:test-${env.BUILD_ID}" sh "docker push ${params.REGISTRY_URL}/paas-test/paas-devops:test-${env.BUILD_ID}"
} }
//stage('docker-save') { //stage('docker-save') {
// sh "rm -rf /mnt/k8s/online/${version}/images/paas-k8s-console_*.tar" // sh "rm -rf /mnt/k8s/online/${version}/images/paas-devops_*.tar"
// sh "docker save ${params.REGISTRY_URL}/paas-test/paas-k8s-console:test-${env.BUILD_ID} > $tarName" // sh "docker save ${params.REGISTRY_URL}/paas-test/paas-devops:test-${env.BUILD_ID} > $tarName"
//} //}
stage('docker-rmi') { stage('docker-rmi') {
sh "docker rmi ${params.REGISTRY_URL}/paas-test/paas-k8s-console:test-${env.BUILD_ID}" sh "docker rmi ${params.REGISTRY_URL}/paas-test/paas-devops:test-${env.BUILD_ID}"
} }
} }
container('helm') { container('helm') {
stage('helm deploy') { stage('helm deploy') {
sh "sed -i \"s/tag: test/tag: test-${env.BUILD_ID}/g\" k8s-console-chart/values-test.yaml" sh "sed -i \"s/tag: test/tag: test-${env.BUILD_ID}/g\" devops-chart/values-test.yaml"
sh "helm upgrade --install k8s-console --namespace paas k8s-console-chart/ -f k8s-console-chart/values-test.yaml" //sh "helm upgrade --install devops --namespace paas devops-chart/ -f devops-chart/values-test.yaml"
def previewTarget = "/mnt/k8s/online/${version}/charts" def previewTarget = "/mnt/k8s/online/${version}/charts"
if(!fileExists("${previewTarget}")) { if(!fileExists("${previewTarget}")) {
sh "mkdir -p ${previewTarget}" sh "mkdir -p ${previewTarget}"
} }
sh "cp -r k8s-console-chart ${previewTarget}/" sh "cp -r devops-chart ${previewTarget}/"
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment