Skip to content
Snippets Groups Projects
Commit 01b07b00 authored by Lorenzo Pagliai's avatar Lorenzo Pagliai
Browse files

[BUILD SETUP] Insert runtime change on SRCBRANCH for BSP recipes

* This is necessary because the SRCBRANCH of the BSP repositories is
forced to be the master in recipe and this would create conflicts
with the SRCREV
* Remove the SSH related config commands since using https with token
* Restiling of the build commands that are moved to two separated bash scripts
parent dea28bc7
No related branches found
No related tags found
No related merge requests found
......@@ -186,17 +186,6 @@ retrigger:
# init repository and generate configuration files for bitbake
# checkout
- BASEDIR=$PWD
- mkdir -p /home/secous/.ssh
- echo "$SSH_KNOWN_HOSTS" > /home/secous/.ssh/known_hosts
- echo "$SSH_CONFIG_FILE" > /home/secous/.ssh/config
- echo "$SSH_PRIVATE_KEY" > /home/secous/.ssh/id_rsa
- chown 1002:1002 /home/secous/.ssh/known_hosts
- chown 1002:1002 /home/secous/.ssh/config
- chown 1002:1002 /home/secous/.ssh/id_rsa
- chmod 600 /home/secous/.ssh/id_rsa
- ls -l /home/secous/.ssh/
- eval $(ssh-agent -s)
- ssh-add /home/secous/.ssh/id_rsa
- export EULA=1
- BUILD_BRANCH=${MASTER_BRANCH}
- |
......@@ -210,36 +199,13 @@ retrigger:
echo "This is the image name will be assigned to software artifacts: ${IMAGE_NAME}"
- |
su secous -c "
git config --global url.https://github.com/.insteadOf git://github.com/
git config --global url.https://gitlab-ci-token:${GITBOT_TOKEN}@git.seco.com/.insteadOf https://git.seco.com/
repo init -u ${CI_REPOSITORY_URL} -b ${BUILD_BRANCH};
repo sync -j$(nproc) --fetch-submodules;
sh scripts/build_setup.sh $GITBOT_TOKEN $CI_REPOSITORY_URL $BUILD_BRANCH $DEFCONFIG_FILE $RECIPE_NAME
. ./seco-setup.sh -d ${DEFCONFIG_FILE};
. ./seco-setup.sh -c;
sed -i -e '/DL_DIR ?=/d' conf/local.conf;
echo 'DL_DIR = \"/var/cache/edgehog_downloads\"' >> conf/local.conf;
if [[ $PROCESSOR == *imx6* ]];
then echo 'SSTATE_DIR = \"/var/cache/edgehog_sstate-imx6\"' >> conf/local.conf;
elif [[ $PROCESSOR == *imx8* ]];
then echo 'SSTATE_DIR = \"/var/cache/edgehog_sstate-imx8\"' >> conf/local.conf;
elif [[ $PROCESSOR == *rk* ]];
then echo 'SSTATE_DIR = \"/var/cache/edgehog_sstate-rk\"' >> conf/local.conf;
elif [[ $PROCESSOR == *intel* ]];
then echo 'SSTATE_DIR = \"/var/cache/edgehog_sstate-intel\"' >> conf/local.conf;
fi
echo '###############################'
echo '#### Displaying local.conf ####'
echo '###############################'
cat conf/local.conf
sh scripts/yocto_cache_setup.sh $PROCESSOR
time bitbake ${RECIPE_NAME};
if [[ "$CI_JOB_NAME" != *"embedded"* ]]; then time bitbake seco-bundle-edgehog; fi;
"
- ls -la
- pwd
- echo "$BUILD_DIRECTORY/$IMAGES_PATH/$MACHINE"
- ls -la "$BUILD_DIRECTORY"
- ls -la "$BUILD_DIRECTORY/$IMAGES_PATH/"
- ls -la "$BUILD_DIRECTORY/$IMAGES_PATH/$MACHINE"
- echo "$BUILD_DIRECTORY/$IMAGES_PATH/$MACHINE" > $BASEDIR/pathname.txt
after_script:
......
#!/bin/bash
GITBOT_TOKEN=$1
CI_REPOSITORY_URL=$2
BUILD_BRANCH=$3
DEFCONFIG_FILE=$4
RECIPE_NAME=$5
git config --global url.https://github.com/.insteadOf git://github.com/
git config --global url.https://gitlab-ci-token:${GITBOT_TOKEN}@git.seco.com/.insteadOf https://git.seco.com/
repo init -u ${CI_REPOSITORY_URL} -b ${BUILD_BRANCH}
repo sync -j$(nproc) --fetch-submodules --no-clone-bundle
RECIPES="u-boot-seco-rk linux-seco-rk u-boot-seco-imx linux-seco-imx imx-mkimage"
for str in $RECIPES; do
if echo "$BUILD_BRANCH" | grep -q "$str"; then
filename=$(find layers/meta-seco-imx layers/meta-seco-rk -name "*$str*" -type f -exec grep -l "SRCBRANCH = " {} \;)
echo $filename
RECIPE_BRANCH=$(echo "$BUILD_BRANCH" | sed "s|.*$str/||"i | sed 's/\/into.*//')
sed -i "s/\(SRCBRANCH = \).*/\1\"$(echo "$RECIPE_BRANCH" | sed 's/[\/&]/\\&/g')\"/" $filename
cat $filename
fi
done
\ No newline at end of file
#!/bin/bash
PROCESSOR=$1
sed -i -e '/DL_DIR ?=/d' conf/local.conf;
echo 'DL_DIR = \"/var/cache/edgehog_downloads\"' >> conf/local.conf;
if [[ $PROCESSOR == *imx6* ]];
then echo 'SSTATE_DIR = \"/var/cache/edgehog_sstate-imx6\"' >> conf/local.conf;
elif [[ $PROCESSOR == *imx8* ]];
then echo 'SSTATE_DIR = \"/var/cache/edgehog_sstate-imx8\"' >> conf/local.conf;
elif [[ $PROCESSOR == *rk* ]];
then echo 'SSTATE_DIR = \"/var/cache/edgehog_sstate-rk\"' >> conf/local.conf;
elif [[ $PROCESSOR == *intel* ]];
then echo 'SSTATE_DIR = \"/var/cache/edgehog_sstate-intel\"' >> conf/local.conf;
fi
echo '###############################'
echo '#### Displaying local.conf ####'
echo '###############################'
cat conf/local.conf
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment