11name : " Magento 2 installation with DDEV"
22author : " Julien Loizelet"
3- description : " A Github Action for installing Magento 2 with DDEV"
3+ description : " A GitHub Action for installing Magento 2 with DDEV"
44
55inputs :
66
77 php_version :
88 type : string
99 required : false
10- default : " 8.2 "
10+ default : " 8.3 "
1111 description : " PHP Version to use"
1212
1313 database :
@@ -25,7 +25,7 @@ inputs:
2525 magento_version :
2626 type : string
2727 required : false
28- default : " 2.4.7 "
28+ default : " 2.4.8 "
2929 description : " The Magento release version to install"
3030
3131 magento_repository :
@@ -102,11 +102,15 @@ runs:
102102
103103 - name : Install DDEV tools add-on
104104 shell : bash
105- run : ddev get julienloizelet/ddev-tools
105+ run : ddev add-on get julienloizelet/ddev-tools
106106
107- - name : Prepare Elastic search
107+ - name : Prepare Elasticsearch
108108 shell : bash
109- run : ddev get ddev/ddev-elasticsearch
109+ run : ddev add-on get ddev/ddev-elasticsearch
110+
111+ - name : Prepare OpenSearch
112+ shell : bash
113+ run : ddev add-on get ddev/ddev-opensearch
110114
111115 - name : Set Magento 2 settings
112116 shell : bash
@@ -122,15 +126,22 @@ runs:
122126 mkdir -p .ddev/homeadditions/.composer
123127 echo "$composer_auth" > .ddev/homeadditions/.composer/auth.json
124128
125- - name : Set ELASTIC_INSTALL_STRING env for 2.4
129+ - name : Set SEARCH_ENGINE_STRING env
126130 shell : bash
127131 if : startsWith(inputs.magento_version, '2.4')
128- run : echo "ELASTIC_INSTALL_STRING=--elasticsearch-host=elasticsearch --search-engine=elasticsearch7" >> $GITHUB_ENV
132+ run : |
133+ magento_version="${{ inputs.magento_version }}"
134+ # Check if the version is 2.4.8 or higher
135+ if [[ "$(printf '%s\n' "$magento_version" "2.4.8" | sort -V | head -n1)" == "2.4.8" ]]; then
136+ echo "SEARCH_ENGINE_STRING=--opensearch-host=opensearch --search-engine=opensearch" >> $GITHUB_ENV
137+ else
138+ echo "SEARCH_ENGINE_STRING=--elasticsearch-host=elasticsearch --search-engine=elasticsearch7" >> $GITHUB_ENV
139+ fi
129140
130- - name : Set ELASTIC_INSTALL_STRING env for 2.3
141+ - name : Set SEARCH_ENGINE_STRING env for 2.3
131142 shell : bash
132143 if : startsWith(inputs.magento_version, '2.3')
133- run : echo "ELASTIC_INSTALL_STRING =" >> $GITHUB_ENV
144+ run : echo "SEARCH_ENGINE_STRING =" >> $GITHUB_ENV
134145
135146 - name : Handle PHP version
136147 shell : bash
@@ -230,7 +241,7 @@ runs:
230241 --currency=USD \
231242 --timezone=America/Chicago \
232243 --use-rewrites=1 \
233- ${{ env.ELASTIC_INSTALL_STRING }}
244+ ${{ env.SEARCH_ENGINE_STRING }}
234245
235246outputs :
236247 m2_url :
0 commit comments