Skip to content

Commit

Permalink
Update testing (#39)
Browse files Browse the repository at this point in the history
* Fix metadata
* Remove foodcritic
* Fix markdown


---------

Signed-off-by: Dan Webb <dan.webb@damacus.io>
  • Loading branch information
damacus committed Nov 6, 2023
1 parent 8fc8ed1 commit ed86a4d
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 37 deletions.
10 changes: 0 additions & 10 deletions .circleci/config.yml

This file was deleted.

1 change: 0 additions & 1 deletion .foodcritic

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: "Test"

"on":
pull_request:
push:
branches: [main]

jobs:
lint-unit:
uses: sous-chefs/.github/.github/workflows/lint-unit.yml@3.0.0
permissions:
actions: write
checks: write
pull-requests: write
statuses: write
issues: write

integration:
needs: "lint-unit"
runs-on: ubuntu-latest
strategy:
matrix:
os:
- almalinux-8
- amazonlinux-2
- debian-10
- debian-11
- centos-7
- centos-stream-8
- ubuntu-1804
- ubuntu-2004
- ubuntu-2204
- rockylinux-8
suite: [default]
fail-fast: false
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install Chef
uses: actionshub/chef-install@2.0.4
- name: Dokken
uses: actionshub/test-kitchen@2.1.0
env:
CHEF_LICENSE: accept-no-persist
KITCHEN_LOCAL_YAML: kitchen.dokken.yml
with:
suite: ${{ matrix.suite }}
os: ${{ matrix.os }}

final:
runs-on: ubuntu-latest
needs: [integration]
steps:
- run: echo ${{needs.integration.outputs}}
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
- uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
close-issue-message: >
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This file is used to list changes made in each version of visualstudio.

## Unreleased

- Update testing

## 2.0.2 - *2021-08-31*

- Standardise files with files in sous-chefs/repo-management
Expand Down
35 changes: 14 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
[![Cookbook Version](http://img.shields.io/cookbook/v/visualstudio.svg)](https://supermarket.chef.io/cookbooks/visualstudio)
[![Build status](https://ci.appveyor.com/api/projects/status/ttumjhmmxjo5j7gv/branch/master?svg=true)](https://ci.appveyor.com/project/ChefWindowsCookbooks65871/visualstudio/branch/master)

# VisualStudio Cookbook

This Chef cookbook installs Visual Studio 2010, 2012, 2013, 2015 from an ISO.

# Requirements
## Requirements

This cookbook assumes the appropriate version of the .NET framework has already been installed before running the VisualStudio cookbook. To install .NET you can use the [dotnetframework cookbook](https://supermarket.chef.io/cookbooks/dotnetframework). You must reboot the system after the .NET installation and before the VisualStudio installation.

Expand Down Expand Up @@ -52,9 +49,9 @@ For Windows7 SP1 and Windows Server 2008 SP1 you must first install [KB2664825](

If you _really_ want to install VS 2015 on Windows Server 2012R2 over naked WinRM, you can if you first install [KB2999226](http://support.microsoft.com/kb/2999226), otherwise the VS installer will fail with error 1603.

# Attributes
## Attributes

## Optional
### Optional

| Key | Type | Description | Default |
|-----|------|-------------|---------|
Expand All @@ -68,7 +65,7 @@ If you _really_ want to install VS 2015 on Windows Server 2012R2 over naked WinR
| `['visualstudio']['install_items'][FEATURE]['selected']` | Boolean | Configures the feature on/off. This currently applies to all versions/editions being installed. | |
| `['visualstudio']['2010']['professional']['config_file']` | String | The name of the Visual Studio 2010 unattend.ini template to use. | |

# Usage
## Usage

Add `'visualstudio::default'` to your runlist. This will install VS 2015 Community Edition from the publicly available ISO. If you'd like to install another edition set the 'edition' attribute to: 'community', 'professional', 'premium', or 'testprofessional'. If you'd like to install a different version set the 'version' attribute to: '2010', '2012', '2013', '2015'.

Expand Down Expand Up @@ -113,25 +110,25 @@ Do not edit the `node['visualstudio'][<version>][<edition>]['default_install_ite

Unlike newer versions of VisualStudio which use an AdminDeployment.xml file, VS 2010 uses an unattend.ini file, which, among other things, is OS-specific. By default, this cookbook uses VS 2010's `/q` option, which works for all Windows versions and specifies a default installation. To customize the installation, you may specify an unattend.ini template instead. The use of a template instead of a static file is required due to relative paths inside the file. This cookbook includes an unattend.ini template sample.

# Recipes
## Recipes

## default
### default

Ensures all VisualStudio prereqs are installed first and then only runs the install recipe if they are met. You should add this recipe to your run list.

## install
### install

Installs VisualStudio using the included AdminDeployment.xml or default silent install. Included by the default recipe.

## nuget
### nuget

Configures the enable_nuget_package_restore environment variable. Included by the default recipe.

## dotnet_prereq
### dotnet_prereq

Logs a warning if .NET 4.5.x is not installed. This recipe does not curently check for .NET 4.6. Included by the default recipe.

# Optional Recipes
## Optional Recipes

## install_update

Expand All @@ -141,7 +138,7 @@ Installs VS updates from the corresponding VS update ISO that is publicly downlo

Installs the Microsoft Office Developer Tools for Visual Studio 2012. Add this to your runlist if you need Office development tools for Office plugin development. Other versions of VS are not currently supported and will log a Chef warning.

# Resource/Provider
## Resource/Provider

This cookbook makes the `visualstudio_edition` and `visualstudio_update` resource definitions available.

Expand All @@ -159,30 +156,26 @@ visualstudio_edition 'vs_2015_professional' do
end
```

# Troubleshooting
## Troubleshooting

If the installer fails very early in the install process, check a few of things:

- Ensure you have the correct .NET version installed first and you've rebooted.
- Check the VS installation log which is located in c:\program files (x86)\Microsoft Visual Studio &lt;version&gt;\vsinstall.log
- Ensure you're not running over naked WinRM, i.e. knife-winrm or test-kitchen. Unfortunately because of the Windows security model this cookbook will not work over WinRM without a scheduled task.

# TO DO
## TO DO

- Check for .NET 4.6 installed, but only if VS 2015 is going to be installed
- Support VSTO on all versions of VS
- More tests
- Refactor duplication between cookbook helper and test helper

# Contributing
## Contributing

1. Fork the repository on Github
2. Create a named feature branch (i.e. add-vsto-support-for-vs2010)
3. Write your change
4. Write tests for your change (if applicable)
5. Run the build and ensure it passes. `bundle install && bundle exec rake && kitchen verify`
6. Submit a Pull Request

# Author

Author:: Shawn Neal (<sneal@sneal.net>)
8 changes: 4 additions & 4 deletions metadata.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name 'visualstudio'
maintainer 'Shawn Neal'
maintainer_email 'sneal@sneal.net'
source_url 'https://github.com/windowschefcookbooks/visualstudio'
issues_url 'https://github.com/windowschefcookbooks/visualstudio/issues'
maintainer 'Sous Chefs'
maintainer_email 'help@sous-chefs.org'
source_url 'https://github.com/sous-chefs/visualstudio'
issues_url 'https://github.com/sous-chefs/visualstudio/issues'
chef_version '>= 13.0'
license 'Apache-2.0'
description 'Installs/Configures Visual Studio'
Expand Down
1 change: 1 addition & 0 deletions resources/edition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

actions :install
default_action :install
unified_mode true

# The VS edition: professional etc
attribute :edition, kind_of: String, name_attribute: true
Expand Down
1 change: 1 addition & 0 deletions resources/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

actions :install
default_action :install
unified_mode true

# The VS installation directory
attribute :install_dir, kind_of: String, required: true
Expand Down

0 comments on commit ed86a4d

Please sign in to comment.