Skip to content

Commit c2ceb25

Browse files
committed
Add scripts that will be run by the CI test jobs
These scripts are triggered by their respective test infra jobs, namely prow-info-docker.sh by periodic-config-docker, prow-build-dev-image.sh by periodic-build-dev-image-docker, prow-unit-test-docker.sh by postsubmit-unit-test-docker and prow-integration-tests.sh by postsubmit-integration-test-docker
1 parent 3073c3d commit c2ceb25

File tree

7 files changed

+56
-11
lines changed

7 files changed

+56
-11
lines changed

setup-pj-trigger.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
4+
TRACKING_REPO=${REPO_OWNER}/${REPO_NAME}
5+
while getopts ":r:s:" option; do
6+
case "${option}" in
7+
r)
8+
TRACKING_REPO=${OPTARG}
9+
;;
10+
s)
11+
SRC_FILE=${OPTARG}
12+
;;
13+
esac
14+
done
15+
shift $((OPTIND-1))
16+
17+
TRACKING_BRANCH=prow-job-tracking
18+
FILE_TO_PUSH=job/${JOB_NAME}
19+
20+
echo "Triggering the next prow job by adding a git commit to the \
21+
${FILE_TO_PUSH} file on the ${TRACKING_BRANCH} branch of the \
22+
${TRACKING_REPO} repository."
23+
24+
./trigger-prow-job-from-git.sh -r ${TRACKING_REPO} \
25+
-b ${TRACKING_BRANCH} -s ${SRC_FILE} -d ${FILE_TO_PUSH}
26+
27+
if [ $? -ne 0 ]
28+
then
29+
echo "Failed to add the git commit to trigger the next job"
30+
exit 3
31+
fi

trigger-prow-job-from-git.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ set -eu
1212
display_usage() {
1313
echo "Usage: -r <TRACKING_REPO> -b <TRACKING_BRANCH> -s <SRC_FILE> -d <DEST_FILE>"
1414
echo "Example:"
15-
echo " trigger-prow-job-from-git.sh -r alunsin/docker-ce-build" \
15+
echo " trigger-prow-job-from-git.sh -r ppc64le-cloud/docker-ce-build" \
1616
"-b prow-job-tracking -s $PWD/env/date.list -d job/postsubmit-build-docker"
1717
exit 2
1818
}

upstream-master-ci/info.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ checkDirectory() {
99
echo "Could not create $1, exiting."
1010
mkdir $1
1111
if [[ $? -ne 0 ]]; then
12-
exit 1
12+
exit 2
1313
fi
1414
echo "$1 created"
1515
else
@@ -24,5 +24,6 @@ rm -f ${DIR_LOGS_COS}/info.log && touch ${DIR_LOGS_COS}/info.log
2424
docker version 2>&1 | tee -a "${DIR_LOGS_COS}/info.log"
2525
docker info 2>&1 | tee -a "${DIR_LOGS_COS}/info.log"
2626
curl -fsSL -o ${PWD}/check-config.sh "https://raw.githubusercontent.com/moby/moby/master/contrib/check-config.sh" 2>&1 | tee -a "${DIR_LOGS_COS}/info.log"
27+
set -o pipefail
2728
bash ${PWD}/check-config.sh 2>&1 | tee -a "${DIR_LOGS_COS}/info.log" || true
28-
exit 0
29+
exit $?

upstream-master-ci/prow-build-dev-image.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ echo "${PATH_CI}"
66
export PATH_CI
77

88
echo "Prow Job to run CI tests on the Docker packages"
9-
echo "Skip Build Dev image"
10-
exit 0
119
# Go to the workdir
1210
echo "* Starting dockerd and waiting for it *"
1311
${PWD}/dockerctl.sh start

upstream-master-ci/prow-info-docker.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ set -u
44
# Path to the scripts
55
PATH_CI="${PWD}/upstream-master-ci"
66
export PATH_CI
7+
DATE=`date +%d%m%y-%H%M`
8+
9+
REPO_OWNER="ppc64le-cloud"
10+
REPO_NAME="docker-ce-build"
11+
PATH_SCRIPTS="/home/prow/go/src/github.com/${REPO_OWNER}/${REPO_NAME}"
12+
echo DATE=\"${DATE}\" 2>&1 | tee ${PATH_SCRIPTS}/env/date.list
713

814
echo "Prow Job to run CI tests on the Docker packages"
915

@@ -13,5 +19,18 @@ ${PWD}/dockerctl.sh start
1319
echo "** Set up (env files) **"
1420
chmod ug+x ${PATH_CI}/get-env-ci.sh && ${PATH_CI}/get-env-ci.sh
1521

16-
echo "*** Check Config ***"
17-
chmod ug+x ${PATH_CI}/info.sh && ${PATH_CI}/info.sh
22+
echo "*** Check Kernel Config ***"
23+
chmod ug+x ${PATH_CI}/info.sh
24+
${PATH_CI}/info.sh
25+
26+
if [[ $? == 0 ]]; then
27+
chmod ug+x ./setup-pj-trigger.sh
28+
./setup-pj-trigger.sh -r ppc64le-cloud/docker-ce-build
29+
else
30+
if [[ $? == 1 ]]; then
31+
echo "Error checking the kernel configuration"
32+
else
33+
echo "Could not create a logging directory for storing the job logs"
34+
fi
35+
exit 1
36+
fi

upstream-master-ci/prow-integration-tests.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ set -u
44
begin=$SECONDS
55

66
echo "Prow Job to run integration tests on the Docker packages"
7-
echo "Skip integration tests"
8-
exit 0
97
${PWD}/dockerctl.sh start
108

119
set -o allexport

upstream-master-ci/prow-unit-test-docker.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ begin=$SECONDS
77
PATH_CI="${PWD}/upstream-master-ci"
88
export PATH_CI
99
echo "Prow Job to run CI tests on the Docker packages"
10-
echo "Skip unit tests"
11-
exit 0
1210
if [[ -z ${ARTIFACTS} ]]; then
1311
ARTIFACTS=/logs/artifacts
1412
echo "Setting ARTIFACTS to ${ARTIFACTS}"

0 commit comments

Comments
 (0)