Last active
September 30, 2015 15:58
-
-
Save Iristyle/62656792dcb6e7957ef8 to your computer and use it in GitHub Desktop.
When using puppet_for_the_win, call this instead of setup_env.bat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd C:\source\puppetwinbuilder | |
| .\setup_env.ps1 | |
| $Env:ARCH = 'x64' | |
| cd c:\source\puppet_for_the_win | |
| bundle exec rake clobber | |
| bundle exec rake windows:build config=foss-3.7-x64.yaml | |
| # execute installer | |
| C:\source\puppet_for_the_win>msiexec /i src\puppet_for_the_win\pkg\puppet.msi PUPPET_AGENT_ACCOUNT_DOMAIN=vagrant-2008R2 PUPPET_AGENT_ACOUNT_USER=vagrant PUPPET_AGENT_ACCOUNT_PASSWORD=vagrant /l*v install.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-Batchfile ($file) | |
| { | |
| $cmd = "`"$file`" & set" | |
| cmd /c $cmd | % { | |
| $p, $v = $_.split('=') | |
| Set-Item -path env:$p -value $v | |
| } | |
| } | |
| function SetupEnv | |
| { | |
| $name = "setup_env" | |
| $readVersion = Get-Variable -Scope Global -Name $name ` | |
| -ErrorAction SilentlyContinue | |
| #continually jamming stuff into PATH is *not* cool ;0 | |
| if ($readVersion) { return } | |
| Write-Host "Reading env vars..." | |
| Get-Batchfile '.\setup_env.bat' | |
| Set-Variable -Scope Global -Name $name -Value $true | |
| } | |
| function Get-CurrentDirectory | |
| { | |
| $thisName = $MyInvocation.MyCommand.Name | |
| [IO.Path]::GetDirectoryName((Get-Content function:$thisName).File) | |
| } | |
| Set-Location (Get-CurrentDirectory) | |
| SetupEnv |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This assumes that:
c:\source\puppetwinbuilder(this includes a portable copy of Ruby, Wix 3.5 and Rake)setup_env.ps1intoc:\source\puppetwinbuilderand have run it to pull the build toolchain into yourPATHc:\source\puppet_for_the_winbundle install --path .bundle/gemsinside of thec:\source\puppet_for_the_windirectory to pull down gems necessary for the rake tasksbundle exec rake windows:build, replaceconfig=with the config you wish to usearchive/path, like for Facter - https://github.com/puppetlabs/puppet_for_the_win/blob/master/foss-4.1-x64.yaml#L6-L8