forked from ppc64le-cloud/docker-ce-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prow-build-test-containerd.sh
executable file
·84 lines (66 loc) · 1.89 KB
/
prow-build-test-containerd.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
#!/bin/bash
set -u
# Path to the scripts
SECONDS=0
PATH_SCRIPTS="/home/prow/go/src/github.com/${REPO_OWNER}/${REPO_NAME}"
if [[ -z ${ARTIFACTS} ]]
then
ARTIFACTS=/logs/artifacts
echo "Setting ARTIFACTS to ${ARTIFACTS}"
mkdir -p ${ARTIFACTS}
fi
export PATH_SCRIPTS
echo "Prow Job to build the containerd packages"
# Go to the workdir
cd /workspace
# Start the dockerd and wait for it to start
echo "* Starting dockerd and waiting for it *"
${PATH_SCRIPTS}/dockerctl.sh start
# Get the env file and the dockertest repo and the latest built of containerd if we don't want to build containerd
echo "** Set up (env files) **"
${PATH_SCRIPTS}/get-env.sh
${PATH_SCRIPTS}/get-env-containerd.sh
set -o allexport
source env.list
source date.list
export DATE
# Build containerd
echo "*** Build containerd packages ***"
${PATH_SCRIPTS}/build-containerd.sh
exit_code_build=$?
echo "Exit code build : ${exit_code_build}"
if [[ ${DOCKER_BUILD} == 0 ]]; then
echo "INFO: Skipping tests as docker packages have not been built."
exit 0
fi
# Test the packages
echo "*** * Tests * ***"
${PATH_SCRIPTS}/test.sh
# Check if there are errors in the tests : NOERR or ERR
echo "*** ** Tests check ** ***"
${PATH_SCRIPTS}/check-tests.sh
CHECK_TESTS_BOOL=$?
echo "Exit code check : ${CHECK_TESTS_BOOL}"
echo "The tests results : ${CHECK_TESTS_BOOL}"
export CHECK_TESTS_BOOL
duration=$SECONDS
echo "DURATION ALL : $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
#Stop the dockerd
echo "* Stopping dockerd *"
${PATH_SCRIPTS}/dockerctl.sh stop
if [[ ${CHECK_TESTS_BOOL} -eq 0 ]]
then
echo "NO ERROR"
else
echo "ERROR"
exit 1
fi
if [[ ${DISABLE_PUSH_COS} = "1" ]]
then
echo "Skip push to COS, DISABLE_PUSH_COS=${DISABLE_PUSH_COS}"
else
# Push to the COS Bucket according to CHECK_TESTS_BOOL
echo "*** *** Push to the COS Buckets *** ***"
${PATH_SCRIPTS}/push-COS.sh
exit $?
fi