Cleanup provider launch scripts and fix some windows build oddities
The windows build was still on the old plan from way back when where we had binaries littered in the build tree and you had to add parts of your build-tree to the `%PATH%` for the integration tests to work. This cleans that up and moves all of our scripts that invoke javascript to be on the same plan. They invoke our specially named node with a relative path to the JS code we want to run.
This commit is contained in:
parent
b8f3bb24aa
commit
2d0ca1992e
|
@ -30,7 +30,9 @@ install:
|
|||
|
||||
set PATH=%PATH%;%GOPATH%\bin
|
||||
|
||||
set PATH=%USERPROFILE%\go\src\github.com\pulumi\pulumi\sdk\nodejs\bin;%PATH%
|
||||
set PulumiRoot=C:\Pulumi
|
||||
|
||||
set PATH=%PulumiRoot%\bin;%PATH%
|
||||
|
||||
go version
|
||||
|
||||
|
|
15
build.proj
15
build.proj
|
@ -9,6 +9,8 @@
|
|||
<NodeArch>x64</NodeArch>
|
||||
<TestParallelism>10</TestParallelism>
|
||||
<MSVSVersion>2017</MSVSVersion>
|
||||
<PulumiRoot Condition="'$(PulumiRoot)' == ''">C:\Pulumi\</PulumiRoot>
|
||||
<PulumiBin>$(PulumiRoot)\bin</PulumiBin>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="EnsureGoDependencies">
|
||||
|
@ -50,7 +52,8 @@
|
|||
<Output TaskParameter="ConsoleOutput" PropertyName="Version" />
|
||||
</Exec>
|
||||
|
||||
<Exec Command="go install -ldflags "-X main.version=$(Version)" %(GoPackagesToBuild.Identity)" />
|
||||
<Exec Command="go install -ldflags "-X github.com/pulumi/pulumi/pkg/version.Version=$(Version)" %(GoPackagesToBuild.Identity)"
|
||||
EnvironmentVariables="GOBIN=$(PulumiBin)"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="BinplaceNodeSdkProtos">
|
||||
|
@ -80,9 +83,12 @@
|
|||
|
||||
<Target Name="BinPlaceNodeSdk"
|
||||
DependsOnTargets="BinPlaceNodeSdkProtos;BinPlaceNodeSdkTestData;YarnLinkSdk">
|
||||
<Copy SourceFiles="$(NodeJSSdkDirectory)\custom_node\node\node.exe" DestinationFiles="$(PulumiBin)\pulumi-langhost-nodejs-node.exe" />
|
||||
<Copy SourceFiles="$(NodeJSSdkDirectory)\pulumi-langhost-nodejs-exec.cmd" DestinationFolder="$(PulumiBin)" />
|
||||
<Copy SourceFiles="$(NodeJSSdkDirectory)\pulumi-provider-pulumi-nodejs.cmd" DestinationFolder="$(PulumiBin)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildNodeSdk"
|
||||
<Target Name="BuildNodeSdk"
|
||||
DependsOnTargets="CopyNodeSdkProtos;TypeScriptCompileNodeSdk;GoCompileNodeSdk;BinPlaceNodeSdk">
|
||||
</Target>
|
||||
|
||||
|
@ -95,7 +101,8 @@
|
|||
<Output TaskParameter="ConsoleOutput" PropertyName="Version" />
|
||||
</Exec>
|
||||
|
||||
<Exec Command="go install -ldflags "-X main.version=$(Version)" %(GoCmdsToBuild.Identity)" />
|
||||
<Exec Command="go install -ldflags "-X github.com/pulumi/pulumi/pkg/version.Version=$(Version)" %(GoCmdsToBuild.Identity)"
|
||||
EnvironmentVariables="GOBIN=$(PulumiBin)"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="Build"
|
||||
|
@ -113,7 +120,7 @@
|
|||
<Output TaskParameter="ExitCode" PropertyName="WhereLangHostExitCode" />
|
||||
</Exec>
|
||||
|
||||
<Error Text="Please add "$(NodeJSSdkDirectory)\bin" to your path before running integration tests."
|
||||
<Error Text="Please add "$(PulumiRoot)\bin" to your path before running integration tests."
|
||||
Condition="$(WhereLangHostExitCode) != 0 Or $(WhereLangHostExecExitCode) != 0"/>
|
||||
|
||||
<!-- Ignore the exit code (but retain it) so we can kill all the lingering node processes even when go test
|
||||
|
|
1
dist/sdk/nodejs/.gitattributes
vendored
1
dist/sdk/nodejs/.gitattributes
vendored
|
@ -1 +0,0 @@
|
|||
*.cmd text eol=crlf
|
|
@ -1 +0,0 @@
|
|||
@"%~dp0\node\node.exe" -e "require(\"pulumi/cmd/run\")" dummy_argument %*
|
|
@ -31,12 +31,10 @@ RunGoBuild "github.com/pulumi/pulumi"
|
|||
RunGoBuild "github.com/pulumi/pulumi/sdk/nodejs/cmd/pulumi-langhost-nodejs"
|
||||
CopyPackage "$Root\sdk\nodejs\bin" "pulumi"
|
||||
|
||||
Copy-Item "$Root\dist\sdk\nodejs\pulumi-langhost-nodejs-exec.cmd" "$PublishDir\bin"
|
||||
Copy-Item "$Root\sdk\nodejs\pulumi-langhost-nodejs-exec.cmd" "$PublishDir\bin"
|
||||
Copy-Item "$Root\sdk\nodejs\pulumi-provider-pulumi-nodejs.cmd" "$PublishDir\bin"
|
||||
Copy-Item "$Root\sdk\nodejs\custom_node\node\node.exe" "$PublishDir\bin\pulumi-langhost-nodejs-node.exe"
|
||||
|
||||
Remove-Item "$PublishDir\node_modules\pulumi\pulumi-langhost-nodejs-exec.cmd"
|
||||
Remove-Item "$PublishDir\node_modules\pulumi\pulumi-provider-pulumi-nodejs.cmd"
|
||||
|
||||
# By default, if the archive already exists, 7zip will just add files to it, so blow away the existing
|
||||
# archive if it exists.
|
||||
if (Test-Path $PublishFile) {
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
@echo off
|
||||
REM We depend on a custom node build that has exposed some internal state
|
||||
REM This node is downloaded and extracted via the EnsureCustomNode target
|
||||
REM in the root build.proj
|
||||
"%~dp0..\custom_node\node\node.exe" "./node_modules/@pulumi/pulumi/cmd/run" %*
|
|
@ -1,7 +0,0 @@
|
|||
@echo off
|
||||
SET REQUIRE_ROOT=%~dp0
|
||||
SET REQUIRE_ROOT=%REQUIRE_ROOT:\=/%
|
||||
REM We depend on a custom node build that has exposed some internal state
|
||||
REM This node is downloaded and extracted via the EnsureCustomNode target
|
||||
REM in the root build.proj
|
||||
"%~dp0..\custom_node\node\node.exe" "%REQUIRE_ROOT%./cmd/dynamic-provider" %*
|
1
sdk/nodejs/pulumi-langhost-nodejs-exec.cmd
Normal file
1
sdk/nodejs/pulumi-langhost-nodejs-exec.cmd
Normal file
|
@ -0,0 +1 @@
|
|||
@pulumi-langhost-nodejs-node.exe ./node_modules/@pulumi/pulumi/cmd/run %*
|
|
@ -1,3 +1,2 @@
|
|||
#!/bin/sh
|
||||
SDK_DIR=`dirname $0`/../node_modules
|
||||
pulumi-langhost-nodejs-node "$SDK_DIR/@pulumi/pulumi/cmd/dynamic-provider" $@
|
||||
pulumi-langhost-nodejs-node ./node_modules/@pulumi/pulumi/cmd/dynamic-provider $@
|
||||
|
|
1
sdk/nodejs/pulumi-provider-pulumi-nodejs.cmd
Normal file
1
sdk/nodejs/pulumi-provider-pulumi-nodejs.cmd
Normal file
|
@ -0,0 +1 @@
|
|||
@pulumi-langhost-nodejs-node.exe ./node_modules/@pulumi/pulumi/cmd/dynamic-provider %*
|
Loading…
Reference in a new issue