Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/1.13.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennelandais committed Aug 30, 2019
2 parents 06cd803 + d7f0770 commit de13947
Show file tree
Hide file tree
Showing 96 changed files with 5,193 additions and 1,500 deletions.
132 changes: 84 additions & 48 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ variables:
- sed -i -e "s/{HIPAY_API_USER_TEST_MOTO\}/$HIPAY_API_USER_RE7/" ./bin/docker/conf/test/hipay.env.sample
- sed -i -e "s/{HIPAY_API_PASSWORD_TEST_MOTO\}/$HIPAY_API_PASSWORD_RE7/" ./bin/docker/conf/test/hipay.env.sample
- sed -i -e "s/{HIPAY_SECRET_PASSPHRASE_TEST_MOTO\}/$HIPAY_SECRET_PASSPHRASE_RE7/" ./bin/docker/conf/test/hipay.env.sample
- sed -i -e "s@{PI_CI_DATA_URL\}@$PI_CI_DATA_URL@" ./bin/docker/conf/test/hipay.env.sample
- sh bin/docker/generate_dockerfile.sh

stages:
Expand All @@ -46,7 +47,6 @@ stages:
- package
- build
- deploy
- sync

#########################################################################
### PHP 7-1 ###
Expand Down Expand Up @@ -75,7 +75,7 @@ casperjs-part1-1:
paths:
- bin/tests/errors/
when: always
allow_failure: false
allow_failure: true
after_script:
- bash /tools/clean-job.sh $PROJECT_NAME_TEST docker-compose.test.yml magento ${DOCKER_STACK}-${DOCKER_SERVICE}_web:${CI_COMMIT_REF_SLUG}
except:
Expand All @@ -94,7 +94,7 @@ casperjs-part2-1:
paths:
- bin/tests/errors/
when: always
allow_failure: false
allow_failure: true
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
Expand All @@ -113,7 +113,7 @@ casperjs-part3-1:
paths:
- bin/tests/errors/
when: always
allow_failure: false
allow_failure: true
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
Expand All @@ -132,13 +132,28 @@ casperjs-part4-1:
paths:
- bin/tests/errors/
when: always
allow_failure: false
allow_failure: true
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
after_script:
- bash /tools/clean-job.sh $PROJECT_NAME_TEST-part4 docker-compose.test.yml magento ${DOCKER_STACK}-${DOCKER_SERVICE}_web:${CI_COMMIT_REF_SLUG}

test-cypress-5-1:
stage: test-php7
<<: *before_template
script:
- sh ./bin/gitlab/run-cypress-tests.sh $PROJECT_NAME_TEST-part5 docker-compose.test.yml
retry: 2
tags:
- pi-commerce-no-overlay
allow_failure: true
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
after_script:
- bash /tools/clean-job.sh $PROJECT_NAME_TEST-part5 docker-compose.test.yml magento ${DOCKER_STACK}-${DOCKER_SERVICE}_web:${CI_COMMIT_REF_SLUG}

#########################################################################
### PHP 5-6 ###
#########################################################################
Expand Down Expand Up @@ -166,7 +181,7 @@ casperjs-part1-2:
paths:
- bin/tests/errors/
when: always
allow_failure: false
allow_failure: true
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
Expand All @@ -185,7 +200,7 @@ casperjs-part2-2:
paths:
- bin/tests/errors/
when: always
allow_failure: false
allow_failure: true
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
Expand All @@ -204,7 +219,7 @@ casperjs-part3-2:
paths:
- bin/tests/errors/
when: always
allow_failure: false
allow_failure: true
after_script:
- bash /tools/clean-job.sh $PROJECT_NAME_TEST-part3 docker-compose.test-php5-6.yml magento ${DOCKER_STACK}-${DOCKER_SERVICE}_web:${CI_COMMIT_REF_SLUG}
except:
Expand All @@ -223,13 +238,28 @@ casperjs-part4-2:
paths:
- bin/tests/errors/
when: always
allow_failure: false
allow_failure: true
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
after_script:
- bash /tools/clean-job.sh $PROJECT_NAME_TEST-part4 docker-compose.test-php5-6.yml magento ${DOCKER_STACK}-${DOCKER_SERVICE}_web:${CI_COMMIT_REF_SLUG}

test-cypress-5-2:
stage: test-php5-6
<<: *before_template
script:
- sh ./bin/gitlab/run-cypress-tests.sh $PROJECT_NAME_TEST-part5 docker-compose.test.yml
retry: 2
tags:
- pi-commerce-no-overlay
allow_failure: true
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
after_script:
- bash /tools/clean-job.sh $PROJECT_NAME_TEST-part5 docker-compose.test.yml magento ${DOCKER_STACK}-${DOCKER_SERVICE}_web:${CI_COMMIT_REF_SLUG}

build-test-php-7-2:
stage: build-test-php7-2
script:
Expand Down Expand Up @@ -258,7 +288,7 @@ casperjs-part1-3:
paths:
- bin/tests/errors/
when: always
allow_failure: false
allow_failure: true
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
Expand All @@ -277,7 +307,7 @@ casperjs-part2-3:
paths:
- bin/tests/errors/
when: always
allow_failure: false
allow_failure: true
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
Expand All @@ -296,7 +326,7 @@ casperjs-part3-3:
paths:
- bin/tests/errors/
when: always
allow_failure: false
allow_failure: true
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
Expand All @@ -315,13 +345,28 @@ casperjs-part4-3:
paths:
- bin/tests/errors/
when: always
allow_failure: false
allow_failure: true
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
after_script:
- bash /tools/clean-job.sh $PROJECT_NAME_TEST-part4 docker-compose.test-php7-2.yml magento ${DOCKER_STACK}-${DOCKER_SERVICE}_web:${CI_COMMIT_REF_SLUG}

test-cypress-5-3:
stage: test-php7-2
<<: *before_template
script:
- sh ./bin/gitlab/run-cypress-tests.sh $PROJECT_NAME_TEST-part5 docker-compose.test.yml
retry: 2
tags:
- pi-commerce-no-overlay
allow_failure: true
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
after_script:
- bash /tools/clean-job.sh $PROJECT_NAME_TEST-part5 docker-compose.test.yml magento ${DOCKER_STACK}-${DOCKER_SERVICE}_web:${CI_COMMIT_REF_SLUG}

clean-stack-test:
stage: clean-stack
script:
Expand All @@ -334,31 +379,31 @@ clean-stack-test:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/

sonarqube:
stage: analysis
image: ciricihq/gitlab-sonar-scanner
variables:
SONAR_URL: http://172.17.0.1:19000
SONAR_ANALYSIS_MODE: preview
SONAR_TOKEN: $SONAR_LOGIN
script:
- /usr/bin/sonar-scanner-run.sh
retry: 2
tags:
- pi-commerce-no-overlay

sonarqube-reports:
stage: analysis
image: ciricihq/gitlab-sonar-scanner
variables:
SONAR_URL: http://172.17.0.1:19000
SONAR_ANALYSIS_MODE: "publish"
SONAR_TOKEN: $SONAR_LOGIN
script:
- unset CI_BUILD_REF && /usr/bin/sonar-scanner-run.sh
retry: 2
tags:
- pi-commerce-no-overlay
# sonarqube:
# stage: analysis
# image: ciricihq/gitlab-sonar-scanner
# variables:
# SONAR_URL: http://172.17.0.1:19000
# SONAR_ANALYSIS_MODE: preview
# SONAR_TOKEN: $SONAR_LOGIN
# script:
# - /usr/bin/sonar-scanner-run.sh
# retry: 2
# tags:
# - pi-commerce-no-overlay
#
# sonarqube-reports:
# stage: analysis
# image: ciricihq/gitlab-sonar-scanner
# variables:
# SONAR_URL: http://172.17.0.1:19000
# SONAR_ANALYSIS_MODE: "publish"
# SONAR_TOKEN: $SONAR_LOGIN
# script:
# - unset CI_BUILD_REF && /usr/bin/sonar-scanner-run.sh
# retry: 2
# tags:
# - pi-commerce-no-overlay

