forked from deepfence/ThreatMapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·42 lines (35 loc) · 1.2 KB
/
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
#!/bin/bash
IMAGE_REPOSITORY=${IMAGE_REPOSITORY:-deepfenceio}
building_image(){
echo "Building Scope"
cd tools/apache/scope
make realclean && make scope.tar
build_result=$?
if [ $build_result -ne 0 ]
then
echo "Scope build failed, bailing out"
exit 1
fi
docker tag weaveworks/scope $IMAGE_REPOSITORY/deepfence_discovery_ce:${DF_IMG_TAG:-latest}
cd -
docker build --network host --rm=true --tag=$IMAGE_REPOSITORY/deepfence_agent_build_ce:${DF_IMG_TAG:-latest} -f build/Dockerfile .
build_result=$?
if [ $build_result -ne 0 ]
then
echo "Deepfence build image building failed, bailing out"
exit 1
fi
docker run --rm -it -v $(pwd):/go/src/github.com/deepfence/deepfence_agent:rw --net=host $IMAGE_REPOSITORY/deepfence_agent_build_ce:${DF_IMG_TAG:-latest} bash -x /home/deepfence/gocode-build.sh
build_result=$?
if [ $build_result -ne 0 ]
then
echo "Deepfence code compilation failed, bailing out"
exit 1
fi
echo "Building Agent"
docker build --network host --rm=true --tag=$IMAGE_REPOSITORY/deepfence_agent_ce:${DF_IMG_TAG:-latest} -f Dockerfile .
}
main () {
building_image "$@"
}
main "$@"