Commit 250dbbc5 authored by Stavros-Anastasios Charismiadis's avatar Stavros-Anastasios Charismiadis
Browse files

add username argument in the additional scripts

parent 36bb58bc
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@ GET /hello
## Getting started
To deploy the service, run the following command in an Ubuntu or MacOS terminal.
```
    cd dummy-aef
    chmod +x start_dummy_api.sh
    ./start_dummy_api.sh <Username provided by organizers>
```
The above command will deploy a docker container with the name or username inserted
@@ -30,7 +32,7 @@ First fill the fields starting with <> with the correct information and then cop

To check the logs, run the following command.
```
 ./logs_dummy_api.sh 
 ./logs_dummy_api.sh <Username provided by organizers>
```

To stop the service, run the following command.
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ app.logger.setLevel(logging.INFO)
@app.route("/hello", methods=["GET"])
def hello():
    # return f"Hello {app_name}"
    # Flask intenta parsear el token automáticamente
    # Flask attempts to parse the token automatically
    token = request.authorization.token if request.authorization else None
    app.logger.info(f"JWT detected: {token}")
    return jsonify(f"Hello, {app_name}!")
+6 −1
Original line number Diff line number Diff line
#!/bin/bash

echo "Stop dummy service for user: $1"
if [ $# -ne 1 ]; then
    echo "Usage: $0 <your_username>"
    exit 1
fi

echo "Logs of dummy service for user: $1"

APP_NAME=$1 docker compose logs -f
+1 −3
Original line number Diff line number Diff line
#!/bin/bash

if [ $# -ne 1 ]; then
    echo "Usage: $0 <your_name>"
    echo "Usage: $0 <your_username>"
    exit 1
fi

echo "Create dummy service for user: $1"
# docker build -t flask-hello-service .
# docker run -it --rm --name "$1" -p 8000:8000 -e APP_NAME=$1 flask-hello-service

APP_NAME=$1 docker compose up --detach --build --force-recreate
+5 −0
Original line number Diff line number Diff line
#!/bin/bash

if [ $# -ne 1 ]; then
    echo "Usage: $0 <your_username>"
    exit 1
fi

echo "Stop dummy service for user: $1"

APP_NAME=$1 docker compose down