Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .kitchen.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Berksfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source 'https://supermarket.chef.io'

cookbook 'test', path: 'test/fixtures/cookbooks/test'
cookbook 'test', path: 'test/cookbooks/test'

metadata
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [0.2.11](https://github.com/sous-chefs/appveyor-ci/compare/0.2.10...v0.2.11) (2025-10-14)


### Bug Fixes

* **ci:** Update release workflow ([#71](https://github.com/sous-chefs/appveyor-ci/issues/71)) ([660220a](https://github.com/sous-chefs/appveyor-ci/commit/660220afd12867b079ac635db7b770888af3d0e9))
- **ci:** Update release workflow ([#71](https://github.com/sous-chefs/appveyor-ci/issues/71)) ([660220a](https://github.com/sous-chefs/appveyor-ci/commit/660220afd12867b079ac635db7b770888af3d0e9))

## 0.2.10 - *2025-09-04*

Expand Down
5 changes: 5 additions & 0 deletions LIMITATIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# AppVeyor Deployment Agent Limitations

- The AppVeyor deployment agent is Windows-only; this cookbook should only advertise and test Windows support.
- Installation depends on the public MSI download endpoint at `https://www.appveyor.com/downloads/deployment-agent/<version>/AppveyorDeploymentAgent.msi`.
- The resource expects an AppVeyor deployment access key and deployment group at converge time.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ environment:
user_password: Pass@word1

matrix:
- ruby_version: "23"
- ruby_version: "23"

clone_folder: c:\GitHub\chef-appveyor-ci
clone_depth: 1
Expand Down
40 changes: 40 additions & 0 deletions documentation/appveyor-ci_appveyor_agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# appveyor-ci_appveyor_agent

Installs the AppVeyor deployment agent MSI on Windows hosts.

## Actions

| Action | Description |
|--------|-------------|
| `:install` | Installs the AppVeyor deployment agent (default). |

## Properties

| Property | Type | Default | Description |
|----------|------|---------|-------------|
| `version` | String | name property | AppVeyor deployment agent version to install. |
| `access_key` | String | `nil` | Deployment access key used by the agent. |
| `environment_access_key` | String | `nil` | Alias for `access_key` for compatibility with existing examples. |
| `deployment_group` | String | required | AppVeyor deployment group name. |
| `installer_url` | String | derived from `version` | Custom MSI download URL. |
| `install_path` | String | `'C:\\Program Files (x86)\\AppVeyor\\DeploymentAgent\\Appveyor.DeploymentAgent.Service.exe'` | Expected installation path. |

## Examples

### Install the latest agent

```ruby
appveyor_agent 'latest' do
access_key 'abc123'
deployment_group 'test'
end
```

### Install a specific version

```ruby
appveyor_agent '3.12.0' do
environment_access_key 'abc123'
deployment_group 'production'
end
```
4 changes: 0 additions & 4 deletions kitchen.exec.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
driver: { name: exec }
transport: { name: exec }

platforms:
- name: macos-latest
- name: windows-latest
23 changes: 0 additions & 23 deletions kitchen.global.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,3 @@ provisioner:

verifier:
name: inspec

platforms:
- name: almalinux-8
- name: almalinux-9
- name: amazonlinux-2023
- name: centos-7
- name: centos-stream-8
- name: centos-stream-9
- name: debian-9
- name: debian-10
- name: debian-11
- name: debian-12
- name: fedora-latest
- name: opensuse-leap-15
- name: oraclelinux-7
- name: oraclelinux-8
- name: oraclelinux-9
- name: rockylinux-8
- name: rockylinux-9
- name: ubuntu-18.04
- name: ubuntu-20.04
- name: ubuntu-22.04
- name: ubuntu-23.04
29 changes: 29 additions & 0 deletions kitchen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
verifier:
name: inspec

x-run_lists:
default: &default_run_list
- recipe[test::default]
versioned: &versioned_run_list
- recipe[test::versioned]

x-verifiers:
default: &default_verifier
inspec_tests:
- path: test/integration/default
versioned: &versioned_verifier
inspec_tests:
- path: test/integration/versioned

platforms:
- name: windows-latest

suites:
- name: default
run_list: *default_run_list
verifier: *default_verifier

- name: versioned
run_list: *versioned_run_list
verifier: *versioned_verifier
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
issues_url 'https://github.com/sous-chefs/appveyor-ci/issues'
source_url 'https://github.com/sous-chefs/appveyor-ci'
version '0.2.11'
chef_version '>= 13.0'
chef_version '>= 15.3'

supports 'windows'
45 changes: 20 additions & 25 deletions resources/agent_install.rb
Original file line number Diff line number Diff line change
@@ -1,35 +1,30 @@
# frozen_string_literal: true

# Cookbook:: appveyor-agent
# Resource:: agent
#
# Copyright:: (C) 2016 J Sainsburys PLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

resource_name :appveyor_agent_install
provides :appveyor_agent
provides :appveyor_agent_install
unified_mode true

property :version, String, name_property: true
property :access_key, String, required: true
property :version, String, name_property: true
property :access_key, String, sensitive: true
property :environment_access_key, String, sensitive: true
property :deployment_group, String, required: true
property :installer_url, String, default: lazy { "https://www.appveyor.com/downloads/deployment-agent/#{version}/AppveyorDeploymentAgent.msi" }
property :install_path, String, default: lazy { 'C:\\Program Files (x86)\\AppVeyor\\DeploymentAgent\\Appveyor.DeploymentAgent.Service.exe' }
property :installer_url, String, default: lazy { "https://www.appveyor.com/downloads/deployment-agent/#{version}/AppveyorDeploymentAgent.msi" }
property :install_path, String, default: 'C:\\Program Files (x86)\\AppVeyor\\DeploymentAgent\\Appveyor.DeploymentAgent.Service.exe'

default_action :install

action_class do
def resolved_access_key
new_resource.access_key || new_resource.environment_access_key
end
end

action :install do
raise Chef::Exceptions::ValidationFailed, 'appveyor_agent requires access_key or environment_access_key' if resolved_access_key.nil? || resolved_access_key.empty?

windows_package 'AppveyorDeploymentAgent' do
source installer_url
source new_resource.installer_url
installer_type :msi
options "/quiet /qn /norestart /log install.log ENVIRONMENT_ACCESS_KEY=#{new_resoruce.access_key} DEPLOYMENT_GROUP=#{new_resoruce.deployment_group}"
options "/quiet /qn /norestart /log install.log ENVIRONMENT_ACCESS_KEY=#{resolved_access_key} DEPLOYMENT_GROUP=#{new_resource.deployment_group}"
end
end
10 changes: 10 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

require 'chefspec'
require 'chefspec/berkshelf'

RSpec.configure do |config|
config.color = true
config.formatter = :documentation
config.log_level = :error
end
10 changes: 0 additions & 10 deletions spec/unit/recipes/default_spec.rb

This file was deleted.

41 changes: 41 additions & 0 deletions spec/unit/resources/agent_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'appveyor_agent' do
step_into :appveyor_agent
platform 'windows', '2019'

context 'with access_key' do
recipe do
appveyor_agent 'latest' do
access_key 'abc123'
deployment_group 'test'
end
end

it do
is_expected.to install_windows_package('AppveyorDeploymentAgent').with(
source: 'https://www.appveyor.com/downloads/deployment-agent/latest/AppveyorDeploymentAgent.msi',
installer_type: :msi,
options: '/quiet /qn /norestart /log install.log ENVIRONMENT_ACCESS_KEY=abc123 DEPLOYMENT_GROUP=test'
)
end
end

context 'with environment_access_key' do
recipe do
appveyor_agent '3.12.0' do
environment_access_key 'def456'
deployment_group 'deploy'
end
end

it do
is_expected.to install_windows_package('AppveyorDeploymentAgent').with(
source: 'https://www.appveyor.com/downloads/deployment-agent/3.12.0/AppveyorDeploymentAgent.msi',
options: '/quiet /qn /norestart /log install.log ENVIRONMENT_ACCESS_KEY=def456 DEPLOYMENT_GROUP=deploy'
)
end
end
end
4 changes: 4 additions & 0 deletions test/cookbooks/test/metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name 'test'
version '0.1.0'

depends 'appveyor-ci'
6 changes: 6 additions & 0 deletions test/cookbooks/test/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# frozen_string_literal: true

appveyor_agent 'latest' do
access_key 'test-access-key'
deployment_group 'test'
end
6 changes: 6 additions & 0 deletions test/cookbooks/test/recipes/versioned.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# frozen_string_literal: true

appveyor_agent '3.12.0' do
access_key 'test-access-key'
deployment_group 'test'
end
4 changes: 0 additions & 4 deletions test/fixtures/cookbooks/test/latest.rb

This file was deleted.

4 changes: 0 additions & 4 deletions test/fixtures/cookbooks/test/metadata.rb

This file was deleted.

4 changes: 0 additions & 4 deletions test/fixtures/cookbooks/test/specifed_version.rb

This file was deleted.

7 changes: 0 additions & 7 deletions test/integration/appveyor-agent-3-12-0/default_spec.rb

This file was deleted.

3 changes: 0 additions & 3 deletions test/integration/appveyor-agent-latest/default_spec.rb

This file was deleted.

10 changes: 10 additions & 0 deletions test/integration/default/controls/default_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

control 'appveyor-agent-default-01' do
impact 1.0
title 'AppVeyor deployment agent is installed'

describe file('C:\\Program Files (x86)\\AppVeyor\\DeploymentAgent\\Appveyor.DeploymentAgent.Service.exe') do
it { should exist }
end
end
7 changes: 7 additions & 0 deletions test/integration/default/inspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: default
title: Default AppVeyor agent tests
maintainer: Sous Chefs
license: Apache-2.0
summary: Verifies the default AppVeyor agent installation
version: 1.0.0
14 changes: 14 additions & 0 deletions test/integration/versioned/controls/versioned_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

control 'appveyor-agent-versioned-01' do
impact 1.0
title 'Pinned AppVeyor deployment agent version is installed'

describe file('C:\\Program Files (x86)\\AppVeyor\\DeploymentAgent\\Appveyor.DeploymentAgent.Service.exe') do
it { should exist }
end

describe command('Write-Host ([System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Program Files (x86)\AppVeyor\DeploymentAgent\Appveyor.DeploymentAgent.Service.exe")).FileVersion') do
its('stdout') { should match(/3.12.0/) }
end
end
7 changes: 7 additions & 0 deletions test/integration/versioned/inspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: versioned
title: Versioned AppVeyor agent tests
maintainer: Sous Chefs
license: Apache-2.0
summary: Verifies a pinned AppVeyor agent installation
version: 1.0.0
Loading