Update dev setup with small improvements

- ripgrep (rg) and rsync can both be invoked from some
stx/docs tox targets and utilities.

 - override the default editor (nano) with vi.
In the future this will be driven by a yaml variable

- pass in --rebuild when stx-init-env is run.  The build
containers are not always up to date with the latest code.
 --rebuild does not seem to work until after the env has
been initialized at least once.

Story: 2010547
Task: 47211
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I1e3b17d57fd537432bc3780759c8a47a2e3b2a5b
This commit is contained in:
Al Bailey 2023-02-28 18:29:46 +00:00
parent 5271eca7ed
commit 253a7f1cd6
1 changed files with 11 additions and 5 deletions

View File

@ -79,10 +79,12 @@ $package_setup = <<PACKAGE_SETUP
# libxslt1-dev (config)
# ostree (update)
# python3-all-dev (config)
# ripgrep (docs)
# rsync (docs)
# ruby-dev (stx-puppet)
# ruby-rubygems (stx-puppet)
# tox (all)
apt-get install -y bc libffi-dev libldap2-dev libsasl2-dev libxml2-dev libxslt1-dev ostree python3-all-dev ruby-rubygems ruby-dev tox
apt-get install -y bc libffi-dev libldap2-dev libsasl2-dev libxml2-dev libxslt1-dev ostree python3-all-dev ripgrep rsync ruby-rubygems ruby-dev tox
# pip install some additional components that are helpful for development
pip3 install bindep
@ -164,6 +166,8 @@ $user_setup = <<-'USER_SETUP'
su - ${DEV_USER} -c "mkdir -p ${PATCHES_DIR}"
echo "export PATCHES_DIR=${PATCHES_DIR}" >> ${PROFILE}
# override default editor (nano)
echo "export EDITOR=vi" >> ${PROFILE}
# STX_BUILD_HOME is the same as the project workspace
MY_WORKSPACE="${MY_LOCALDISK}/WORKSPACE/${PROJECT}"
@ -223,9 +227,9 @@ $repo_setup = <<-'REPO_SETUP'
su - ${DEV_USER} -c "cd ${MY_REPO_ROOT_DIR};
repo sync -j $(nproc --all)"
# Step 3) stx-init-env
# Step 3) stx-init-env --rebuild
date
echo "stx-init-env. This can take some time (approximately 6 min)"
echo "stx-init-env --rebuild. This can take some time (approximately 10 min)"
# initialize minikube env
su - ${DEV_USER} -c "cd ${STX_TOOLS};
source import-stx;
@ -236,6 +240,8 @@ $repo_setup = <<-'REPO_SETUP'
stx config --add project.gitemail ${USER_EMAIL};
# stx-init-env spams stdout, so we will redirect that command to a log
./stx-init-env > ${MY_WORKSPACE}/stx-init-env.log 2>&1 ;
# we need to initialize normally, before we can rebuild
./stx-init-env --rebuild > ${MY_WORKSPACE}/stx-init-env.log 2>&1 ;
# Display the last new lines of the log
tail ${MY_WORKSPACE}/stx-init-env.log;
@ -243,7 +249,7 @@ $repo_setup = <<-'REPO_SETUP'
# status should indicate success rather than 'ContainerCreating'
stx control status"
# Step 3) Support minikube auto-start on reboot for this user
# Step 4) Support minikube auto-start on reboot for this user
date
# override contents of /usr/lib/systemd/system/minikube.service
MINIKUBE_SERVICE="/usr/lib/systemd/system/minikube.service"
@ -271,7 +277,7 @@ WantedBy=multi-user.target
systemctl enable minikube
systemctl start minikube
# Step 4) Run the downloader
# Step 5) Run the downloader
date
echo "Waiting 60 seconds before running the downloader to ensure all containers are running"
sleep 60