From ef4932231afcba7a46fcdc8ae124011ab283b4f3 Mon Sep 17 00:00:00 2001 From: schnarkus <markus.simianer@yahoo.de> Date: Thu, 29 Aug 2024 13:18:25 +0200 Subject: [PATCH] use redis inside the dev container --- local-environment/redis.sh | 24 ------------------------ local-environment/setup-local.sh | 8 +++++++- 2 files changed, 7 insertions(+), 25 deletions(-) delete mode 100755 local-environment/redis.sh diff --git a/local-environment/redis.sh b/local-environment/redis.sh deleted file mode 100755 index 22850e6..0000000 --- a/local-environment/redis.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -REDIS_CONTAINER_NAME="redis_container" -REDIS_PORT="6379" - -# Stop and remove old Redis container -podman stop $REDIS_CONTAINER_NAME -podman rm -f $REDIS_CONTAINER_NAME - -# Pull Redis images -podman pull redis -podman pull redis-server - -# Run Redis container with persistent storage -podman run -d \ - -p $REDIS_PORT:$REDIS_PORT \ - --name $REDIS_CONTAINER_NAME \ - redis redis-server --save 60 1 --loglevel warning - -echo "Redis setup complete..." - -#curl -X PUT --header 'Content-Type: text/plain; charset=utf-8' --data 'foo' http://localhost:8080/state/bar -#podman exec -it redis_container redis-cli -#KEYS * \ No newline at end of file diff --git a/local-environment/setup-local.sh b/local-environment/setup-local.sh index 51b5455..6e987f1 100755 --- a/local-environment/setup-local.sh +++ b/local-environment/setup-local.sh @@ -46,4 +46,10 @@ podman exec -it $CONTAINER_NAME curl -k https://$DOMAIN_NAME:$CONTAINER_HTTPS_PO echo "Testing from outside..." sudo bash -c "echo '127.0.0.1 webservice.local' >> /etc/hosts" -curl -k https://$DOMAIN_NAME:$CONTAINER_HTTPS_PORT/ \ No newline at end of file +curl -k https://$DOMAIN_NAME:$CONTAINER_HTTPS_PORT/ + +echo "Testing Redis..." +curl -k -X PUT --header 'Content-Type: text/plain; charset=utf-8' --data 'foo' https://$DOMAIN_NAME:$CONTAINER_HTTPS_PORT/state/bar + +# Check the value in the database +podman exec -it $CONTAINER_NAME redis-cli KEYS '*' \ No newline at end of file -- GitLab