package:
stage: package
Expand Down Expand Up @@ -402,6 +447,7 @@ deploy2Recette:
- sed -i -e "s/{HIPAY_API_USER_TEST_MOTO\}/$HIPAY_API_USER_TEST/" ./bin/docker/conf/acceptance/hipay.env.sample
- sed -i -e "s/{HIPAY_API_PASSWORD_TEST_MOTO\}/$HIPAY_API_PASSWORD_TEST/" ./bin/docker/conf/acceptance/hipay.env.sample
- sed -i -e "s/{HIPAY_SECRET_PASSPHRASE_TEST_MOTO\}/$HIPAY_SECRET_PASSPHRASE_TEST/" ./bin/docker/conf/acceptance/hipay.env.sample
- sed -i -e "s@{PI_CI_DATA_URL\}@$PI_CI_DATA_URL@" ./bin/docker/conf/acceptance/hipay.env.sample
- sed -i -e "s|\${DOCKER_STACK}|$DOCKER_STACK|g" docker-compose.acceptance.yml
- sed -i -e "s|\${DOCKER_SERVICE}|$DOCKER_SERVICE|g" docker-compose.acceptance.yml
- sed -i -e "s|\${CI_COMMIT_REF_SLUG}|$CI_COMMIT_REF_SLUG|g" docker-compose.acceptance.yml
Expand Down Expand Up @@ -435,13 +481,3 @@ stop_review:
environment:
name: review/${CI_COMMIT_REF_SLUG}
action: stop

sync:
stage: sync
tags:
- pi-commerce-no-overlay
script:
- git clone --mirror https://$GITLAB_USER:$GITLAB_PASSWORD@gitlab.hipay.org/pi-ecommerce/hipay-fullservice-sdk-magento1.git
- cd hipay-fullservice-sdk-magento1.git
- git push --mirror https://$GITHUB_USER:$GITHUB_PASSWORD@github.com/hipay/hipay-fullservice-sdk-magento1.git
allow_failure: true
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Version 1.13.0
- Added DSP2 handling
- Add update notification when a new version of the module is available
- Fix : Frequency not taken into account when calculating split payment

# Version 1.12.2
- Update payment method configuration form

Expand Down
7 changes: 6 additions & 1 deletion bin/docker/conf/acceptance/hipay.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ ACTIVE_METHODS=
#====================================================
# Conf for debugging
#=====================================================
XDEBUG_CONFIG=
XDEBUG_CONFIG=

#====================================================
# Configuration PI DATA URL
#=====================================================
PI_DATA_URL={PI_CI_DATA_URL}
5 changes: 5 additions & 0 deletions bin/docker/conf/development/hipay.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ ACTIVE_METHODS=hipay_cc,hipay_hosted
# Conf for debugging ( Fill with "remote_host=YOUR_IP")
#=====================================================
XDEBUG_CONFIG=remote_host=172.16.44.35

#====================================================
# Configuration PI DATA URL
#=====================================================
PI_DATA_URL=
4 changes: 4 additions & 0 deletions bin/docker/conf/test/hipay.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ ACTIVE_METHODS=
#=====================================================
XDEBUG_CONFIG=

#====================================================
# Configuration PI DATA URL
#=====================================================
PI_DATA_URL={PI_CI_DATA_URL}
21 changes: 21 additions & 0 deletions bin/docker/images/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ printf "\n${COLOR_SUCCESS} ======================================= ${NC}\n"
printf "\n${COLOR_SUCCESS} Install PHP SDK ${NC}\n"
printf "\n${COLOR_SUCCESS} ======================================= ${NC}\n"
cd /var/www/htdocs/lib/Hipay/

