-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathazure-pipelines.yml
74 lines (62 loc) · 3.16 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# PHP
# Test and package your PHP project.
# Add steps that run tests, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/php
trigger:
- master
variables:
TOKEN_PRIVATE: $(MAGENTO_TOKEN_PRIVATE)
pool:
vmImage: ubuntu-latest
strategy:
matrix:
'php 8.1 communtity 2.4.6':
phpVersion: 8.1
magentoVersion: community-edition=2.4.6
'php 8.2 communtity 2.4.6':
phpVersion: 8.2
magentoVersion: community-edition=2.4.6
steps:
- script: |
sudo update-alternatives --set php /usr/bin/php$(phpVersion)
sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)
sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)
sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
php -version
displayName: 'Use PHP version $(phpVersion)'
- script: |
sudo systemctl start mysql.service
sudo mysql -u root -proot -e 'create database magento_integration_tests;'
mysql --version
displayName: 'MySQL Version'
- script: |
docker pull docker.elastic.co/elasticsearch/elasticsearch:7.17.14
docker run -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.17.14 &
displayName: 'Elasticsearch'
- script: cp -r $(Build.SourcesDirectory) ../magento2-tweakwise
displayName: 'Copy checkout'
- script: composer config $1 --auth http-basic.repo.magento.com $(MAGENTO_TOKEN_PUBLIC) $(TOKEN_PRIVATE)
displayName: 'Set git token'
- script: composer create-project --repository-url=https://repo.magento.com/ magento/project-$(magentoVersion) ./magento2
displayName: 'Create new magento install'
- script: |
cd ./magento2
php bin/magento setup:install --no-interaction --base-url=http://localhost --db-host=localhost --db-name=magento_integration_tests --db-user=$(DB_USER) --db-password=$(DB_PASSWORD) --admin-firstname=admin --admin-lastname=admin [email protected] --admin-user=admin --admin-password=admin123 --language=en_US --currency=EUR --search-engine=elasticsearch7 --timezone=Europe/Amsterdam --use-rewrites=1
composer config $1 --auth http-basic.repo.magento.com $(MAGENTO_TOKEN_PUBLIC) $(TOKEN_PRIVATE)
composer require tweakwise/magento2-tweakwise
composer require tweakwise/magento2-tweakwise-export:dev-master
#overwrite tweakwise module with checkout version
rm -Rf ./vendor/tweakwise/magento2-tweakwise
cp -r $(Build.SourcesDirectory)/../magento2-tweakwise ./vendor/tweakwise/magento2-tweakwise
php bin/magento module:enable Tweakwise_Magento2TweakwiseExport
# Install package dev dependencies. Unfortunately I do not have a generic way to do this yet
composer require fzaninotto/faker --no-interaction
php bin/magento setup:upgrade --no-interaction
displayName: 'Configure magento'
- script: |
cd ./magento2
cp vendor/tweakwise/magento2-tweakwise/Test/setup/install-config-mysql.php dev/tests/integration/etc/
cd dev/tests/integration
../../../vendor/bin/phpunit ../../../vendor/tweakwise/magento2-tweakwise-export
displayName: 'Run export tests'