diff --git a/lib/workup/version.rb b/lib/workup/version.rb index d8c088a..8c466e8 100644 --- a/lib/workup/version.rb +++ b/lib/workup/version.rb @@ -17,5 +17,5 @@ # module Workup - VERSION = '0.1.0' + VERSION = '0.1.1' end diff --git a/omnibus/config/projects/workup.rb b/omnibus/config/projects/workup.rb index 2efa743..0c46c5f 100644 --- a/omnibus/config/projects/workup.rb +++ b/omnibus/config/projects/workup.rb @@ -13,7 +13,8 @@ # and /opt/workup on all other platforms install_dir "#{default_root}/#{name}" -build_version Omnibus::BuildVersion.semver +build_version '0.1.1' + build_iteration 1 # Creates required build directories @@ -30,5 +31,6 @@ exclude '**/bundler/git' package :msi do + fast_msi upgrade_code '769d8737-c798-49d1-bab0-0a31da3ee7df'.capitalize end diff --git a/omnibus/config/software/workup.rb b/omnibus/config/software/workup.rb index e5cbffe..aaee850 100644 --- a/omnibus/config/software/workup.rb +++ b/omnibus/config/software/workup.rb @@ -60,5 +60,14 @@ env = with_standard_compiler_flags(with_embedded_path) - gem 'install pkg/workup-0.1.0.gem', env: env + gem 'install pkg/workup-0.1.1.gem', env: env + + block do + open("#{install_dir}/bin/workup.bat", "w") do |file| + file.print <<-EOH +@ECHO OFF +"%~dp0\\..\\embedded\\bin\\workup.bat" %* +EOH + end + end if windows? end diff --git a/omnibus/workup_build/recipes/default.rb b/omnibus/workup_build/recipes/default.rb index fc91567..8c8f25d 100644 --- a/omnibus/workup_build/recipes/default.rb +++ b/omnibus/workup_build/recipes/default.rb @@ -32,4 +32,13 @@ command 'installer -pkg $(ls /vagrant/code/workup/omnibus/pkg/*.pkg | tail -n1) -target /' end when 'windows' + execute 'copy pkg back' do + command 'robocopy /vagrant/code/workup/omnibus/pkg /Users/vagrant/workup/omnibus/pkg' + returns [0, 1, 2, 3] + end + + powershell_script 'install workup' do + action :run + code "cmd /c start '' /wait msiexec /i (ls /vagrant/code/workup/omnibus/pkg/*.msi | select -last 1).FullName /qn" + end end diff --git a/omnibus/workup_build/test/integration/default/workup_spec.rb b/omnibus/workup_build/test/integration/default/workup_spec.rb index 289c9dc..b9c6f88 100644 --- a/omnibus/workup_build/test/integration/default/workup_spec.rb +++ b/omnibus/workup_build/test/integration/default/workup_spec.rb @@ -1,14 +1,25 @@ # frozen_string_literal: true -describe file('/usr/local/bin/workup') do - it { should exist } + +def env(cmd, **options) + (options.map do |k, v| + os.family == 'windows' ? "$env:#{k} = '#{v}';" : "#{k}='#{v}'" + end + [*cmd]).join(' ') end -# Waiting on login shell support -describe command('workup') do +workup_bins = os.family == 'windows' ? 'C:/workup/bin' : '/usr/local/bin' +workup_bin = File.join(workup_bins, 'workup') + +describe file(workup_bin) do it { should exist } end -describe command('PASSWORD=vagrant /usr/local/bin/workup') do +# Waiting on login shell support +# describe command('workup') do +# it { should exist } +# end + +describe command(env(workup_bin, PASSWORD: 'vagrant')) do its('exit_status') { should eq 0 } its('stdout') { should match 'Chef Client finished, 0/0 resources updated' } + its('stderr') { should be_empty } end diff --git a/workup.gemspec b/workup.gemspec index a324aac..8467fb3 100644 --- a/workup.gemspec +++ b/workup.gemspec @@ -16,8 +16,7 @@ Gem::Specification.new do |spec| and minimal assumptions about the initial state of the machine.' spec.homepage = 'https://github.com/cvent/workup' - spec.files = Dir.glob('{lib,files,exe}/**', File::FNM_DOTMATCH) - .reject { |f| File.directory?(f) } + spec.files = Dir.glob('{lib,files,exe}/**/*', File::FNM_DOTMATCH) spec.bindir = 'exe' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib']