forked from Azure/azure-linux-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackaging.sh
executable file
·49 lines (41 loc) · 1.1 KB
/
packaging.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
set -e
source omsagent.version
usage()
{
local basename=`basename $0`
echo
echo "$basename <PATH_TO_OMSAGENT_SHELL_BUNDLE>"
}
bundle_path=$1
output_path=$2
PACKAGE_NAME="oms$OMS_EXTENSION_VERSION.zip"
if [[ "$1" == "--help" ]]; then
usage
exit 0
elif [[ ! -f $bundle_path ]]; then
echo "OMS bundle '$bundle_path' not found"
exit 1
fi
if [[ "$output_path" == "" ]]; then
output_path="../"
fi
# Packaging starts here
cp -r ../Utils .
cp ../Common/WALinuxAgent-2.0.16/waagent .
# cleanup packages
rm -rf packages
mkdir -p packages
# copy shell bundle to packages/
cp $bundle_path packages/
# sync the file copy
sync
if [[ -f $output_path/$PACKAGE_NAME ]]; then
echo "Removing existing $PACKAGE_NAME ..."
rm -f $output_path/$PACKAGE_NAME
fi
echo "Packaging extension $PACKAGE_NAME to $output_path"
excluded_files="omsagent.version packaging.sh apply_version.sh update_version.sh"
zip -r $output_path/$PACKAGE_NAME * -x $excluded_files "./Fairfax/*" "./Mooncake/*" "./test/*" "./extension-test/*" "./references"
# cleanup newly added dir or files
rm -rf Utils/ waagent