小编Dir*_*kos的帖子

在Jenkins阶段之间传递变量

我想以某种方式将我在A阶段读到的变量传递给B阶段.我在一些例子中看到人们把它写到文件中,但我想这不是一个很好的解决方案.我尝试将它写入环境变量,但我并没有真正成功.如何正确设置?

为了使它工作,我尝试了很多东西,并且读到我应该使用""而不是'''来启动shell并将这些变量转义\${foo}为例如.

以下是我作为管道的内容:

#!/usr/bin/env groovy

pipeline {

    agent { node { label 'php71' } }

    environment {
        packageName='my-package'
        packageVersion=''
        groupId='vznl'
        nexus_endpoint='http://nexus.devtools.io'
        nexus_username='jenkins'
        nexus_password='J3nkins'
    }

    stages{

        // Package dependencies
        stage('Install dependencies') {
            steps {
                sh '''
                    echo Skip composer installation
                    #composer install  --prefer-dist --optimize-autoloader --no-interaction
                '''
            }
        }

        // Unit tests
        stage('Unit Tests') {
            steps {
                sh '''
                    echo Running PHP code coverage tests...
                    #composer test
                '''
            }
        }

        // Create artifact
        stage('Package') {
            steps {
                echo 'Create package …
Run Code Online (Sandbox Code Playgroud)

jenkins jenkins-pipeline

8
推荐指数
1
解决办法
1万
查看次数

使用 azurerm 配置 Terraform 子网时出错

最近我发现我的 AKS 集群拥有一个太小的子网。因此,我尝试添加第二个子网和节点池(现在可以通过 Azure CNI 实现),然后创建一个适当的子网并将其迁移回来。

在有效响应的过程中terraform plan一切顺利,但是在应用时它会抛出错误。

Error: Error Creating/Updating Subnet "me-test-k8s-subnet2" (Virtual Network "me-test-k8s-vnet" / Resource Group "me-test-k8s-rg"): network.SubnetsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="NetcfgInvalidSubnet" Message="Subnet 'me-test-k8s-subnet2' is not valid in virtual network 'me-test-k8s-vnet'." Details=[]

  on main.tf line 28, in resource "azurerm_subnet" "subnet2":
  28: resource "azurerm_subnet" "subnet2" {
Run Code Online (Sandbox Code Playgroud)

我的原始集群是使用以下配置创建的Terraform

  name     = "${var.cluster_name}-rg"
  location = "${var.location}"
}

resource "azurerm_virtual_network" "network" {
  name                = "${var.cluster_name}-vnet"
  location            = "${azurerm_resource_group.rg.location}"
  resource_group_name = "${azurerm_resource_group.rg.name}"
  address_space       = ["10.1.0.0/16"] …
Run Code Online (Sandbox Code Playgroud)

azure terraform azure-aks

7
推荐指数
1
解决办法
1万
查看次数

ZF2表单将所有选择选项设置为在绑定时选择

我的ZF2表单元素有问题(选择).当我将我的学说实体绑定到此表单时,我的所有选择选项都会获得所选属性,而不仅仅是应该选择的属性.实体刚刚获得了一个连接对象,并且Hydrator也被设置为for.

这是我的一些代码.希望我只是错过了一些小事.

AddressEntity.php

<?php

namespace Application\Entity;

use Doctrine\ORM\Mapping as ORM;
use ZF2Core\Entity\AbstractEntity;

/**
 * @ORM\Entity
 * @ORM\Table(name="`address`")
 */
class Address extends AbstractEntity
{

    /**
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     * @ORM\Column(type="bigint", options={"unsigned":true})
     */
    protected $addressId;

    /**
     * @ORM\ManyToOne(targetEntity="SNOrganisation\Entity\Organisation", inversedBy="organisationId")
     * @ORM\JoinColumn(name="organisationId", referencedColumnName="organisationId", nullable=false)
     */
    protected $organisation;

    /**
     * @ORM\ManyToOne(targetEntity="AddressType")
     * @ORM\JoinColumn(name="addressTypeId", referencedColumnName="addressTypeId", nullable=false)
     */
    protected $addressType;

    /** @ORM\Column(type="string", nullable=true) */
    protected $otys;

    /** @ORM\Column(type="string") */
    protected $address;

    /** @ORM\Column(type="string", nullable=true) */
    protected $postalcode;

    /** @ORM\Column(type="string") */
    protected $city;

    /** @ORM\Column(type="string", nullable=true) …
Run Code Online (Sandbox Code Playgroud)

php doctrine-orm zend-framework2

5
推荐指数
1
解决办法
1945
查看次数