Skip to content

Commit

Permalink
Add missing packaging spec (#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaitanyaKulkarni28 authored Nov 12, 2024
1 parent 13c627c commit 6815d42
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packaging/googet/google-compute-engine-windows.goospec
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"description": "Google Compute Engine Windows agent",
"source": "https://github.com/GoogleCloudPlatform/guest-agent/",
"files": {
"GCEWindowsAgentManager.exe": "<ProgramFiles>/Google/Compute Engine/agent/GCEWindowsAgentManager.exe",
"GCEWindowsAgent.exe": "<ProgramFiles>/Google/Compute Engine/agent/GCEWindowsAgent.exe",
"GCEAuthorizedKeysCommand.exe": "<ProgramFiles>/Google/Compute Engine/agent/GCEAuthorizedKeysCommand.exe",
"THIRD_PARTY_LICENSES": "<ProgramFiles>/Google/Compute Engine/THIRD_PARTY_LICENSES/",
Expand Down Expand Up @@ -36,6 +37,7 @@
"sources": [{
"include": [
"GCEWindowsAgent.exe",
"GCEWindowsAgentManager.exe",
"GCEAuthorizedKeysCommand.exe",
"packaging/googet/agent_install.ps1",
"packaging/googet/agent_uninstall.ps1",
Expand Down
19 changes: 19 additions & 0 deletions packaging/googet/windows_agent_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6815d42

Please sign in to comment.