forked from GoogleCloudPlatform/google-cloud-dotnet-debugger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.sh
executable file
·49 lines (37 loc) · 1.57 KB
/
package.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# The script builds and packages the debugger and agent into a minimum set
# to be used alone.
set -e
SCRIPT=$(readlink -f "$0")
ROOT_DIR=$(dirname "$SCRIPT")
AGENT_DIR=$ROOT_DIR/src/Google.Cloud.Diagnostics.Debug
DEBUGGER_DIR=$ROOT_DIR/src/google_cloud_debugger
THIRD_PARTY_DIR=$ROOT_DIR/third_party
# Create
COMMIT_HASH=$(git rev-parse --short HEAD)
TEMP_DIR=package-"$COMMIT_HASH"
TEMP_AGENT_DIR=$TEMP_DIR/agent
TEMP_DEBUGGER_DIR=$TEMP_DIR/debugger
mkdir -p $TEMP_DIR
mkdir -p $TEMP_AGENT_DIR
mkdir -p $TEMP_DEBUGGER_DIR
# Rebuild everything from scratch.
$ROOT_DIR/build-deps.sh --release --rebuild-protobuf
$ROOT_DIR/build.sh --release --rebuild
# Run unit and integration tests.
$ROOT_DIR/run_unit_tests.sh --release
$ROOT_DIR/run_integration_tests.sh --release
# Publish the agent.
dotnet restore -r debian.8-x64 $AGENT_DIR
dotnet publish -c Release -f netcoreapp2.0 -r ubuntu.16.04-x64 $AGENT_DIR/Google.Cloud.Diagnostics.Debug/Google.Cloud.Diagnostics.Debug.csproj
cp -r $AGENT_DIR/Google.Cloud.Diagnostics.Debug/bin/Release/netcoreapp2.0/ubuntu.16.04-x64/publish/* $TEMP_AGENT_DIR
# Copy over the debugger.
cp $DEBUGGER_DIR/google_cloud_debugger/google_cloud_debugger $TEMP_DEBUGGER_DIR
# Copy the needed so files.
cp $THIRD_PARTY_DIR/protobuf/src/.libs/libprotobuf.so.13.0.2 $TEMP_DEBUGGER_DIR/libprotobuf.so.13
# TODO(talarico): Figure out which exactly which .so files we need.
cp $THIRD_PARTY_DIR/coreclr/bin/Product/Linux.x64.Release/*.so $TEMP_DEBUGGER_DIR
# Package everyting into a tar.
cd $TEMP_DIR
tar -czvf $TEMP_DIR.tar.gz *
mv $TEMP_DIR.tar.gz $ROOT_DIR