-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpr_ci_run.sh
executable file
·49 lines (41 loc) · 1.6 KB
/
pr_ci_run.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
#!/usr/bin/env bash
## This script is used to locally run a job that gets run when a PR is issued
# Script Usage: source pr_ci_run.sh branch_name job_name > logfile_name.log
# Where branch_name is the branch that will be used for the PR. and job_name is one of the
# arm-## jobs.
# After the log is done, use pr_ci_log_cleanup.sh on the file to clean up escape characters.
echo Now running NuttX pull request CI testing.
# ## Search for Errors and Warnings
# function find_messages {
# local tmp_file=/tmp/release-tmp.log
# local msg_file=/tmp/release-msg.log
# local pattern='^(.*):(\d+):(\d+):\s+(warning|fatal error|error):\s+(.*)$'
# grep '^\*\*\*\*\*' $log_file \
# > $msg_file
# grep -P "$pattern" $log_file \
# | uniq \
# >> $msg_file
# cat $msg_file $log_file >$tmp_file
# mv $tmp_file $log_file
# }
branch=$1
job=$2
## Download the Docker Image for NuttX
sudo docker pull \
ghcr.io/apache/nuttx/apache-nuttx-ci-linux:latest
## Inside the Docker Container:
## Build the Target Group
sudo docker run -it \
ghcr.io/apache/nuttx/apache-nuttx-ci-linux:latest \
/bin/bash -c "
cd ;
pwd ;
git clone https://github.com/stbenn/nuttx --branch $branch ;
git clone https://github.com/apache/nuttx-apps apps ;
pushd nuttx ; echo NuttX Source: https://github.com/apache/nuttx/tree/\$(git rev-parse HEAD) ; popd ;
pushd apps ; echo NuttX Apps: https://github.com/apache/nuttx-apps/tree/\$(git rev-parse HEAD) ; popd ;
cd nuttx/tools/ci ;
(./cibuild.sh -c -A -N -R testlist/$job.dat || echo '***** BUILD FAILED') ;
"
## Free up the Docker disk space
sudo docker system prune --force