mirror of https://github.com/1okko/openpilot.git
tici jenkins build (#19505)
* tici jenkins * /usr/bin/bash * source all * fix model replay * onroad tests
This commit is contained in:
parent
1ed77847fe
commit
8b1e51bbdd
|
@ -1,25 +1,37 @@
|
|||
def phone(String ip, String step_label, String cmd) {
|
||||
def ci_env = "CI=1 TEST_DIR=${env.TEST_DIR} GIT_BRANCH=${env.GIT_BRANCH} GIT_COMMIT=${env.GIT_COMMIT}"
|
||||
|
||||
withCredentials([file(credentialsId: 'id_rsa_public', variable: 'key_file')]) {
|
||||
sh label: step_label,
|
||||
script: """
|
||||
ssh -tt -o StrictHostKeyChecking=no -i ${key_file} -p 8022 root@${ip} '${ci_env} /usr/bin/bash -le' <<'EOF'
|
||||
echo \$\$ > /dev/cpuset/app/tasks || true
|
||||
echo \$PPID > /dev/cpuset/app/tasks || true
|
||||
mkdir -p /dev/shm
|
||||
chmod 777 /dev/shm
|
||||
def ssh_cmd = """
|
||||
ssh -tt -o StrictHostKeyChecking=no -i ${key_file} -p 8022 'comma@${ip}' /usr/bin/bash <<'EOF'
|
||||
|
||||
set -e
|
||||
|
||||
export CI=1
|
||||
export TEST_DIR=${env.TEST_DIR}
|
||||
export GIT_BRANCH=${env.GIT_BRANCH}
|
||||
export GIT_COMMIT=${env.GIT_COMMIT}
|
||||
|
||||
source ~/.bash_profile
|
||||
|
||||
if [ -f /EON ]; then
|
||||
echo \$\$ > /dev/cpuset/app/tasks || true
|
||||
echo \$PPID > /dev/cpuset/app/tasks || true
|
||||
mkdir -p /dev/shm
|
||||
chmod 777 /dev/shm
|
||||
fi
|
||||
|
||||
cd ${env.TEST_DIR} || true
|
||||
${cmd}
|
||||
exit 0
|
||||
|
||||
EOF"""
|
||||
|
||||
sh script: ssh_cmd, label: step_label
|
||||
}
|
||||
}
|
||||
|
||||
def phone_steps(String device_type, steps) {
|
||||
lock(resource: "", label: device_type, inversePrecedence: true, variable: 'device_ip', quantity: 1) {
|
||||
timeout(time: 60, unit: 'MINUTES') {
|
||||
phone(device_ip, "kill old processes", "pkill -f comma || true")
|
||||
phone(device_ip, "git checkout", readFile("selfdrive/test/setup_device_ci.sh"),)
|
||||
steps.each { item ->
|
||||
phone(device_ip, item[0], item[1])
|
||||
|
@ -40,7 +52,7 @@ pipeline {
|
|||
|
||||
stages {
|
||||
|
||||
stage('Release Build') {
|
||||
stage('Build release2') {
|
||||
agent {
|
||||
docker {
|
||||
image 'python:3.7.3'
|
||||
|
@ -104,7 +116,6 @@ pipeline {
|
|||
stages {
|
||||
stage('parallel tests') {
|
||||
parallel {
|
||||
|
||||
stage('Devel Build') {
|
||||
environment {
|
||||
CI_PUSH = "${env.BRANCH_NAME == 'master' ? 'master-ci' : ' '}"
|
||||
|
@ -145,6 +156,14 @@ pipeline {
|
|||
}
|
||||
}
|
||||
|
||||
stage('Tici Build') {
|
||||
steps {
|
||||
phone_steps("tici", [
|
||||
["build", "SCONS_CACHE=1 scons -j16"],
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -161,3 +180,4 @@ pipeline {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
4d71a89ccbfd351cbe58fcf217ee2eefa48eee2d
|
||||
1ed77847fe3f53b14595bab8f1f47134fee03c9b
|
|
@ -8,11 +8,14 @@ if [ -z "$GIT_COMMIT" ]; then
|
|||
fi
|
||||
|
||||
if [ -z "$TEST_DIR" ]; then
|
||||
|
||||
echo "TEST_DIR must be set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$SOURCE_DIR" ]; then
|
||||
git clone https://github.com/commaai/openpilot.git "$SOURCE_DIR"
|
||||
fi
|
||||
|
||||
# clear scons cache dirs that haven't been written to in one day
|
||||
#cd /tmp && find -name 'scons_cache_*' -type d -maxdepth 1 -mtime +1 -exec rm -rf '{}' \;
|
||||
|
||||
|
@ -22,12 +25,12 @@ rm -rf /data/core
|
|||
# set up environment
|
||||
cd $SOURCE_DIR
|
||||
git reset --hard
|
||||
git fetch origin
|
||||
git fetch
|
||||
find . -maxdepth 1 -not -path './.git' -not -name '.' -not -name '..' -exec rm -rf '{}' \;
|
||||
git reset --hard $GIT_COMMIT
|
||||
git checkout $GIT_COMMIT
|
||||
git clean -xdf
|
||||
git submodule update --init
|
||||
git submodule update --init --recursive
|
||||
git submodule foreach --recursive git reset --hard
|
||||
git submodule foreach --recursive git clean -xdf
|
||||
echo "git checkout took $SECONDS seconds"
|
||||
|
|
Loading…
Reference in New Issue