【发布时间】:2014-03-04 15:09:14
【问题描述】:
我正在使用 Jenkins 来实现一些基础架构项目的持续交付。 ATM Master-Slave Jenkins 模型用于作业总是由一些从属而不是由主构建的情况下,我的意图是使用 LXC 构建和运行测试厨房和莱布尼茨测试。所有要求都匹配 vagrant-lxc、lxc 盒、leibniz 和测试厨房配置,在我的 PC 或我的任何其他团队成员上一切正常,但是当涉及到通过 Jenkins 上的主从运行作业时,似乎有环境的一些问题,详细说明:
1- 当我作为构建步骤的一部分运行"which lxc-create" 时,它可以正常工作并显示/usr/bin/lxc-create,但
2- 运行 kitchen test 时显示失败:
+ kitchen test
-----> Starting Kitchen (v1.1.1)
-----> Cleaning up any prior instances of <default-ubuntu-1204>
-----> Destroying <default-ubuntu-1204>...
Finished destroying <default-ubuntu-1204> (0m0.00s).
-----> Testing <default-ubuntu-1204>
-----> Creating <default-ubuntu-1204>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #create action: [Expected process to exit with [0], but received '1'
---- Begin output of vagrant up --no-provision --provider=lxc ----
STDOUT:
STDERR: The `lxc` package does not seem to be installed or is not accessible on the PATH.
---- End output of vagrant up --no-provision --provider=lxc ----
Ran vagrant up --no-provision --provider=lxc returned 1]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
似乎缺少某些环境变量或某些东西已连接,重要的是要说 ssh 进入从属设备并手动构建它工作正常,所以不是设置问题,而是主从环境传输问题,或者我错过了一些重要的东西关于配置。谁能提供一些帮助?
lxc 版本:1.0.0
vagrant-lxc: 0.8.0
詹金斯:1.5.49
更新 1: 这是我的厨房配置:
---
driver:
name: vagrant
require_chef_omnibus: false
require_chef_berkshelf: true
customize:
memory: 1024
provisioner:
name: chef_solo
platforms:
- name: ubuntu-12.04
driver:
box: "ubuntu-12.04"
box_url: "http://dl.company.com/ubuntu1204-lxc-amd64.box"
provider: lxc
suites:
....
【问题讨论】:
-
什么用户正在运行
kitchenvslxc-create。你有 kitchen-lxc 驱动程序吗?为什么涉及流浪者,我不清楚。 -
@sethvargo Jenkins 正在使用 Vagrant 驱动程序和 LXC 提供程序为 vagrant 运行“厨房测试”。为了澄清,我添加了一个运行“which lxc-create”的步骤,只是为了检查 Jenkins 从属环境是否可以运行 lxc-create 并且确实可以。
标签: jenkins vagrant lxc continuous-delivery test-kitchen