【问题标题】:"Start VM Azure" stage is pending for Node to be available“启动 VM Azure”阶段等待节点可用
【发布时间】:2020-03-24 17:28:41
【问题描述】:

管道卡住了,因为“测试应用程序”阶段正在等待 $Node 可用,但 $Node 应该由“启动 VM Azure 机器”阶段启动... 如何解决这个问题?

pipeline {
agent {label 'master'}
stages {
    stage("Start VM Azure Machine"){
        steps{
            build(job: 'Run_or_Stop_Azure_VM', parameters: [string(name:'start_or_deallocate', value: 'start'), string(name: 'Node', value:"${NODE}")] )
        }}          
    stage("Test app"){
        steps {
            build(job:'App install', parameters: [string(name: 'Node', value:"${NODE}")] )
        }}
    stage("Deallocate the machine"){
        steps{
            build(job: 'Run_or_Stop_Azure_VM', parameters: [string(name:'start_or_deallocate', value: 'stop'), string(name: 'Node', value:"${NODE}")] )
        }}  
}}  

【问题讨论】:

  • 有什么问题?阶段“开始...”不启动 VM 节点?然后应该报错停止流水线。
  • @zett42 阶段“Start VM..”未启动,因为管道等待 $Node 上线。悖论... stage("Test app") 需要在线 $Node 才能启动
  • 请详细说明“Run_or_Stop_Azure_VM”在做什么。
  • 它的参数化 FreeStyle 项目:取两个字符串:start_or_deallocate, Node ;限制可以运行此项目的位置: master ;执行 shell 命令: az vm ${start_or_deallocate} --resource-group "resGroup" --name "${Node}" ;
  • 好的,我想通了。将:This project is parameterized: Node 更改为 This project is parameterized: String。问题已解决

标签: windows azure jenkins jenkins-pipeline virtual-machine


【解决方案1】:

好的,我想通了。 改变了:

本项目参数化:Node

这个项目是参数化的:字符串。

问题已解决

【讨论】:

    猜你喜欢
    • 2018-09-30
    • 1970-01-01
    • 2021-03-19
    • 2018-09-01
    • 2020-05-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多