Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Commit 3f5ecb1

Browse files
committed
add checkout argument
1 parent 7172ef0 commit 3f5ecb1

File tree

5 files changed

+34
-10
lines changed

5 files changed

+34
-10
lines changed

etc/helm/requirements.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- name: redis
77
repository: "@stable"
88
version: "5.0"
9-
#- name: checkout
10-
# repository: http://localhost:10191
11-
# version: 0.1.0
12-
# condition: global.checkout.enabled
9+
- name: checkout
10+
repository: http://localhost:10191
11+
version: 0.1.0
12+
condition: global.checkout.enabled

etc/helm/values.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ global:
4545
nfs:
4646
enabled: true
4747

48-
checkout:
49-
enabled: false
5048
resources: {}
5149
# Uncomment the following
5250
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.

init_project.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ magento_ee_sample_data_dir="${magento_ce_dir}/magento2ee-sample-data"
2828
host_os="$(bash "${vagrant_dir}/scripts/host/get_host_os.sh")"
2929
use_nfs="$(bash "${vagrant_dir}/scripts/get_config_value.sh" "guest_use_nfs")"
3030
repository_url_ce="$(bash "${vagrant_dir}/scripts/get_config_value.sh" "repository_url_ce")"
31+
#repository_url_checkout="$(bash "${vagrant_dir}/scripts/get_config_value.sh" "repository_url_checkout")"
3132
repository_url_ee="$(bash "${vagrant_dir}/scripts/get_config_value.sh" "repository_url_ee")"
3233
composer_project_name="$(bash "${vagrant_dir}/scripts/get_config_value.sh" "composer_project_name")"
3334
composer_project_url="$(bash "${vagrant_dir}/scripts/get_config_value.sh" "composer_project_url")"
@@ -151,12 +152,14 @@ force_project_cleaning=0
151152
force_codebase_cleaning=0
152153
force_phpstorm_config_cleaning=0
153154
disable_nfs=0
154-
while getopts 'fcpd' flag; do
155+
enable_checkout=0
156+
while getopts 'fcpde' flag; do
155157
case "${flag}" in
156158
f) force_project_cleaning=1 ;;
157159
c) force_codebase_cleaning=1 ;;
158160
p) force_phpstorm_config_cleaning=1 ;;
159161
d) disable_nfs=1 ;;
162+
e) enable_checkout=1 ;;
160163
*) error "Unexpected option" && exit 1;;
161164
esac
162165
done
@@ -245,9 +248,17 @@ waitForKubernetesPodToRun 'tiller-deploy'
245248

246249
# TODO: change k-rebuild-environment to comply with formatting requirements
247250
if [[ "${disable_nfs}" == 1 ]]; then
248-
bash "${vagrant_dir}/scripts/host/k_rebuild_environment.sh" -d
251+
if [[ "${enable_checkout}" == 1 ]]; then
252+
bash "${vagrant_dir}/scripts/host/k_rebuild_environment.sh" -d -e
253+
else
254+
bash "${vagrant_dir}/scripts/host/k_rebuild_environment.sh" -d
255+
fi
249256
else
250-
bash "${vagrant_dir}/scripts/host/k_rebuild_environment.sh"
257+
if [[ "${enable_checkout}" == 1 ]]; then
258+
bash "${vagrant_dir}/scripts/host/k_rebuild_environment.sh" -e
259+
else
260+
bash "${vagrant_dir}/scripts/host/k_rebuild_environment.sh"
261+
fi
251262
fi
252263

253264
minikube_ip="$(minikube service magento2-monolith --url | grep -oE '[0-9][^:]+' | head -1)"

scripts/functions.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,12 @@ function getMagento2PodId()
194194
echo "$(kubectl get pods | grep -ohE 'magento2-monolith-[a-z0-9\-]+')"
195195
}
196196

197+
function getMagento2CheckoutPodId()
198+
{
199+
# TODO: Calculate based on current helm release
200+
echo "$(kubectl get pods | grep -ohE 'magento2-checkout-[a-z0-9\-]+')"
201+
}
202+
197203
function getRedisMasterPodId()
198204
{
199205
echo "$(kubectl get pods | grep -ohE 'magento2-redis-master-[a-z0-9\-]+')"
@@ -210,6 +216,12 @@ function executeInMagento2Container()
210216
kubectl exec "${magento2_pod_id}" --container monolith "$@" 2> >(logError)
211217
}
212218

219+
function executeInMagento2CheckoutContainer()
220+
{
221+
magento2_pod_id="$(getMagento2CheckoutPodId)"
222+
kubectl exec "${magento2_pod_id}" --container checkout "$@" 2> >(logError)
223+
}
224+
213225
function isMinikubeRunning() {
214226
minikube_status="$(minikube status | grep minikube: 2> >(log))"
215227
if [[ ${minikube_status} == "minikube: Running" ]]; then

scripts/host/k_rebuild_environment.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ set -e
2121
# TODO: Need to make sure all resources have been successfully deleted before the attempt of recreating them
2222
sleep 7
2323
enable_nfs="true"
24-
while getopts 'd' flag; do
24+
enable_checkout="false"
25+
while getopts 'de' flag; do
2526
case "${flag}" in
2627
d) enable_nfs="false" ;;
28+
e) enable_checkout="true" ;;
2729
*) error "Unexpected option" && exit 1;;
2830
esac
2931
done
@@ -32,6 +34,7 @@ cd "${vagrant_dir}/etc/helm" && helm install \
3234
--values values.yaml \
3335
--set global.monolith.volumeHostPath="${vagrant_dir}" \
3436
--set global.persistence.nfs.enabled="${enable_nfs}" \
37+
--set global.checkout.enabled="${enable_checkout}" \
3538
--set global.checkout.volumeHostPath="${vagrant_dir}" .
3639

3740
# TODO: Waiting for containers to initialize before proceeding

0 commit comments

Comments
 (0)