forked from microsoft/Build-OMS-Agent-for-Linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipeline-build.sh
99 lines (91 loc) · 3.93 KB
/
pipeline-build.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
echo "***************************************************************************"
echo "***************************************************************************"
echo "***************************************************************************"
echo "Start of build step"
echo "***************************************************************************"
echo "***************************************************************************"
echo "***************************************************************************"
BUILD_OUTPUT_DIR="omsagent/target/"
pwd
PWD=`pwd`
pushd $PWD
# Find location of this script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "WHAT IS HERE?"
ls
# Change to the build folder
echo "Changing to omsagent folder"
cd $DIR/omsagent
echo "WHAT IS HERE?"
ls
echo "Changing to build folder"
cd build
echo "WHAT IS HERE?"
ls
echo "*************************** Run Unit Tests ********************************"
echo "***************************************************************************"
echo "***************************************************************************"
make distclean
./configure --enable-ulinux
echo "Make unittest_100"
make unittest_100
echo "******************************** Run Make *********************************"
echo "***************************************************************************"
echo "***************************************************************************"
echo "Configure"
make distclean
./configure --enable-ulinux
echo "***************************************************************************"
echo "***************************************************************************"
echo "***************************************************************************"
echo "Make"
make
# Save the exit code from react-scripts build
EX=$?
echo "***************************************************************************"
echo "***************************************************************************"
echo "***************************************************************************"
echo "WHAT IS HERE?"
ls
echo "***************************************************************************"
echo "***************************************************************************"
echo "***************************************************************************"
echo "Move back out to omsagent folder"
cd ..
echo "***************************************************************************"
echo "***************************************************************************"
echo "***************************************************************************"
echo "WHAT IS HERE?"
ls
echo "***************************************************************************"
echo "***************************************************************************"
echo "***************************************************************************"
echo "Move back out to root folder"
cd $DIR
echo "***************************************************************************"
echo "***************************************************************************"
echo "***************************************************************************"
echo "WHAT IS HERE?"
ls
echo "***************************************************************************"
echo "***************************************************************************"
echo "***************************************************************************"
echo "Check Make Exit Code"
# Check exit code and exit with it if it is non-zero so that build will fail
if [ "$EX" -ne "0" ]; then
popd
echo "Build Failed. Make exited with Exit Code $EX".
exit $EX
fi
echo "Check Exists: Build Output Folder $BUILD_OUTPUT_DIR"
if [ ! -d "$BUILD_OUTPUT_DIR" ]; then
popd
echo "Build failed. Missing expected output folder: $BUILD_OUTPUT_DIR."
exit 1
fi
echo Build success.
# Restore working directory
popd
# Exit with explicit 0 exit code so build will not fail
exit $EX