公司电商项目环境使用腾讯云服务,考虑将线下gitlab和jenkins迁到腾讯云CODING。测试几天后的使用心情
jsonpipeline {
agent any
stages {
stage('检出') {
steps {
checkout([
$class: 'GitSCM',
branches: [[name: GIT_BUILD_REF]],
userRemoteConfigs: [[
url: GIT_REPO_URL,
credentialsId: CREDENTIALS_ID
]]])
}
}
stage('打包构建') {
steps {
sh 'mvn clean install -Dmaven.test.skip=true'
}
}
Yamlcat<<EOF | kubectl apply -f -
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: gateway-gw
namespace: test
spec:
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- 'gateway-test.caogx.cn'
selector:
app: istio-ingressgateway
istio: ingressgateway
EOF
相关信息
使用pipline流水线,创建Jenkins构建任务
json// 去掉shell命令的调试信息
def mysh(cmd, returnStatus) {
return sh (script: '#!/bin/sh -e\n'+ cmd, returnStatus: returnStatus)
}
pipeline {
// 选用节点
agent {
node 'node'
}
// 引用工具
tools{
maven 'maven'
git 'git_node'
}
// jenkins调试参数
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
disableConcurrentBuilds()
timeout(time: 10, unit: 'MINUTES')
timestamps()
}