Automate vagrant setup

This commit is contained in:
Thilina Hasantha
2019-08-29 08:07:57 +02:00
parent 61abe71314
commit 08a52d216c
5 changed files with 1955 additions and 1941 deletions

8
Vagrantfile vendored
View File

@@ -15,14 +15,12 @@ Vagrant.configure(2) do |config|
config.vm.provision "shell", inline: <<-SHELL config.vm.provision "shell", inline: <<-SHELL
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AA8E81B4331F7F50
sudo apt-get update sudo apt-get update
chmod ugo+x /vagrant/deployment/vagrant/runonce.sh
sh /vagrant/deployment/vagrant/runonce.sh
SHELL SHELL
config.vm.hostname = "icehrm.open" config.vm.hostname = "icehrm.open"
config.hostsupdater.aliases = [
"app.icehrm-open.test",
"clients.icehrm-open.test"
]
end end

26
deployment/vagrant/runonce.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
if [ ! -f ~/runonce ]
then
sudo apt-get install ant
sudo chmod -R 777 /var/log/nginx
cd /vagrant
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
npm install
sudo npm install -g gulp-cli
sudo sed 's/server_name clients.app.dev/server_name clients.icehrm-open.test/g' /etc/nginx/sites-available/clients.app.com > /tmp/clients.app.com
sudo mv /tmp/clients.app.com /etc/nginx/sites-available/clients.app.com
sudo sed 's/server_name app.app.dev/server_name app.icehrm-open.test/g' /etc/nginx/sites-available/app.app.com > /tmp/app.app.com
sudo sed 's#root /vagrant/build/app#root /vagrant#g' /tmp/app.app.com > /tmp/mod.app.app.com
sudo mv /tmp/mod.app.app.com /etc/nginx/sites-available/app.app.com
sudo sed 's#xdebug.remote_host=192.168.30.1#xdebug.remote_host=192.168.40.1#g' /etc/php/7.0/fpm/conf.d/90-app.ini > /tmp/mod.90-app.ini
sudo mv /tmp/mod.90-app.ini /etc/php/7.0/fpm/conf.d/90-app.ini
sudo service php7.0-fpm restart
sudo service nginx restart
touch ~/runonce
fi

3807
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -70,9 +70,6 @@ Preparing development VM with Vagrant
- Install Vagrant [https://www.vagrantup.com/downloads.html](https://www.vagrantup.com/downloads.html) - Install Vagrant [https://www.vagrantup.com/downloads.html](https://www.vagrantup.com/downloads.html)
- Install Vagrant host updater plugin [https://github.com/cogitatio/vagrant-hostsupdater](https://github.com/cogitatio/vagrant-hostsupdater)
- Run vagrant up in icehrm root directory (this will download icehrm vagrant image which is ~1 GB) - Run vagrant up in icehrm root directory (this will download icehrm vagrant image which is ~1 GB)
``` ```
@@ -85,55 +82,23 @@ Preparing development VM with Vagrant
~ $ vagrant ssh ~ $ vagrant ssh
``` ```
- Setup the Vagrant box - Add following entries to the end of the host file to map icehrm domains to VagrantBox (on MacOS and Linux this is /etc/hosts | on windows this is Windows\System32\Drivers\etc\hosts)
``` ```
~ $ sudo apt-get install ant 192.168.40.40 app.icehrm-open.test
~ $ sudo chmod -R 777 /var/log/nginx 192.168.40.40 clients.icehrm-open.test
~ $ cd /vagrant
~ $ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
~ $ sudo apt-get install -y nodejs
~ $ npm install
~ $ sudo npm install -g gulp-cli
```
- Make Changes to enable domain icehrm-open.test in Vagrant Box
```
~ $ sudo sed 's/server_name clients.app.dev/server_name clients.icehrm-open.test/g' /etc/nginx/sites-available/clients.app.com > /tmp/clients.app.com
~ $ sudo mv /tmp/clients.app.com /etc/nginx/sites-available/clients.app.com
~ $ sudo sed 's/server_name app.app.dev/server_name app.icehrm-open.test/g' /etc/nginx/sites-available/app.app.com > /tmp/app.app.com
~ $ sudo sed 's#root /vagrant/build/app#root /vagrant#g' /tmp/app.app.com > /tmp/mod.app.app.com
~ $ sudo mv /tmp/mod.app.app.com /etc/nginx/sites-available/app.app.com
~ $ sudo service php7.0-fpm restart
~ $ sudo service nginx restart
```
- Build Icehrm (your icehrm root directory is mapped to /vagrant/ directory in VM)
```
~ $ gulp
~ $ ant buildlocal
``` ```
- Navigate to [http://clients.icehrm-open.test/dev](http://clients.icehrm-open.test/dev) to load icehrm from VM. (user:admin/pass:admin) - Navigate to [http://clients.icehrm-open.test/dev](http://clients.icehrm-open.test/dev) to load icehrm from VM. (user:admin/pass:admin)
### Notes to Developers ### Notes to Developers
- When ever you have done a change to JavaScript or CSS files in icehrm/web - When ever you have done a change to JavaScript or CSS files in icehrm/web rebuild the frontend
``` ```
~ $ cd /vagrant ~ $ cd /vagrant
~ $ gulp ~ $ gulp
``` ```
- When ever you have done a change to icehrm/core/src
```
~ $ cd /vagrant
~ $ ant phpcs-ci
```

View File

@@ -2,15 +2,21 @@ Release note v26.6.0.OS
------------------------ ------------------------
### Features ### Features
* Improvements to UI * Some Improvements to UI such as updating Icons and upgrading font-awesome to its latest version
* Track IP and location of the employee when marking attendance * Tracking IP and location of the employee when marking attendance, this is done when updating attendance via mobile
* Ability to control location tracking via mobile using server side settings
* Improvements to translations * Improvements to translations
* Compatible with location tracking with icehrm mobile app * Compatible with location tracking with icehrm mobile app
### Mobile App
* This release is coupled with mobile application release on AppStore (https://apple.co/2Yrtxoy) and Google Play (http://bit.ly/2OkMmKe)
### Fixes ### Fixes
* Order projects by name on timesheets * Order projects by name on Timesheet project listing (This is to make it easier to edit timesheets with many projects)
* Link home page user profile to employee profile update page * Link home page user profile to employee profile update page
* Fix issues related to configuring Api with mobile app * Fix issues related to configuring Api with mobile app
### Security Improvements
* Upgrade npm missing dependencies * Upgrade npm missing dependencies