Skip to content

Commit

Permalink
Updated gitlab-ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
d1ff1cult0 committed Nov 4, 2024
1 parent 9459161 commit 8494978
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
8 changes: 6 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ variables:
COMPOSER_HOME: $CI_PROJECT_DIR/.composer
NO_PROXY: "gitlab.vtk.be"


build:
stage: build
before_script:
- export PATH="/usr/bin/php7.4:$PATH"
- php -v
script:
- composer update --no-dev
- composer install --no-dev
Expand All @@ -28,9 +30,12 @@ build:
.deploy: &deploy
stage: deploy
before_script:
- export PATH="/usr/bin/php7.4:$PATH"
- php -v
- eval $(ssh-agent -s)
- ssh-add <(echo $SSH_PRIVATE_KEY | base64 -d)
script:
- export SENTRY_LOG_LEVEL=debug
- scp -o StrictHostKeyChecking=no litus.tar.gz root@$SSH_HOSTNAME:/tmp
- ssh -o StrictHostKeyChecking=no root@$SSH_HOSTNAME /usr/local/sbin/deploy.sh
only:
Expand All @@ -54,4 +59,3 @@ deploy_liv:
environment:
name: liv
url: https://vtk.be

14 changes: 9 additions & 5 deletions module/ShopBundle/Controller/ShopController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function reserveproductsAction()
);
}

if(!$this->saleSessionIsOpen()){
if (!$this->saleSessionIsOpen()){
$this->flashMessenger()->error(
'Error',
'No session was found!'
Expand Down Expand Up @@ -555,12 +555,16 @@ private function getStockEntries($salesSession)
);
}

private function saleSessionIsOpen(){
private function saleSessionIsOpen()
{
$salesSessionId = $this->getSalesSessionEntity()->getId();
$openSaleSessions = $this->getSalesSessions();
$openSaleSessionsIds = array_map(function($session) {
return $session->getId();
}, $openSaleSessions);
$openSaleSessionsIds = array_map(
function ($session) {
return $session->getId();
},
$openSaleSessions
);

return in_array($salesSessionId, $openSaleSessionsIds);
}
Expand Down

0 comments on commit 8494978

Please sign in to comment.