Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenlauck committed Aug 2, 2018
1 parent 11eabc7 commit 4a9ee3d
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ bin/*
Berksfile.lock
.zero-knife.rb
Policyfile.lock.json
results/
14 changes: 7 additions & 7 deletions .kitchen.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
---
driver:
name: vagrant
synced_folders:
- ["./", "/tmp/package"]

provisioner:
name: chef_zero
# You may wish to disable always updating cookbooks in CI or other testing environments.
# For example:
# always_update_cookbooks: <%= !ENV['CI'] %>
always_update_cookbooks: true

verifier:
name: inspec

platforms:
- name: ubuntu-16.04
- name: centos-7
- name: windows-2016
driver_config:
box: mwrock/Windows2016


suites:
- name: default
run_list:
- recipe[windows-habitat-no-docker::default]
verifier:
inspec_tests:
- test/integration/default
- test/smoke/default
attributes:
9 changes: 9 additions & 0 deletions habitat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Habitat package: windows-habitat-no-docker

## Description

Provide a brief description of the `windows-habitat-no-docker` plan / purpose.

## Usage

Describe the general usage for the `windows-habitat-no-docker` plan
3 changes: 3 additions & 0 deletions habitat/default.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Use this file to templatize your application's native configuration files.
# See the docs at https://www.habitat.sh/docs/create-packages-configure/.
# You can safely delete this file if you don't need it.
28 changes: 28 additions & 0 deletions habitat/plan.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
$pkg_name="windows-habitat-no-docker"
$pkg_origin="lauck"
$pkg_version="0.1.0"
$pkg_maintainer="The Habitat Maintainers <[email protected]>"
$pkg_license=@("Apache-2.0")
$pkg_source="http://some_source_url/releases/${pkg_name}-${pkg_version}.zip"
# $pkg_filename="$pkg_name-$pkg_version.zip"
# $pkg_shasum="TODO"
# $pkg_deps=@()
# $pkg_build_deps=@()
# $pkg_lib_dirs=@("lib")
# $pkg_include_dirs=@("include")
# $pkg_bin_dirs=@("bin")
# $pkg_svc_run="MyBinary.exe"
# $pkg_exports=@{
# host="srv.address"
# port="srv.port"
# ssl-port="srv.ssl.port"
# }
# $pkg_exposes=@("port", "ssl-port")
# $pkg_binds=@{
# database="port host"
# }
# $pkg_binds_optional=@{
# storage="port host"
# }
# $pkg_description="Some description."
# $pkg_upstream_url="http://example.com/project-name"
2 changes: 2 additions & 0 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@
# a Supermarket.
#
# source_url 'https://github.com/<insert_org_here>/windows-habitat-no-docker'

depends 'chocolatey'
16 changes: 16 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,19 @@
# Recipe:: default
#
# Copyright:: 2018, The Authors, All Rights Reserved.

include_recipe 'chocolatey::default'

%w( habitat ).each do |pkg|
chocolatey_package pkg do
action :install
end
end

powershell_script 'habitat build' do
cwd '/tmp/package'
code <<-EOH
$env:PATH += ";C:\habitat"
hab pkg build
EOH
end
13 changes: 3 additions & 10 deletions test/integration/default/default_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@
# The Inspec reference, with examples and extensive documentation, can be
# found at http://inspec.io/docs/reference/resources/

unless os.windows?
# This is an example test, replace with your own test.
describe user('root'), :skip do
it { should exist }
end
end

# This is an example test, replace it with your own test.
describe port(80), :skip do
it { should_not be_listening }
describe chocolatey_package('habitat') do
it { should be_installed }
its('version') { should eq '-.59.0/20180712120048' }
end

0 comments on commit 4a9ee3d

Please sign in to comment.