asseco_vagrant/Vagrantfile
Bartosz Wieczorek 3c155608c3 init:
2024-06-10 15:53:59 +02:00

157 lines
5.3 KiB
Ruby

Vagrant.configure("2") do |config|
config.vm.box = "gusztavvargadr/ubuntu-desktop"
config.vm.provider :virtualbox do |v|
v.gui = true
v.customize [
"modifyvm", :id,
"--memory", "16384",
"--paravirtprovider", "kvm", # for linux guest
"--cpus", "12"
]
end
config.vm.synced_folder "./config", "/config", type: "virtualbox"
config.vm.synced_folder "./sysroot/home/vagrant", "/home/vagrant", type: "virtualbox"
config.vm.provision "preserve_home", type: "shell", inline: <<-SHELL
# copy original home directory to synced_folder
if [ -d "/home/vagrant" ]; then
mount --bind -o ro / /mnt
#### TODO remove old entries
cat /mnt/home/vagrant/.ssh/authorized_keys >> ~/.ssh/authorized_keys
umount /mnt
fi
if [ ! -d "/home/vagrant" ]; then
mount --bind -o ro / /mnt
cp -a /mnt/home/vagrant /home
umount /mnt
fi
SHELL
config.vm.provision "file", source: "#{Dir.home}/.ssh/id_rsa", destination: ".ssh/id_rsa"
config.vm.provision "file", source: "#{Dir.home}/.ssh/id_rsa.pub", destination: ".ssh/id_rsa.pub"
config.vm.provision "setup_system", type: "shell", inline: <<-SHELL
#remove unused packages
# safe to run multiple times
apt purge -y libreoffice-*
apt update -y
apt upgrade -y
apt install -y libtool m4 automake build-essential cmake clang-format git meld ninja-build
apt install -y curl ncompress libecpg-dev m4 libncurses5-dev libncursesw5-dev libboost-dev libcurl4-openssl-dev
apt install -y libxcb-cursor-dev rsync python3-pip sqlite3
# echo "user_allow_other" | sudo tee -a /etc/fuse.conf
# install sakctl
wget --no-check-certificate https://artifactory.dev-pus.asseco.pl/artifactory/ksi-tools-local/sakctl/stable/sakctl_1.6.6_linux_x86_64.tgz -O - | tar --directory /usr/bin -xzvf -
sakctl update
SHELL
# configure system paths
config.vm.provision "setup_env", privileged: false, type: "shell", inline: <<-SHELL
# install git keys
ssh-keyscan crkz.poland.asseco.corp >> ~/.ssh/known_hosts
ssh-keyscan clx-tux.pus.corp >> ~/.ssh/known_hosts
#### setup env
# main directory of dependencies
if [ -z ${KSIDIR+x} ]; then
export KSIDIR=/localksi
echo "export KSIDIR=/localksi" >> ~/.profile
# sakctl config
echo "export SYSTEM=linux_x86_64" >> ~/.profile
# sakctl and dev variables
echo "export INTEGRDIR=${KSIDIR}/integrdir" >> ~/.profile
echo "export SDKDIR=${KSIDIR}/sdkdir" >> ~/.profile
echo "export RTKDIR=${KSIDIR}/rtkdir" >> ~/.profile
echo "export TUXDIR=/usr/local" >> ~/.profile
echo "export LD_LIBRARY_PATH=/usr/local/lib:\$LD_LIBRARY_PATH" >> ~/.profile
fi
sudo mkdir -p ${KSIDIR}
sudo chown vagrant:vagrant ${KSIDIR}
SHELL
config.vm.provision "db2_system", privileged: false, type: "shell", inline: <<-SHELL
# db2 requirements install
###TODO set ulimit unlimited and nofile to 2^16
sudo dpkg --add-architecture i386
sudo apt-get -y update
sudo apt-get -y install ksh libaio1 libc6:i386 libncurses5:i386 libstdc++6:i386 libpam0g:i386 libxrender1 libxtst6 libxi6 libxft2 binutils
rsync -azv --compress-level=9 eessi01@clx-tux.pus.corp:/home/ksi/eessi01/e2_dev/v11.5.8_linuxx64 .
cd v11.5.8_linuxx64/server_dec/
sudo ./db2setup -r /config/db2server.rsp
cd ~
# rm v11.5.8_linuxx64 -Rf
SHELL
config.vm.provision "clean", privileged: false, type: "shell", inline: <<-SHELL
rm -rf $KSIDIR/*
SHELL
# get wsp and stuff
config.vm.provision "integr", privileged: false, type: "shell", inline: <<-SHELL
cd $KSIDIR
# install fuxedo
git clone git@crkz.poland.asseco.corp:pusr/dev/zrwsos/cpp/fuxedo.git
cd fuxedo
./autogen.sh
./configure --disable-code-sanitizer
make -j
sudo make install
cd ..
git clone git@crkz.poland.asseco.corp:ksi/e2alg.git
git clone git@crkz.poland.asseco.corp:ksi/e2ws.git
git clone git@crkz.poland.asseco.corp:ksi/e2.git
# install depends
cd e2
git checkout bartoszek/ZR_2.16.002@DEV/Tests_POC
cd CLX
sakctl pull
cd ..
cd ..
# TODO target stubs.
# ksi_testing w tym miejscu potrzebne jest tylko i wyłącznie po to aby zainstalować 'puste' biblioteki
# i nagłówki z używanych przez e2 bibliotek. Po przeportowaniu zda/xe2pj/wer itd. ten krok będzie można pominąć
git clone git@crkz.poland.asseco.corp:pusr/dev/zrwsos/cpp/ksi_testing.git
cd ksi_testing
cmake -B ../${PWD##*/}-build .
cmake --build ../${PWD##*/}-build
cmake --install ../${PWD##*/}-build --prefix=$INTEGRDIR
cd ..
cd e2alg
git checkout ZR_1.09.001@DEV
git apply /vagrant/0001-inicjalizacja-cmake-na-linuxie.patch
cmake -B ../${PWD##*/}-build -DCMAKE_BUILD_TYPE=Debug COMMON
cmake --build ../${PWD##*/}-build
cmake --install ../${PWD##*/}-build --prefix $INTEGRDIR
cd ..
cd e2ws
git checkout bartoszek/ZR_1.03.001@DEV/CMakeInit
cmake -B ../${PWD##*/}-build -DCMAKE_BUILD_TYPE=Debug COMMON
cmake --build ../${PWD##*/}-build
cmake --install ../${PWD##*/}-build --prefix $INTEGRDIR
cd ..
SHELL
# config.vm.provision :shell, inline: "sudo shutdown -r now"
end