cp composer.json composer.json.bak
cat composer.json.bak | python -c "import sys, json; composerObj=json.load(sys.stdin); composerObj['scripts'] = {'post-install-cmd': ['@managePiDataURLDev'], 'post-update-cmd': ['@managePiDataURLDev'], 'managePiDataURLDev': [\"sed -i 's@https://stage-data.hipay.com@"$PI_DATA_URL"@g' hipay-fullservice-sdk-php/hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice/HTTP/Configuration/Configuration.php\", \"sed -i 's@https://data.hipay.com@"$PI_DATA_URL"@g' hipay-fullservice-sdk-php/hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice/HTTP/Configuration/Configuration.php\"]}; print json.dumps(composerObj, False, True, True, True, None, 2);" > composer.json
rm composer.json.bak

composer install
cd /tmp

Expand Down Expand Up @@ -216,8 +221,24 @@ else
printf "\n${COLOR_SUCCESS} => MAGENTO IS ALREADY INSTALLED IN THE CONTAINER ${NC}\n"
fi

if [ "$ENVIRONMENT" = "$ENV_DEVELOPMENT" ] || [ "$ENVIRONMENT" = "$ENV_STAGE" ] ;then

printf "\n${COLOR_SUCCESS} ======================================= ${NC}\n"
printf "\n${COLOR_SUCCESS} Apply htaccess for logs ${NC}\n"
printf "\n${COLOR_SUCCESS} ======================================= ${NC}\n"

echo -e "Order deny,allow\nAllow from all" > /var/www/htdocs/var/.htaccess
fi

chown -R www-data:www-data /var/www/htdocs

printf "\n${COLOR_SUCCESS} ======================================= ${NC}\n"
printf "\n${COLOR_SUCCESS} HOSTS CONGIGURATION ${NC}\n"
printf "\n${COLOR_SUCCESS} ======================================= ${NC}\n"
cp /etc/hosts ~/hosts.bak
sed -i 's/^127\.0\.0\.1\s*localhost/127.0.0.1 localhost data.hipay.com stage-data.hipay.com/g' ~/hosts.bak
cp ~/hosts.bak /etc/hosts

################################################################################
# IF CONTAINER IS KILLED, REMOVE PID
################################################################################
Expand Down
2 changes: 1 addition & 1 deletion bin/docker/images/php7-1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:7.1-apache
FROM php:7.1-apache-stretch

ENV PHP_VERSION=7.1

Expand Down
10 changes: 10 additions & 0 deletions bin/gitlab/run-cypress-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e

docker-compose -p $1 -f $2 up -d
sleep 250
docker-compose -p $1 -f $2 logs
curl --retry 3 --retry-delay 20 -v http://${DOCKER_SERVICE}-${CI_JOB_ID}-web
cd bin/tests/tests-cypress
yarn install
bash /tools/run-cypress-test.sh -f $TESTS_FOLDERS_1 --config baseUrl=http://${DOCKER_SERVICE}-${CI_JOB_ID}-web/ --env $CYPRESS_ENV
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
casper.test.begin('Test Notification on Magento', function (test) {
phantom.clearCookies();

casper.start(baseURL)
.then(function () {
if (this.visible('p[class="bugs"]')) {
test.done();
}
})
.thenOpen(baseURL + "admin/", function () {
this.logToBackend();
})
.then(function () {
test.assertExists('div.notification-global', 'Notification is found');
this.click("li.level0:nth-child(9) > ul:nth-child(2) > li:nth-child(2) > a:nth-child(1)");
})
.then(function (){
test.assertExists('a[href^="https://github.com/hipay/hipay-fullservice-sdk-magento1/releases/tag/"]', 'Full notification is found');
this.click('a.link-logout');
})
.then(function () {
this.logToBackend();
})
.then(function () {
test.assertExists('#message-popup-window', 'Notification popup is found');
test.assertMatch(this.fetchText('p.message-text'), /HiPay enterprise .* available!/, 'Notification message is OK');
})
.run(function () {
test.done();
});
});
Loading

0 comments on commit de13947

Please sign in to comment.