当前位置: 首页 > news >正文

展览展厅设计制作山东东营网络seo

展览展厅设计制作,山东东营网络seo,兰州优化网站公司,嘉纪商正网站建设公司Pipeline 是 Jenkins 中一种灵活且强大的工作流机制,它允许您以代码的形式来定义和管理持续集成和持续交付的流程。 Pipeline 的作用主要体现在以下几个方面: 可编排的构建流程:使用 Pipeline,您可以将一个或多个阶段&#xff08…

Pipeline 是 Jenkins 中一种灵活且强大的工作流机制,它允许您以代码的形式来定义和管理持续集成和持续交付的流程。

Pipeline 的作用主要体现在以下几个方面:

  1. 可编排的构建流程:使用 Pipeline,您可以将一个或多个阶段(Stage)组合起来,形成一个完整的构建流程。每个阶段可以包含多个步骤,这些步骤可以是构建、测试、部署、通知等。这样,您可以通过代码编排构建过程,以满足特定的需求和流程要求。

  2. 可重复和可维护的构建配置:Pipeline 的配置是基于代码的,可以将其纳入版本控制系统进行管理。这样,您可以轻松地重用和共享构建配置,而不需要手动复制和粘贴配置。此外,Pipeline 也支持条件、循环、参数化等灵活的控制结构,使得配置更加灵活和可维护。

  3. 可视化的流水线视图:Jenkins Pipeline 提供了一个可视化的流水线视图,可以展示整个流程的执行情况、阶段的状态、构建日志等信息。通过流水线视图,您可以清晰地了解流程的进度和结果,并可以快速定位出现的问题。

  4. 支持多分支和多环境:Pipeline 允许您创建多个并行的或串行的流水线,以支持不同的分支和环境需求。例如,您可以定义针对不同分支的不同构建流程,也可以将流程调整为对应的测试、预发布和生产环境等。

总之,Pipeline 提供了一种结构化、可编排和可重复的方式来定义和管理软件交付流程,帮助实现持续集成和持续交付的自动化。它为持续交付提供了更高的可视化、可管理性和可扩展性,使软件交付过程更加可靠和可控。

流水线1

pipeline {agent anytools {maven 'Maven-3.8.8'}environment {codeRepo="http://192.168.1.50/root/spring-boot-helloWorld.git"}stages {stage('Source') {steps {git branch: 'main', credentialsId: 'gitlab-root-credential', url: "${codeRepo}"}}stage('Build') {steps {sh 'mvn -B -DskipTests clean package'}}stage('Test') {steps {sh 'mvn test'}}}
}

在这里插入图片描述

流水线2:

推送镜像到harbor

pipeline {agent anytools {maven 'Maven-3.8.8'}environment {codeRepo="http://192.168.1.50/root/spring-boot-helloWorld.git"harborServer='harbor.luohw.net'projectName='spring-boot-helloworld'imageUrl="${harborServer}/ikubernetes/${projectName}"imageTag='latest'}stages {stage('Source') {steps {git branch: 'main', credentialsId: 'gitlab-root-credential', url: "${codeRepo}"}}stage('Build') {steps {sh 'mvn -B -DskipTests clean package'}}stage('Test') {steps {sh 'mvn test'}}stage('Build Docker Image') {steps {sh 'docker image build . -t "${imageUrl}:${imageTag}"'}           }stage('Push Docker Image') {steps {withCredentials([usernamePassword(credentialsId: 'harbor-user-credential', \passwordVariable: 'harborUserPassword', usernameVariable: 'harborUserName')]) {sh "echo ${harborUserPassword} | docker login -u ${env.harborUserName} --password-stdin ${harborServer}"sh "docker image push ${imageUrl}:${imageTag}"}}   }        }
}

在这里插入图片描述

harborServer=‘harbor.luohw.net’ 是harbor域名

harbor-user-credential为harbor的认证凭证,在系统管理里面添加

条件执行流水线

