mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
iop: add command: build_branch
This commit is contained in:
parent
7c84202d60
commit
7cf104cdd3
1 changed files with 53 additions and 0 deletions
53
iop/scripts/build_branch.sh
Executable file
53
iop/scripts/build_branch.sh
Executable file
|
|
@ -0,0 +1,53 @@
|
|||
#!/bin/sh
|
||||
# build_branch
|
||||
#./iop build_branch <branch> <board> [<customer>]
|
||||
|
||||
function build_branch_usage {
|
||||
echo "usage: $0 build_branch <branch> <board> [<customer>]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
function branch_exists {
|
||||
local branch=$1
|
||||
[ -z "$branch" ] && return 1
|
||||
git branch | grep -q $branch && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
function build_branch {
|
||||
local branch=$1
|
||||
local board=$2
|
||||
local customer=$3
|
||||
[ "$customer" == "INT" ] && customer=""
|
||||
|
||||
if ! branch_exists $branch ; then
|
||||
echo "Branch $branch not found"
|
||||
build_branch_usage
|
||||
fi
|
||||
|
||||
time {
|
||||
git fetch origin || build_branch_usage
|
||||
git fetch --all -p || build_branch_usage
|
||||
git checkout $branch || build_branch_usage
|
||||
git pull || exit 1
|
||||
./iop feeds_update || build_branch_usage
|
||||
./iop genconfig -c $board $customer || build_branch_usage
|
||||
make -j 8 || build_branch_usage
|
||||
}
|
||||
}
|
||||
|
||||
function build_branch_sysupgrade {
|
||||
local branch=$1 ; shift
|
||||
local board=$2 ; shift
|
||||
local customer=$3 ; shift
|
||||
local ip=$4 ; shift
|
||||
local opts=$*
|
||||
|
||||
time {
|
||||
./iop build_branch $branch $board $customer
|
||||
./iop ssh_sysupgrade_latest $ip $opts
|
||||
}
|
||||
}
|
||||
|
||||
register_command "build_branch" "<branch> <board> [<customer>] Build a <branch> for a <board> [with a <customer> profile]"
|
||||
register_command "build_branch_sysupgrade" "<branch> <board> <customer>|INT <ip> [<opts>] Build a <branch> for a <board> [with a <customer> profile] and sysupgrade [with <opts>] it on the router at <ip>"
|
||||
Loading…
Add table
Reference in a new issue