Add chef13 support (#5)
* #4 enable chef 13 support * Fix foodcritic and rubocop issues * Set cookbook deployment to supermarket from travis-ci
This commit is contained in:
Родитель
81d45add33
Коммит
699e096041
19
.kitchen.yml
19
.kitchen.yml
|
@ -16,26 +16,26 @@ platforms:
|
|||
driver_config:
|
||||
box: debian/jessie64
|
||||
provisioner:
|
||||
require_chef_omnibus: 12.4.3
|
||||
require_chef_omnibus: 12.20.3
|
||||
|
||||
- name: ubuntu1604
|
||||
driver_config:
|
||||
box: ubuntu/xenial64
|
||||
provisioner:
|
||||
require_chef_omnibus: 12.4.3
|
||||
require_chef_omnibus: 13.0.118
|
||||
|
||||
- name: centos6
|
||||
driver_config:
|
||||
box: bento/centos-6.7
|
||||
provisioner:
|
||||
require_chef_omnibus: 12.4.3
|
||||
require_chef_omnibus: 12.20.3
|
||||
|
||||
# private boxes
|
||||
- name: osx109-desktop
|
||||
driver_config:
|
||||
box: osx109-desktop #private
|
||||
provisioner:
|
||||
require_chef_omnibus: 12.4.3
|
||||
require_chef_omnibus: 13.0.118
|
||||
|
||||
- name: windows10
|
||||
driver_config:
|
||||
|
@ -43,16 +43,7 @@ platforms:
|
|||
communicator: 'winrm'
|
||||
box: win10x64-enterprise #private
|
||||
provisioner:
|
||||
require_chef_omnibus: 12.4.3
|
||||
|
||||
- name: windows81
|
||||
driver_config:
|
||||
guest: windows
|
||||
communicator: 'winrm'
|
||||
box: win81x64-enterprise #private
|
||||
provisioner:
|
||||
require_chef_omnibus: 12.4.3
|
||||
|
||||
require_chef_omnibus: 12.20.3
|
||||
|
||||
suites:
|
||||
- name: windows-basic
|
||||
|
|
|
@ -18,4 +18,7 @@ Metrics/MethodLength:
|
|||
Max: 30
|
||||
|
||||
Metrics/AbcSize:
|
||||
Max: 30
|
||||
Max: 30
|
||||
|
||||
EndOfLine:
|
||||
Enabled: false
|
14
.travis.yml
14
.travis.yml
|
@ -1,16 +1,22 @@
|
|||
language: generic
|
||||
|
||||
sudo: false
|
||||
|
||||
env:
|
||||
global:
|
||||
- PATH="/opt/chefdk/bin:/opt/chef/bin:/opt/chef/embedded/bin:/opt/chefdk/embedded/bin:$PATH"
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- chef-stable-precise
|
||||
packages:
|
||||
- chefdk
|
||||
|
||||
script: chef exec rake travis
|
||||
before_install:
|
||||
- openssl aes-256-cbc -K $encrypted_92c995406a15_key -iv $encrypted_92c995406a15_iv
|
||||
-in supermarket.pem.enc -out supermarket.pem -d
|
||||
deploy:
|
||||
provider: chef-supermarket
|
||||
user_id: vsts_agent_cookbook
|
||||
client_key: supermarket.pem
|
||||
cookbook_category: Others
|
||||
on:
|
||||
tags: true
|
||||
|
|
|
@ -11,7 +11,7 @@ Please check [Wiki](https://github.com/Microsoft/vsts-agent-cookbook/wiki) for m
|
|||
|
||||
Requirements
|
||||
------------
|
||||
- Chef 12 or higher
|
||||
- Chef 12.5.0 or higher
|
||||
|
||||
### Platforms
|
||||
The following platforms are tested and supported:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
default['vsts_agent']['binary']['version'] = '2.110.0'
|
||||
default['vsts_agent']['binary']['version'] = '2.116.1'
|
||||
|
||||
case node['platform_family']
|
||||
when 'windows'
|
||||
|
|
|
@ -76,9 +76,9 @@ module VSTS
|
|||
node['vsts_agent']['agents'][agent_name].nil? ||
|
||||
node['vsts_agent']['agents'][agent_name]['install_dir'].nil? ||
|
||||
node['vsts_agent']['agents'][agent_name]['install_dir'].empty?
|
||||
return false
|
||||
false
|
||||
else
|
||||
return true
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ description 'Installs/Configures visualstudio team services build agents'
|
|||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||
source_url 'https://github.com/Microsoft/vsts-agent-cookbook' if respond_to?(:source_url)
|
||||
issues_url 'https://github.com/Microsoft/vsts-agent-cookbook/issues' if respond_to?(:issues_url)
|
||||
version '1.1.2'
|
||||
version '1.2.0'
|
||||
|
||||
%w( ubuntu debian mac_os_x mac_os_x_server windows ).each do |os|
|
||||
%w(ubuntu debian mac_os_x mac_os_x_server windows).each do |os|
|
||||
supports os
|
||||
end
|
||||
|
||||
|
|
|
@ -11,17 +11,18 @@ def whyrun_supported?
|
|||
end
|
||||
|
||||
def load_current_resource
|
||||
@current_resource = Chef::Resource::VstsAgent.new(@new_resource.name)
|
||||
@current_resource = Chef::ResourceResolver.resolve(:vsts_agent).new(@new_resource.name)
|
||||
@current_resource.agent_name(@new_resource.agent_name)
|
||||
@current_resource.vsts_token(@new_resource.vsts_token)
|
||||
load_current_state(@current_resource, node)
|
||||
@current_resource
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics/BlockLength
|
||||
action :install do
|
||||
version = new_resource.version || node['vsts_agent']['binary']['version']
|
||||
|
||||
vsts_agent_service new_resource.agent_name do
|
||||
vsts_agent_service new_resource.agent_name do # ~FC021
|
||||
install_dir new_resource.install_dir
|
||||
user new_resource.user
|
||||
group new_resource.group
|
||||
|
@ -118,7 +119,6 @@ action :install do
|
|||
notifies :enable, service_id, :immediately if new_resource.runasservice
|
||||
end
|
||||
|
||||
|
||||
ruby_block "save state for agent '#{new_resource.agent_name}'" do
|
||||
block do
|
||||
save_vars(new_resource, node)
|
||||
|
@ -153,6 +153,7 @@ action :install do
|
|||
action :create
|
||||
end
|
||||
end
|
||||
# rubocop:enable Metrics/BlockLength
|
||||
|
||||
action :remove do
|
||||
if @current_resource.exists # ~FC023
|
||||
|
|
Двоичный файл не отображается.
|
@ -3,7 +3,7 @@ include_recipe 'apt::default'
|
|||
include_recipe 'build-essential::default'
|
||||
|
||||
user 'vagrant' do
|
||||
supports :manage_home => true
|
||||
manage_home true
|
||||
comment 'Vagrant user'
|
||||
home '/home/vagrant'
|
||||
shell '/bin/bash'
|
||||
|
@ -11,7 +11,7 @@ user 'vagrant' do
|
|||
end
|
||||
|
||||
user 'builder' do
|
||||
supports :manage_home => true
|
||||
manage_home true
|
||||
comment 'Builder user'
|
||||
home '/home/builder'
|
||||
shell '/bin/bash'
|
||||
|
|
Загрузка…
Ссылка в новой задаче