Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis cache is now cleared only once instead of at every container start #7

Merged
merged 1 commit into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Upgrade notes

## How to Upgrade

1. In `composer.json` upgrade `shopsys/deployment` to new version:
```diff
- "shopsys/deployment": "~1.9.0",
+ "shopsys/deployment": "~1.12.0",
```
2. Run `composer update shopsys/deployment`
3. Check files in mentioned pull requests and if you have any of them extended in your project, apply changes manually

## Upgrade from v2.0.1 to v2.1.0

- clear Redis cache only once instead of at every container start ([#7](https://github.com/shopsys/deployment/pull/7/files))
- phing target `clean-redis-storefront` is available from shopsys/framework v14.0.0
11 changes: 11 additions & 0 deletions deploy/parts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,17 @@ if [ ${ENABLE_AUTOSCALING} = true ]; then
runCommand "ERROR" "kubectl apply -f ${CONFIGURATION_TARGET_PATH}/horizontalStorefrontAutoscaler.yaml"
fi

RUNNING_WEBSERVER_PHP_FPM_POD=$(kubectl get pods --namespace=${PROJECT_NAME} --field-selector=status.phase=Running -l app=webserver-php-fpm -o=jsonpath='{.items[0].metadata.name}')

echo -n "Disable maintenance page "
runCommand "ERROR" "kubectl exec ${RUNNING_WEBSERVER_PHP_FPM_POD} --namespace=${PROJECT_NAME} -- ./phing maintenance-off"

echo -n "Clean old redis keys "
runCommand "FAILED" "kubectl exec ${RUNNING_WEBSERVER_PHP_FPM_POD} --namespace=${PROJECT_NAME} -- ./phing clean-redis-old"

echo -n "Clean storefront cache (queries and translations) "
runCommand "FAILED" "kubectl exec ${RUNNING_WEBSERVER_PHP_FPM_POD} --namespace=${PROJECT_NAME} -- ./phing clean-redis-storefront"

if [ -z ${DISABLE_WEBSITE_RUNNING_CHECK} ]; then
DISABLE_WEBSITE_RUNNING_CHECK=false
fi
Expand Down
3 changes: 0 additions & 3 deletions kubernetes/deployments/webserver-php-fpm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ spec:
imagePullPolicy: Always
workingDir: /var/www/html
lifecycle:
postStart:
exec:
command: ["/var/www/html/phing", "-S", "maintenance-off", "clean-redis-old"]
preStop:
exec:
command:
Expand Down