Open pquerna opened 8 years ago
@pquerna sorry about the Windows problems, and thanks for sharing that snippet! I'll try and find some time in the next few weeks getting this example working with Windows out of the box.
Here's an example workaround for insufficient GOPATH symlink following on Windows:
REM ==== Create temp GOPATH based on project contents
mkdir tmp\go\bin
mkdir tmp\go\src\github.com\xxx\yyy
robocopy . tmp\go\src\github.com\xxx\yyy *.go /s /njh /njs /ndl /nc /ns /np /xd tmp
robocopy . tmp\go\src\github.com\xxx\yyy *.s /s /njh /njs /ndl /nc /ns /np /xd tmp
set GOPATH=%cd%\tmp\go
You should see how its done here ! https://github.com/elastic/beats
Mage is used for cross platform scripting throughout. https://github.com/elastic/beats/blob/master/magefile.go
TO kick it off from windows a generic kicker is used: https://github.com/elastic/beats/blob/master/make.bat
TO kick it off for Linux 7 Darwin its just Makefile: https://github.com/elastic/beats/blob/master/Makefile
Mage is really awesome for Cross device CI things..
the default bootstrap.bat on windows doesn't seem to have the same level of hook support, but my
script/test.ps1
i made a terrible function to munge the GOPATH and symlinks in a similar manner to this repository:Note this requires PowerShell 5.0 (for
New-Item
with a SymbolicLink), and must be run under an Administrator account or a system where symlinks are allowed for other users.