diff --git a/packaging/googet/google-compute-engine-windows.goospec b/packaging/googet/google-compute-engine-windows.goospec index 8d9e54d7..e1f36dcb 100644 --- a/packaging/googet/google-compute-engine-windows.goospec +++ b/packaging/googet/google-compute-engine-windows.goospec @@ -7,6 +7,7 @@ "description": "Google Compute Engine Windows agent", "source": "https://github.com/GoogleCloudPlatform/guest-agent/", "files": { + "GCEWindowsAgentManager.exe": "/Google/Compute Engine/agent/GCEWindowsAgentManager.exe", "GCEWindowsAgent.exe": "/Google/Compute Engine/agent/GCEWindowsAgent.exe", "GCEAuthorizedKeysCommand.exe": "/Google/Compute Engine/agent/GCEAuthorizedKeysCommand.exe", "THIRD_PARTY_LICENSES": "/Google/Compute Engine/THIRD_PARTY_LICENSES/", @@ -36,6 +37,7 @@ "sources": [{ "include": [ "GCEWindowsAgent.exe", + "GCEWindowsAgentManager.exe", "GCEAuthorizedKeysCommand.exe", "packaging/googet/agent_install.ps1", "packaging/googet/agent_uninstall.ps1", diff --git a/packaging/googet/windows_agent_build.sh b/packaging/googet/windows_agent_build.sh index a5e9520a..8130ac74 100755 --- a/packaging/googet/windows_agent_build.sh +++ b/packaging/googet/windows_agent_build.sh @@ -22,3 +22,22 @@ version=$1 GOOS=windows /tmp/go/bin/go build -ldflags "-X main.version=$version" -mod=readonly -o GCEWindowsAgent.exe ./google_guest_agent GOOS=windows /tmp/go/bin/go build -ldflags "-X main.version=$version" -mod=readonly -o GCEAuthorizedKeysCommand.exe ./google_authorized_keys + + +# Script expects guest-agent and google-guest-agent codebase are placed +# side-by-side within same directory and this script is executed from root of +# guest-agent codebase. +GUEST_AGENT_REPO="../google-guest-agent" + +if [[ ! -f "$GUEST_AGENT_REPO/Makefile" ]]; then + # This is a placeholder file for guest-agent package, google-compute-engine-windows.goospec + # looks for this file during goopack packaging and will fail if not found. + echo "This is a placeholder file so guest agent package build without error. Package will have actual Guest Agent Manager executable instead if both repos are cloned side-by-side." > GCEWindowsAgentManager.exe + exit 0 +fi + +BUILD_DIR=$(pwd) +pushd $GUEST_AGENT_REPO +GOOS=windows VERSION=$version make cmd/google_guest_agent/google_guest_agent +cp cmd/google_guest_agent/google_guest_agent.exe $BUILD_DIR/GCEWindowsAgentManager.exe +popd \ No newline at end of file