Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oro 3.1 upgrade #82

Open
wants to merge 141 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
627aaaf
Change project structure
krasilich Jun 5, 2019
cf259d6
Change project structure
krasilich Jun 5, 2019
e259f38
Change project structure
krasilich Jun 5, 2019
198c2c9
- Fix upgrade issues
krasilich Jun 12, 2019
2134e3b
DIAM-1915 Removed unused Web UI installer
sashaskr Jun 20, 2019
4447ab6
DIAM-1916 Fix DeskBundle services
sashaskr Jun 20, 2019
158ff9c
DIAM-1917 Replace DefinitionDecorator
sashaskr Jun 21, 2019
ce1165f
DIAM-1919 Replaced functionality on InstallCommand class
sashaskr Jun 25, 2019
6ea715f
DIAM-1919 Removed unused code
sashaskr Jun 26, 2019
d883aeb
- Update travis config
krasilich Jul 1, 2019
d2aa018
- Fix upgrade issues
krasilich Jul 1, 2019
cc4949e
Update .travis.yml
krasilich Jul 1, 2019
4944294
Merge pull request #83 from sashaskr/DIAM-1915
krasilich Jul 1, 2019
6cd148e
Merge pull request #85 from sashaskr/DIAM-1917
krasilich Jul 1, 2019
016481d
Merge pull request #84 from sashaskr/DIAM-1916
krasilich Jul 1, 2019
ac1f32b
DIAM-1919 Cherry-pick travis from master
sashaskr Jul 1, 2019
6510bc9
DIAM-1919 Added -vv parameter in runCommand
sashaskr Jul 1, 2019
6a92b98
Merge pull request #86 from sashaskr/DIAM-1919
krasilich Jul 2, 2019
4b4cf03
DIAM-1922 Updated syntax for assets.yml
sashaskr Jul 4, 2019
c2bf7ca
Merge branch 'oro-3.1-upgrade' into DIAM-1922
sashaskr Jul 4, 2019
c7c1a2b
DIAM-1923 Fixed get() method
sashaskr Jul 8, 2019
5394e41
Merge pull request #87 from sashaskr/DIAM-1922
krasilich Jul 8, 2019
4c7b66f
WIP
sashaskr Jul 8, 2019
188f1a9
Merge branch 'oro-3.1-upgrade' into DIAM-1293-TBC
sashaskr Jul 8, 2019
359eaf2
Renamed assets with less
sashaskr Jul 8, 2019
c1b7e7d
Fixed OptioinResolver, and datagrid
sashaskr Jul 16, 2019
f6994f4
Changed types
sashaskr Jul 17, 2019
8f3bcb0
Added support to assert
sashaskr Jul 18, 2019
a1215c2
Fixed ticket create, ticket update WIP
sashaskr Jul 18, 2019
6686c40
Unchained ticketBuilder
sashaskr Jul 18, 2019
5554e99
WIP
sashaskr Jul 18, 2019
96422ab
Fixed the ticket controller
sashaskr Jul 22, 2019
0551cb7
Commented clearSearchIndex() method
sashaskr Jul 22, 2019
7845079
Fixed assign functionality
sashaskr Jul 22, 2019
6854e2b
Fixed ticket status change
sashaskr Jul 22, 2019
52fc906
Fixed some errors on Watcher
sashaskr Jul 23, 2019
01ad45e
Fixed types and controller for Attachments
sashaskr Jul 24, 2019
69dc5ee
fixes on branch
sashaskr Jul 26, 2019
db51428
Fixed branches deletion and updating
sashaskr Jul 26, 2019
94e50c4
Merge pull request #88 from sashaskr/DIAM-1923
krasilich Aug 5, 2019
e9c2d57
DIAM-1925 Fixed types and OptionResolver
sashaskr Aug 8, 2019
b09504f
DIAM-1925 Fixed types
sashaskr Aug 8, 2019
6906cef
DIAM-1925 Fixed transformers
sashaskr Aug 8, 2019
de49b1f
DIAM-1925 Fixed controllers and types
sashaskr Aug 8, 2019
31683ee
Merge pull request #89 from sashaskr/DIAM-1925-fixing-types-and-optio…
krasilich Aug 9, 2019
e048557
Merge pull request #90 from sashaskr/DIAM-1926-fix-update-delete-branch
krasilich Aug 29, 2019
246f598
DIAM-1927 Fixing the automation bundle
Oct 7, 2019
ca42369
DIAM-1928 Fixing the UserBundle(minor changes) Embedded Form (minor c…
Oct 7, 2019
3cf7985
Merge pull request #100 from eltrino/DIAM-1914
krasilich Oct 7, 2019
92455d0
DIAM-1914 Fix config
Dec 11, 2019
20d1039
DIAM-1914
Dec 11, 2019
a1cb5cf
DIAM-1967: bug with name file routes.json
Jan 9, 2020
c4562cd
DIAM-1943: Sidebar widget can't be added
Jan 9, 2020
72a4722
Merge pull request #103 from eltrino/DIAM-1967
krasilich Jan 10, 2020
88b1742
Merge pull request #104 from eltrino/DIAM-1943
krasilich Jan 10, 2020
4c2679c
DIAM-1947: Can't delete uploaded image at Branches
Jan 10, 2020
bc503de
Merge pull request #105 from eltrino/DIAM-1947
krasilich Jan 12, 2020
70a4972
DIAM-1949: Errors with tickets' images interactions
Jan 13, 2020
99bf3a8
[DIAN-1950] - remove task comments numbering
Jan 13, 2020
8836543
[DIAN-1954,1948] - fix diam-user-type label
Jan 13, 2020
0e3a1f5
DIAM-1966: DB error when clicking on the arrow to uncover sidebar wid…
Jan 14, 2020
5f13d16
DIAM-1960: Database errors in Customers section
Jan 14, 2020
825ad4d
[DIAN-1945] - separate Manage Dashboard in Dashboards
Jan 14, 2020
9304478
Merge pull request #107 from eltrino/DIAM-1950
krasilich Jan 15, 2020
ab7e2e4
Merge pull request #108 from eltrino/DIAM-1966
krasilich Jan 15, 2020
bd5939f
Merge pull request #109 from eltrino/DIAM-1960
krasilich Jan 15, 2020
43eb7ff
[DIAN-1957] - in navigation panel changed "reports" icon
Jan 15, 2020
0226171
DIAM-1960: Database errors in Customers section
Jan 15, 2020
87de16f
[DIAN-1957] - in navigation panel changed .active color
Jan 15, 2020
28cdf79
[DIAN-1946] - vertical centered modal dialog
Jan 16, 2020
afa245c
DIAM-1970: Exception during customer's update
Jan 17, 2020
1c16cde
Merge pull request #111 from eltrino/DIAM-1957
krasilich Jan 19, 2020
fa1902c
Merge pull request #112 from eltrino/DIAM-1970
krasilich Jan 19, 2020
a1d8dda
DIAM-1971: Display settings couldn’t be saved
Jan 21, 2020
4afa061
DIAM-1975: Can't disable user
Jan 21, 2020
7047a79
DIAM-1977: User edit is not saved
Jan 21, 2020
b84f160
DIAM-1983: DB error in Embedded forms
Jan 22, 2020
3e6f6ab
DIAM-1984: Error in Data audit section
Jan 22, 2020
b73a498
DIAM-1961: Non-existing currencies
Jan 23, 2020
85c983d
DIAM-1985: DB error durind interactions at side widget menu
Jan 24, 2020
0283ea6
DIAM-1974: Unclear 1/0 options for choosing
Jan 24, 2020
2f999dd
Merge pull request #120 from eltrino/DIAM-1974
krasilich Jan 28, 2020
da2d921
Merge pull request #119 from eltrino/DIAM-1985
krasilich Jan 28, 2020
6542294
Merge pull request #118 from eltrino/DIAM-1961
krasilich Jan 28, 2020
3891f2b
Merge pull request #117 from eltrino/DIAM-1984
krasilich Jan 28, 2020
56b549a
Merge pull request #116 from eltrino/DIAM-1983
krasilich Jan 28, 2020
ddbbd20
Merge pull request #115 from eltrino/DIAM-1977
krasilich Jan 28, 2020
0b70e7c
Merge pull request #114 from eltrino/DIAM-1975
krasilich Jan 28, 2020
10a1b67
Merge pull request #113 from eltrino/DIAM-1971
krasilich Jan 28, 2020
3407134
Merge branch 'oro-3.1-upgrade' into DIAM-1960
krasilich Jan 28, 2020
16d175e
Merge pull request #110 from eltrino/DIAM-1960
krasilich Jan 28, 2020
566e10c
Merge branch 'oro-3.1-upgrade' of github.com:eltrino/diamantedesk-app…
Jan 28, 2020
426c637
DIAM-1949: Errors with tickets' images interactions
Jan 28, 2020
8b4409b
DIAM-1949: Errors with tickets' images interactions
Jan 28, 2020
8c9e1c7
Merge pull request #106 from eltrino/DIAM-1949
krasilich Jan 28, 2020
2dd706d
[DIAN-1965] - added Diamante logo on 404 page, fixed "go back" button…
Jan 29, 2020
cae7af2
[DIAN-1965] - fixed 404 page logo img
Jan 29, 2020
6a88803
Merge branch 'oro-3.1-upgrade' into DIAM-1965
Jan 29, 2020
54404ed
DIAM-1951: Can't see attached photo in comments
Jan 30, 2020
847ed6c
Merge pull request #122 from eltrino/DIAM-1951
krasilich Feb 4, 2020
d71ad0f
Merge pull request #121 from eltrino/DIAM-1965
krasilich Feb 4, 2020
985c090
DIAM-1969: Need to install the DiamanteDesk
Feb 4, 2020
2ef80e8
[DIAN-1958] - fix rules creating pages (add css and assets to automat…
Feb 5, 2020
2f30053
Merge branch 'oro-3.1-upgrade' into DIAM-1958
Feb 5, 2020
fd350d4
Merge branch 'oro-3.1-upgrade' of github.com:eltrino/diamantedesk-app…
Feb 10, 2020
bf6de23
DIAM-1969:
Feb 10, 2020
c1e230a
DIAM-1990: API errors
Feb 19, 2020
338572b
DIAM-1989: Error when run cron console command
Feb 19, 2020
7ef060c
Merge pull request #123 from eltrino/DIAM-1958
krasilich Feb 20, 2020
dacffb4
Merge pull request #124 from eltrino/DIAM-1969
krasilich Feb 20, 2020
e197b2d
Merge pull request #126 from eltrino/DIAM-1989
krasilich Feb 20, 2020
45910ee
Merge pull request #125 from eltrino/DIAM-1990
krasilich Feb 20, 2020
9b7c0c1
DIAM-1995: Multiple errors during configuring sidebar widgets - Recen…
Feb 21, 2020
0cc2e6a
[DIAN-1996] - fixed markup bug during branch creating
Feb 24, 2020
20decb3
[DIAM-1996] - fixed markup bug during branch creating
Feb 24, 2020
0228fcd
Merge branch 'DIAM-1996' of https://github.com/eltrino/diamantedesk-a…
Feb 24, 2020
5387035
Merge pull request #128 from eltrino/DIAM-1996
krasilich Feb 24, 2020
f930b67
Merge pull request #127 from eltrino/DIAM-1995
krasilich Feb 24, 2020
3e5d8aa
[DIAN-2006] - fixed Markup bug after adding watchers to a ticket
Feb 24, 2020
d56fff3
Merge branch 'oro-3.1-upgrade' into DIAM-1996
Feb 24, 2020
554299d
[DIAM-2005] - added indent at comment section
Feb 24, 2020
c127e34
[DIAN-1998] - Bug during mass branches deletion
Apr 2, 2020
158465e
[DIAN-1997] - fixed pop-up window bug during branch deletion
Apr 3, 2020
59668bb
[DIAN-1994] - Position of pop-up window
Apr 4, 2020
f26cffd
Merge pull request #130 from eltrino/DIAM-1998
krasilich Apr 6, 2020
7df9c27
Merge branch 'oro-3.1-upgrade' into DIAM-1996
krasilich Apr 6, 2020
dd4d6f1
Merge pull request #129 from eltrino/DIAM-1996
krasilich Apr 6, 2020
6aeee52
DIAM-1914
Apr 6, 2020
84b8226
DIAM-2002
Apr 8, 2020
2c9a7fe
Merge pull request #131 from eltrino/DIAM-2002
krasilich Apr 8, 2020
758de03
DIAM-2004
Apr 8, 2020
15f454b
Merge pull request #132 from eltrino/DIAM-2002
krasilich Apr 8, 2020
10823c2
DIAM-1984
Apr 9, 2020
537aab7
Merge pull request #133 from eltrino/DIAM-1984
krasilich Apr 9, 2020
e75ad94
DIAM-1914
Apr 9, 2020
a6af73a
Merge pull request #134 from eltrino/DIAM-1998
krasilich Apr 9, 2020
b6f02c9
DIAM-1953
Apr 16, 2020
f47d50c
Merge pull request #135 from eltrino/DIAM-1953
krasilich Apr 16, 2020
613dc04
DIAM-1920
Apr 17, 2020
6f2112d
Merge pull request #136 from eltrino/DIAM-1920
krasilich Apr 17, 2020
f5c1d96
DIAM-1920
krasilich Nov 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
last 1 firefox version
last 1 chrome version
ie 11
last 1 edge version
last 1 safari version
50 changes: 36 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,41 @@
/build/logs/*
/vendor
/cov
/web/bundles
/web/css
/web/js
/web/uploads/users/*
/web/uploads/branch/*
/web/media/cache
/web/build.js
/app/cache/*
/app/config/parameters.yml
/app/config/parameters_test.yml
behat.yml
/var/*
!var/cache/
/var/cache/*
!var/cache/.gitkeep
!var/logs/
/var/logs/*
!var/logs/.gitkeep
!var/attachment/
/var/attachment/*
!var/attachment/.gitkeep
!var/attachments/
/var/attachments/*
!var/attachments/.gitkeep
!var/import_export/
/var/import_export/*
!var/import_export/.gitkeep
!var/oro-check.php
!var/OroRequirements.php
!var/DiamanteDeskRequirements.php
/public/bundles
/public/css
/public/js
/public/uploads/users/*
/public/media/cache
/public/media/js
/public/build.js
/config/parameters.yml
/config/parameters_test.yml
*~
/app/logs/*
/app/attachments/*
bin/*
!bin/console
!bin/dist
phpunit.xml
.DS_Store
bin
/var/SymfonyRequirements.php
/public/uploads/behat
/.web-server-pid
/.vagrant
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ matrix:
- php: hhvm

branches:
except:
- l10n_master
only:
- master

before_install:
- mysql -e 'create database diamantedesk;'
Expand Down
945 changes: 945 additions & 0 deletions 3rd-party-dependencies.md

Large diffs are not rendered by default.

326 changes: 326 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,326 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Use this Vagrant configuration file for local installation of the Oro application.
# Please, refer to the Oro Applications installation guides for the detailed instructions:
# https://oroinc.com/orocrm/doc/current/install-upgrade/one-step-automated-installation/vagrant

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.

# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "centos/7"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
config.vm.network "forwarded_port", guest: 80, host: 8000

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"

# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "192.168.33.10"

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
#
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
# vb.gui = true

# Customize the amount of memory on the VM:
vb.memory = 2048
vb.cpus = 2
end
#
# View the documentation for the provider you are using for more
# information on available options.

# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", inline: <<-SHELL

echo "\n*****************************************************"
echo "************* Provision process started *************"
echo "*****************************************************\n"

# --------------------- Provision configuration ---------------------

# --- VM settings ---

FORWARDED_PORT=8000

# --- Database settings ---

DB_USER="dbuser"
DB_PASSWORD="DBP@ssword123"
DB_NAME="oro"

# --- Oro application settings ---

APP_HOST="localhost"
APP_USER="admin"
APP_PASSWORD="adminpass"
APP_LOAD_DEMO_DATA="y" # y | n

echo "\n*******************************************************"
echo "************** Step 1: Environment Setup **************"
echo "*******************************************************\n"

echo "\n~~~~~~~~~~~~~~ Enable Required Package Repositories ~~~~~~~~~~~~~~\n"

yum install -y epel-release
yum update -y

echo "\n~~~~~~~~~~~~~~ Install Nginx, NodeJS, Git, Supervisor, and Wget ~~~~~~~~~~~~~~\n"

yum install -y nginx wget git nodejs supervisor yum-utils

echo "\n~~~~~~~~~~~~~~ Install MySQL ~~~~~~~~~~~~~~\n"

wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm && rpm -ivh mysql80-community-release-el7-1.noarch.rpm
yum-config-manager --disable mysql80-community
yum-config-manager --enable mysql57-community

yum install -y mysql-community-server

echo "\n~~~~~~~~~~~~~~ Install PHP ~~~~~~~~~~~~~~\n"

wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm && rpm -Uvh remi-release-7.rpm
yum-config-manager --enable remi-php71
yum update -y

yum install -y php-fpm php-cli php-pdo php-mysqlnd php-xml php-soap php-gd php-mbstring php-zip php-intl php-mcrypt php-opcache

echo "\n~~~~~~~~~~~~~~ Install Composer ~~~~~~~~~~~~~~\n"

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/bin/composer

echo "\n~~~~~~~~~~~~~~ Enable Installed Services ~~~~~~~~~~~~~~\n"

systemctl start mysqld php-fpm nginx supervisord
systemctl enable mysqld php-fpm nginx supervisord

echo "********************************************************************************"
echo "************** Step 2: Pre-installation Environment Configuration **************"
echo "********************************************************************************"

echo "\n~~~~~~~~~~~~~~ Perform Security Configuration ~~~~~~~~~~~~~~\n"

sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
setenforce permissive

echo "\n~~~~~~~~~~~~~~ Prepare MySQL Database ~~~~~~~~~~~~~~\n"

# --- Change the MySQL Server Configuration ---

echo "[client]" >> /etc/my.cnf
echo "default-character-set = utf8mb4" >> /etc/my.cnf
echo "" >> /etc/my.cnf
echo "[mysql]" >> /etc/my.cnf
echo "default-character-set = utf8mb4" >> /etc/my.cnf
echo "" >> /etc/my.cnf
echo "[mysqld]" >> /etc/my.cnf
echo "innodb_file_per_table = 0" >> /etc/my.cnf
echo "wait_timeout = 28800" >> /etc/my.cnf
echo "character-set-server = utf8mb4" >> /etc/my.cnf
echo "collation-server = utf8mb4_unicode_ci" >> /etc/my.cnf

systemctl restart mysqld

# --- Change the Default MySQL Password for Root User ---

MYSQL_INSTALLED_TMP_ROOT_PASSWORD=$(grep 'temporary password' /var/log/mysqld.log | awk '{print $NF}')
mysqladmin --user=root --password=$MYSQL_INSTALLED_TMP_ROOT_PASSWORD password $DB_PASSWORD

# --- Create a Database for OroPlatform Community Edition Application and a Dedicated Database User ---

mysql -uroot -p$DB_PASSWORD -e "CREATE DATABASE $DB_NAME"
mysql -uroot -p$DB_PASSWORD -e "GRANT ALL PRIVILEGES ON $DB_NAME.* to '$DB_USER'@'localhost' identified by '$DB_PASSWORD'"
mysql -uroot -p$DB_PASSWORD -e "FLUSH PRIVILEGES"

echo "\n~~~~~~~~~~~~~~ Configure Web Server ~~~~~~~~~~~~~~\n"

cat > /etc/nginx/conf.d/default.conf <<____NGINXCONFIGTEMPLATE
server {
server_name $APP_HOST www.$APP_HOST;
root /usr/share/nginx/html/oroapp/public;

index index.php;

gzip on;
gzip_proxied any;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
gzip_vary on;

location / {
# try to serve file directly, fallback to index.php
try_files \\$uri /index.php\\$is_args\\$args;
}

location ~ ^/(index|index_dev|config|install)\\.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
# or
# fastcgi_pass unix:/var/run/php/php7-fpm.sock;
fastcgi_split_path_info ^(.+\\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME \\$document_root\\$fastcgi_script_name;
fastcgi_param HTTPS off;
fastcgi_buffers 64 64k;
fastcgi_buffer_size 128k;
}

location ~* ^[^(\\.php)]+\\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ {
access_log off;
expires 1h;
add_header Cache-Control public;
}

error_log /var/log/nginx/${APP_HOST}_error.log;
access_log /var/log/nginx/${APP_HOST}_access.log;
}
____NGINXCONFIGTEMPLATE

systemctl restart nginx

echo "\n~~~~~~~~~~~~~~ Configure PHP ~~~~~~~~~~~~~~\n"

sed -i 's/user = apache/user = nginx/g' /etc/php-fpm.d/www.conf
sed -i 's/group = apache/group = nginx/g' /etc/php-fpm.d/www.conf
sed -i 's/;catch_workers_output/catch_workers_output/g' /etc/php-fpm.d/www.conf

sed -i 's/memory_limit = [0-9MG]*/memory_limit = 1G/g' /etc/php.ini
sed -i 's/;realpath_cache_size = [0-9MGk]*/realpath_cache_size = 4M/g' /etc/php.ini
sed -i 's/;realpath_cache_ttl = [0-9]*/realpath_cache_ttl = 600/g' /etc/php.ini

sed -i 's/opcache.enable=[0-1]/opcache.enable=1/g' /etc/php.d/10-opcache.ini
sed -i 's/;opcache.enable_cli=[0-1]/opcache.enable_cli=0/g' /etc/php.d/10-opcache.ini
sed -i 's/opcache.memory_consumption=[0-9]*/opcache.memory_consumption=512/g' /etc/php.d/10-opcache.ini
sed -i 's/opcache.interned_strings_buffer=[0-9]*/opcache.interned_strings_buffer=32/g' /etc/php.d/10-opcache.ini
sed -i 's/opcache.max_accelerated_files=[0-9]*/opcache.max_accelerated_files=32531/g' /etc/php.d/10-opcache.ini
sed -i 's/;opcache.save_comments=[0-1]/opcache.save_comments=1/g' /etc/php.d/10-opcache.ini

systemctl restart php-fpm

echo "********************************************************************************************"
echo "************** Step 3: OroPlatform Community Edition Application Installation **************"
echo "********************************************************************************************"

echo "\n~~~~~~~~~~~~~~ Get Application Source Code ~~~~~~~~~~~~~~\n"

# --- Copy application source code from the current host folder to the nginx web folder ---

cd /usr/share/nginx/html
mkdir oroapp && cd oroapp
cp -r /vagrant/* .

echo "\n~~~~~~~~~~~~~~ Install Application Dependencies ~~~~~~~~~~~~~~\n"

# --- Configure config/parameters.yml (to prevent composer interactive dialog) ---

cp ./config/parameters.yml.dist ./config/parameters.yml
sed -i "s/database_user:[ ]*root/database_user: $DB_USER/g" ./config/parameters.yml
sed -i "s/database_password:[ ]*~/database_password: '$DB_PASSWORD'/g" ./config/parameters.yml
sed -i "s/database_name:[ ]*[a-zA-Z0-9_]*/database_name: $DB_NAME/g" ./config/parameters.yml

composer install --prefer-dist --no-dev

echo "\n~~~~~~~~~~~~~~ Install OroPlatform Community Edition Application ~~~~~~~~~~~~~~\n"

# --- Configure DBAL parameters before installation ---

cat >> ./config/config.yml <<____DOCTRINECONFIG

doctrine:
dbal:
charset: utf8mb4
default_table_options:
charset: utf8mb4
collate: utf8mb4_unicode_ci

____DOCTRINECONFIG

# --- Run the installation command ---

php ./bin/console oro:install --env=prod --timeout=900 --no-debug --application-url="http://$APP_HOST/" --organization-name="Oro Inc" --user-name="$APP_USER" --user-email="[email protected]" --user-firstname="Bob" --user-lastname="Dylan" --user-password="$APP_PASSWORD" --sample-data=$APP_LOAD_DEMO_DATA --language=en --formatting-code=en_US

echo "\n~~~~~~~~~~~~~~ Add Required Permissions for the nginx User ~~~~~~~~~~~~~~\n"

setfacl -b -R ./
cd /usr/share/nginx/html/oroapp
find . -type f -exec chmod 0644 {} \\;
find . -type d -exec chmod 0755 {} \\;
chown -R nginx:nginx ./var/{sessions,attachment,cache,import_export,logs}
chown -R nginx:nginx ./public/{media,uploads,js}

echo "\n*********************************************************************************"
echo "************** Step 4: Post-installation Environment Configuration **************"
echo "*********************************************************************************\n"

echo "\n~~~~~~~~~~~~~~ Schedule Periodical Command Execution ~~~~~~~~~~~~~~\n"

echo "*/1 * * * * php /usr/share/nginx/html/oroapp/bin/console oro:cron --env=prod > /dev/null" > /var/spool/cron/nginx

echo "\n~~~~~~~~~~~~~~ Configure and Run Required Background Processes ~~~~~~~~~~~~~~\n"

cat >> /etc/supervisord.conf <<____SUPERVISORDTEMPLATE
[program:oro_web_socket]
command=php ./bin/console clank:server --env=prod
numprocs=1
autostart=true
autorestart=true
directory=/usr/share/nginx/html/oroapp
user=nginx
redirect_stderr=true

[program:oro_message_consumer]
command=php ./bin/console oro:message-queue:consume --env=prod
process_name=%(program_name)s_%(process_num)02d
numprocs=5
autostart=true
autorestart=true
directory=/usr/share/nginx/html/oroapp
user=nginx
redirect_stderr=true
____SUPERVISORDTEMPLATE

systemctl restart supervisord

echo "\n**********************************************************************************************************************"
echo "************** Congratulations! You’ve Successfully Installed OroPlatform Application **********************************"
echo "**********************************************************************************************************************\n"
echo "\n************** You should now be able to open the homepage http://$APP_HOST:$FORWARDED_PORT/ and use the application. **************\n"
SHELL
end

Loading