Skip to content

Commit

Permalink
Merge pull request #69 from spryker/develop
Browse files Browse the repository at this point in the history
Upgrade Nodejs and PHP
  • Loading branch information
vvs82 authored Aug 18, 2020
2 parents 442fef6 + 7af10e0 commit 99dc173
Show file tree
Hide file tree
Showing 17 changed files with 2,747 additions and 19 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static-test.demoshop.local
## Note on PHP opcache
In order to use opcache for CLI calls as well, the VM ships with PHP opcache file cache enabled. Cache contents are stored in `/var/tmp/opcache` directory. After enabling/disabling PHP modules (and as a possible fix if you are getting unexpected PHP error, like Segmentation fault), you must clean the cache directory with:
```
sudo rm -rf /var/tmp/opcache/*; sudo systemctl restart php7.2-fpm
sudo rm -rf /var/tmp/opcache/*; sudo systemctl restart php7.4-fpm
```

## Customizing the VM
Expand All @@ -51,12 +51,12 @@ To enable xdebug, use the following commands:
```
# Enable XDebug, disable OpCache, clear disk cache, restart FPM
sudo -i bash -c " \
phpenmod -v 7.2 -s cli -m xdebug; \
phpenmod -v 7.2 -s fpm -m xdebug; \
phpdismod -v 7.2 -s cli -m opcache; \
phpdismod -v 7.2 -s fpm -m opcache; \
phpenmod -v 7.4 -s cli -m xdebug; \
phpenmod -v 7.4 -s fpm -m xdebug; \
phpdismod -v 7.4 -s cli -m opcache; \
phpdismod -v 7.4 -s fpm -m opcache; \
rm -rf /var/tmp/opcache/*; \
systemctl restart php7.2-fpm \
systemctl restart php7.4-fpm \
"
```

Expand All @@ -65,12 +65,12 @@ enabling it only when you need. To disable xdebug and re-enable opcache, use the
```
# Disable XDebug, enable OpCache, clear disk cache, restart FPM
sudo -i bash -c " \
phpdismod -v 7.2 -s cli -m xdebug; \
phpdismod -v 7.2 -s fpm -m xdebug; \
phpenmod -v 7.2 -s cli -m opcache; \
phpenmod -v 7.2 -s fpm -m opcache; \
phpdismod -v 7.4 -s cli -m xdebug; \
phpdismod -v 7.4 -s fpm -m xdebug; \
phpenmod -v 7.4 -s cli -m opcache; \
phpenmod -v 7.4 -s fpm -m opcache; \
rm -rf /var/tmp/opcache/*; \
systemctl restart php7.2-fpm \
systemctl restart php7.4-fpm \
"
```

Expand Down
4 changes: 3 additions & 1 deletion Vagrantfile-quick
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,12 @@ else
IS_LINUX = false
IS_OSX = true
SYNCED_FOLDER_OPTIONS = { type: 'nfs', nfs_udp: false, mount_options: ['nolock', 'fsc', 'noatime', 'async'] }
SYNCED_FOLDER_OPTIONS = { type: 'nfs', nfs_udp: false, mount_options: ['nolock', 'noatime', 'async'] } # benchmark
else
IS_LINUX = true
IS_OSX = false
SYNCED_FOLDER_OPTIONS = { type: 'nfs', nfs_udp: false, mount_options: ['nolock', 'fsc', 'noatime', 'async'] }
SYNCED_FOLDER_OPTIONS = { type: 'nfs', nfs_udp: false, mount_options: ['nolock', 'noatime', 'async'] } # benchmark
end
end

Expand Down Expand Up @@ -239,7 +241,7 @@ Vagrant.configure(2) do |config|

# Copy VM env file to the VM, so that settings can be read by PHP
config.vm.provision "shell",
inline: "cp /vagrant/.vm /etc/spryker-vm-env; service php7.2-fpm restart"
inline: "cp /vagrant/.vm /etc/spryker-vm-env; service php7.4-fpm restart"

# Configure VirtualBox VM resources (CPU and memory)
config.vm.provider :virtualbox do |vb|
Expand Down
46 changes: 44 additions & 2 deletions ci/smoke-test-linux/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ pipeline {
}
vagrant init spryker-devvm-${params.box_version} /var/www/get/spryker/spryker-devvm*-${params.box_version}.box || (cleanup; exit 1)
VM_NAME="jenkins-${env.JOB_NAME}-${env.BUILD_NUMBER}" vagrant up || (cleanup; exit 1)
mv Vagrantfile Vagrantfile.bak
awk '/^end/{print " config.hostmanager.enabled = true; config.hostmanager.manage_host = false"}1' Vagrantfile.bak > Vagrantfile
VM_NAME="jenkins-${env.JOB_NAME}-${env.BUILD_NUMBER}" VM_DOMAIN="suite-nonsplit" vagrant up || (cleanup; exit 1)
"""
}
}
Expand Down Expand Up @@ -67,12 +69,26 @@ pipeline {
rm -rf Vagrantfile Vagrantfile.bak .vm .vagrant project
}
vagrant ssh -c 'cd /data/shop/development/current; ulimit -n 65535; vendor/bin/install' || (cleanup; exit 1)
vagrant ssh -c 'cd /data/shop/development/current; ulimit -n 65535; vendor/bin/install -r development' || (cleanup; exit 1)
"""
}
}
}

stage('sleep') {
steps {
ansiColor('XTerm') {
sh """#!/bin/bash -x
for x in $(seq 0 9); do
echo ""
vagrant ssh -c 'ps axuf | grep php | grep -v grep | grep -v fpm'
echo "Sleeping for 1 minute to make sure that cronjobs are finished..."
sleep 60
done
"""
}
}
}

stage('test') {
steps {
Expand Down Expand Up @@ -140,6 +156,32 @@ pipeline {
}
}

stage('benchmark') {
steps {
ansiColor('XTerm') {
sh """#!/bin/bash -x
function cleanup {
vagrant destroy --force || true
vagrant box remove spryker-devvm-${params.box_version} || true
rm -rf Vagrantfile Vagrantfile.bak .vm .vagrant project
}
# Smoke tests
VM_IP=`ruby -e 'load ".vm"; puts VM_IP'`
echo ""
echo "###"
echo "### Performance benchmark"
echo "###"
echo ""
vagrant ssh -c 'cd /data/shop/development/current; patch -p0 < /vagrant/ci/smoke-test-linux/benchmark.patch && bash bin/benchmark || true'
"""
}
}
}

stage('cleanup') {
steps {
ansiColor('XTerm') {
Expand Down
Loading

0 comments on commit 99dc173

Please sign in to comment.