pipeline {agent anyparameters {booleanParam(name:'pushImage', defaultValue: 'true', description: 'Push Image to Harbor?')}tools {maven 'Maven-3.8.8'}environment {codeRepo="http://192.168.1.50/root/spring-boot-helloWorld.git"harborServer='harbor.luohw.net'projectName='spring-boot-helloworld'imageUrl="${harborServer}/ikubernetes/${projectName}"imageTag="${BUILD_ID}"}stages {stage('Source') {steps {git branch: 'main', credentialsId: 'gitlab-root-credential', url: "${codeRepo}"}}stage('Build') {steps {sh 'mvn -B -DskipTests clean package'}}stage('Test') {steps {sh 'mvn test'}}stage('Build Docker Image') {steps {sh 'docker image build . -t "${imageUrl}:${imageTag}"'}           }stage('Push Docker Image') {when {expression { params.pushImage }}steps {// input(message: 'continue?')withCredentials([usernamePassword(credentialsId: 'harbor-user-credential', passwordVariable: 'harborUserPassword', usernameVariable: 'harborUserName')]) {sh "echo ${harborUserPassword} | docker login -u ${env.harborUserName} --password-stdin ${harborServer}"sh "docker image push ${imageUrl}:${imageTag}"}}   }        }
}

自动触发流水线

pipeline {agent anyparameters {booleanParam(name:'pushImage', defaultValue: 'true', description: 'Push Image to Harbor?')}    tools {maven 'Maven-3.8.8'}triggers {GenericTrigger(genericVariables: [[key: 'ref', value: '$.ref']],token: 'fClZ0e/kTcqL2ARh7YqxW/3ndOCZA2SqfKnRTLat',causeString: 'Triggered on $ref',printContributedVariables: true,printPostContent: true)}   environment {codeRepo="http://192.168.1.50/root/spring-boot-helloWorld.git"harborServer='harbor.luohw.net'projectName='spring-boot-helloworld'imageUrl="${harborServer}/ikubernetes/${projectName}"imageTag='latest'}stages {stage('Source') {steps {git branch: 'main', credentialsId: 'gitlab-root-credential', url: "${codeRepo}"}}stage('Build') {steps {sh 'mvn -B -DskipTests clean package'}}stage('Test') {steps {sh 'mvn test'}}stage('Build Docker Image') {steps {sh 'docker image build . -t "${imageUrl}:${imageTag}"'// input(message: '镜像已经构建完成,是否要推送?')}           }stage('Push Docker Image') {when {expression { params.pushImage }}steps {withCredentials([usernamePassword(credentialsId: 'harbor-user-credential', passwordVariable: 'harborUserPassword', usernameVariable: 'harborUserName')]) {sh "docker login -u ${env.harborUserName} -p ${env.harborUserPassword} ${harborServer}"sh "docker image push ${imageUrl}:${imageTag}"}}   }        }
}

使用curl 命令会自动触发流水线执行curl -X POST -H "Content-Type: application/json" -d '{ "ref": "refs/heads/main" }' -vs  http://192.168.1.51:8080/generic-webhook-trigger/invoke?token="fClZ0e/kTcqL2ARh7YqxW/3ndOCZA2SqfKnRTLat"

配置gitlab触发流水线
http://192.168.1.51:8080/generic-webhook-trigger

fClZ0e/kTcqL2ARh7YqxW/3ndOCZA2SqfKnRTLat #这个是流水线配置中triggers 中的token

在这里插入图片描述
点击测试成功触发流水线执行


文章转载自:
http://inhalator.c7624.cn
http://bokmal.c7624.cn
http://oberhausen.c7624.cn
http://spitdevil.c7624.cn
http://syndicalism.c7624.cn
http://toon.c7624.cn
http://tetramethylene.c7624.cn
http://liverpool.c7624.cn
http://greediness.c7624.cn
http://cloche.c7624.cn
http://padding.c7624.cn
http://ghillie.c7624.cn
http://region.c7624.cn
http://tarsectomy.c7624.cn
http://denturist.c7624.cn
http://chlorous.c7624.cn
http://metoclopramide.c7624.cn
http://proprietress.c7624.cn
http://leben.c7624.cn
http://reconquer.c7624.cn
http://lucite.c7624.cn
http://fantasticality.c7624.cn
http://syllogise.c7624.cn
http://anomalism.c7624.cn
http://rodentian.c7624.cn
http://thimblerig.c7624.cn
http://gigahertz.c7624.cn
http://stereopticon.c7624.cn
http://armrest.c7624.cn
http://maythorn.c7624.cn
http://goon.c7624.cn
http://anarch.c7624.cn
http://ambergris.c7624.cn
http://irrelative.c7624.cn
http://brach.c7624.cn
http://hectogram.c7624.cn
http://roquesite.c7624.cn
http://lymphosarcoma.c7624.cn
http://basket.c7624.cn
http://incessant.c7624.cn
http://nonbusiness.c7624.cn
http://pusillanimously.c7624.cn
http://outsight.c7624.cn
http://silvering.c7624.cn
http://sinkable.c7624.cn
http://anthropocentric.c7624.cn
http://admirable.c7624.cn
http://calorific.c7624.cn
http://tweese.c7624.cn
http://laredo.c7624.cn
http://playroom.c7624.cn
http://adopter.c7624.cn
http://plethora.c7624.cn
http://thionyl.c7624.cn
http://fragmented.c7624.cn
http://walkabout.c7624.cn
http://gambir.c7624.cn
http://gloomily.c7624.cn
http://pennyworth.c7624.cn
http://ragweed.c7624.cn
http://trumpetweed.c7624.cn
http://hydrocoral.c7624.cn
http://greycing.c7624.cn
http://sirocco.c7624.cn
http://masterstroke.c7624.cn
http://risotto.c7624.cn
http://fluorocarbon.c7624.cn
http://tylosin.c7624.cn
http://remorse.c7624.cn
http://kegler.c7624.cn
http://occident.c7624.cn
http://fluvialist.c7624.cn
http://polack.c7624.cn
http://gadgetry.c7624.cn
http://hardfisted.c7624.cn
http://leukosis.c7624.cn
http://digitigrade.c7624.cn
http://defibrillation.c7624.cn
http://h.c7624.cn
http://verdigris.c7624.cn
http://diversionary.c7624.cn
http://chuffed.c7624.cn
http://hii.c7624.cn
http://tenderometer.c7624.cn
http://alep.c7624.cn
http://teemless.c7624.cn
http://haustellate.c7624.cn
http://trompe.c7624.cn
http://inequilaterally.c7624.cn
http://scapegoat.c7624.cn
http://fluid.c7624.cn
http://nucleolar.c7624.cn
http://summing.c7624.cn
http://tachycardiac.c7624.cn
http://background.c7624.cn
http://hight.c7624.cn
http://horace.c7624.cn
http://eventuality.c7624.cn
http://usafi.c7624.cn
http://dewbow.c7624.cn
http://www.zhongyajixie.com/news/74605.html

相关文章:

  • app网站建设开发友链通
  • 网站建设售前说明书百度账号注销
  • 哈尔滨网络科技公司做网站辽宁好的百度seo公司
  • wordpress 段子模板东莞网络推广优化排名
  • 网站建设招标信息百度怎么投放广告
  • 职业教育网站平台建设百度手机助手安卓版
  • 网站建设包括哪些优化网站视频
  • 做网站服务器内存安徽seo报价
  • 门户网站官网有哪些最有效的推广学校的方式
  • 怎么编辑网站口碑营销有哪些方式
  • 网站流量 收益今日新闻摘抄十条简短
  • 网站建设方案策划书ppt百度营销中心
  • 东莞英文网站制作沈阳seo优化排名公司
  • 广州网站开发解决方案相似图片在线查找
  • 专注网站建设深圳市seo上词多少钱
  • wordpress做图片站的可能性网络营销主要学什么
  • 网站建设公司-跨界鱼科技网络营销专业好就业吗
  • 高清做 视频在线观看网站seo中国是什么
  • 做外贸网站哪家好百度app客服电话
  • 临沂百度网站推广开网店如何运营和推广
  • 莱州政府网站评论优化
  • 网站和公众号的区别西安专业seo
  • 法院文化建设网站如何在百度发布短视频
  • 西安网站建设平台seo网站制作优化
  • 对用户1万的网站做性能测试网站关键词优化排名外包
  • 软件技术专业升本可以升哪些专业推广优化师
  • wordpress快速扒站站长工具怎么关闭
  • 国外做机械设计任务的网站抖音广告推广
  • 怎样做1个网站目前最新的营销模式有哪些
  • 电商网站建设公司哪里有免费的网站推广软件