Migrated from GitLab wiki

rob
2026-06-29 09:04:59 +00:00
parent f4db38ef53
commit 5c18a459ba
+154
@@ -0,0 +1,154 @@
# Prerequisites
For running **eStack** locally on your windows 10 machine, you should have the following software installed on your system.
- Git
- Oracle Virtual Box version 6.1
- VagrantBox
### Git
`Git` is a code management and version control system. You must install `Git` before going forward. Normally it's very easy to install git on windows but in the case **eStack** you have to take care of specific settings, if this setting is not checked, then it will be difficult for you to run the application on the system.
![image](uploads/bdf88c79b8c6cdf91368449446f96d7c/image.png)
You must check the **Enable Symbolic links**. Because when through git you will clone the application, we need some symbolic links working, and they only works if this option is selected.
When you install, you may find some different kind of option to check for symbolic links, so be careful while installing the Git software.
Download and install git from following link
https://git-scm.com/
### Oracle Virtual Box
For now, **eStack** system is running fine with the **Oracle Virtual Box 6.1** version perfectly. In the future, we will make this work with the latest versions of the VirtualBox. But for now, you have to bear with version 6.1 specifically.
Download and install VirtualBox from the following link
https://www.virtualbox.org/wiki/Download_Old_Builds_6_1
No special instructions are required for this, just simply install and enjoy.
### VagrantBox
The vagrant box is the package we are using to set up the **eStack** machine, we have a pre-configured app in vagrantbox package, which make it very easy for anybody to set up and run the machine, otherwise, it will become difficult to handle specific requirements for the application.
Simply, VagrantBox is pre-configured package to run **eStack** on local machine.
# GitLab
**eStack** is configured for GitLab to manage its code and revisions. So one should ask @rob for GitLab credentials to access the project. Once you have your GitLab credentials then you can use https://git.estack.com to log into the GitLab to clone the project.
### Adding public SSH Key into GitLab
Before making any progress on GitLab such as fetching and pushing the code from GitLab, one should add his/her public ssh keys to the GitLab for hassle-free push/pull from GitLab.
- Open GitLab Account using https://git.estack.com
- Make sure Rob gives you access to the necessary projects
- Go to your account preferences
- In left side you can see SSH Keys and open that.
You will see a screen like below there.
![Screenshot_2023-01-25_at_12.26.23_PM](uploads/03729f2a9330118649acd5c8231edaed/Screenshot_2023-01-25_at_12.26.23_PM.png)
Copy your `public SSH` key and enter into the `key` box.
Following are the steps to get your `public ssh key`.
- Open command prompt
- Go to your user folder which C:\\User\<username\> and there check for folder `.ssh`
- if `.ssh` folder is not available then you don't have ssh keys configured on your local system.
- Execute command in the command prompt `ssh-keygen -t rsa` and after that follow the interactive process of generating keys. You can skip password if you want.
- Once keys are generated, just go inside the `.ssh` folder and look for file `id_rsa.pub` file and copy the content of this file into `key` field of `GitLab` and click on `Add Key` button.
### Cloning of application
Next step in the row is cloning the code into your local machine. Following are step for that.
- Open `pms3` code repository on `GitLab`
- There you will get `Clone` button with drop down in the that.
- Copy the statement from `Cloning with SSH` and this will look like this `git@git.estack.com:tim/pms3.git`
- Go to your local machine `Command Prompt`. Well try to use only `Command Prompt` and in `administrative mode` only. Do not use ~~Power Shell~~ on windows. Because Power Shell do not have `mklink` utility in it whereas `Command Prompt or cmd.exe` has in it, and this `mklink` plays a major role in making symbolic links while cloning the code.
- Now when you met all above condition execute the following command
`git clone git@git.estack.com:tim/pms3.git estack`
- Above command means, clone the repository in `estack` folder.
- Once cloning is done go into the estack folder using command `cd estack`
- after downloading the code
enter commands:
ssh-keygen -R git.estack.com
ssh -T git@git.estack.com
'yes'
# Installing dependencies and running the project
Once code is cloned on local and vagrant machine is created. You have to install the dependencies of the project and do the following steps to do that.
- And inside estack folder execute command `vagrant up` for spinning up the machine. This process will take sometime, as this will download the vagrantbox file and creates a machine on your local system.
- Enter command `vagrant ssh` from `estack` or root of code.
- We have some dependencies listed inside the gitlab and those depedencies are fetched from there, so to fetch them from gitlab smoothly, you need to add the `ssh public key` from inside the `vagrant machine` as well.
- To generate keys execute the commands `ssh-keygen -t rsa` and follow the process as you did in the windows
- Press enter 3 times to get the key
- To copy key use the command `cat ~/.ssh/id_rsa.pub`, this will display the key just copy and then paste inside the GitLab as you did for the Windows Key.
- Execute command 'chmod 600 ~/.ssh/id_rsa'
- Next, make sure you securely provide Rob this public SSH key so he add it to the authorized keys on the server.
- Go to **cd /estack** and execute the command 'sudo apt-get install composer'
- Do you want to continue? [Y/n], press Y
- Before installing the dependencies execute `sudo composer selfupdate`, this will update the `composer` to the latest version
- Execute command 'sudo chown -R vagrant:vagrant /home/vagrant/.composer'
-
- Execute command 'sudo chmod 777 /home/vagrant/.composer/cache'
- Execute the command 'composer install' This will install all required dependencies
- Are you sure you want to continue connecting (yes/no)? yes
- After install, type mysql and press enter to see if Mariadb is accessible
- Add this to you host file '192.168.56.10 cb.vm.estack.com'
-- Open Notepad Right click and Run as Administrator
-- File > Open - (Host file is location: C:\Windows\System32\drivers\etc)
-- add '192.168.56.10 cb.vm.estack.com' then save
- If you get your dependencies installed properly without any error, then you have estack machine runing locally, and you can access the machine from the link https://cb.vm.estack.com
- Accept and continue SSH exception and you are done.
# Installing Databases
You will get `pms_cb` database already available but that database is not having any table in it. To restore the database you have to copy it from the Live Production.
From inside the vagrant machine, just execute the command `cd` this will take you to the home of `root` user, and there you can download the database using the following command
`wget https://cbus.estack.com/pms_cbus_latest.sql.gz`
Name of the database file may change, you have to check that with the latest backup with @rob
Once you have this file downloaded, you can execute the following command to import this file into the database.
`run zcat pms_cbus_latest.sql.gz | mysql pms_cb`
This command will take some time, as this is going to execute all queries from the backup file against `pms_cb` database.
Once this database file is imported, you are done.