Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 5c94953

Browse files
Ajustes para inclusão de variavel de projeto para scripts
1 parent add3641 commit 5c94953

File tree

9 files changed

+78
-34
lines changed

9 files changed

+78
-34
lines changed

examples/lambda_api/.projectrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ PROJECT_NAME=template-serverless-lambda-python-lambda-api
22
NETWORK_NAME=service-python
33
APP_QUEUE=test-queue
44
APP_LAMBDA_NAME=lambda_api
5-
APP_LAMBDA_EVENT_SOURCE=false
5+
APP_LAMBDA_EVENT_SOURCE=false
6+
APP_PORT=5001
Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
python3 -m venv venv
22
source ./venv/bin/activate
33

4-
if [ "$1" = "--port" ]
5-
then
4+
if test -f .projectrc; then
5+
source .projectrc
6+
elif test -f ./scripts/.projectrc; then
7+
source ./scripts/.projectrc
8+
fi
9+
10+
if [ "$1" = "--port" ]; then
611
PORT=$2
712
fi
8-
if [ -z "$PORT" ]
9-
then
10-
PORT=5000
13+
if [ -z "$PORT" ]; then
14+
if [ -z "$APP_PORT" ]; then
15+
PORT=5000
16+
else
17+
PORT=$APP_PORT
18+
fi
1119
fi
1220

21+
echo "app port: $PORT"
1322
export FLASK_ENV=development
1423
export FLASK_APP=app.py
15-
#export FLASK_DEBUG=1
16-
flask run $1 $2
24+
# export FLASK_DEBUG=1
25+
# flask run $1 $2
26+
flask run --host=0.0.0.0 --port=$PORT

examples/lambda_api_restful/.projectrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ PROJECT_NAME=template-serverless-lambda-python-lambda-api-restful
22
NETWORK_NAME=service-python
33
APP_QUEUE=test-queue
44
APP_LAMBDA_NAME=lambda_api_restful
5-
APP_LAMBDA_EVENT_SOURCE=false
5+
APP_LAMBDA_EVENT_SOURCE=false
6+
APP_PORT=5001

examples/lambda_api_restful/public/swagger/openapi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,6 @@ paths:
178178
/v1/product/{uuid}: {}
179179
servers:
180180
- description: Development server
181-
url: http://localhost:5000
181+
url: http://localhost:5001
182182
- description: Development server
183-
url: http://localhost:5000
183+
url: http://localhost:5001
Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
python3 -m venv venv
22
source ./venv/bin/activate
33

4-
if [ "$1" = "--port" ]
5-
then
4+
if test -f .projectrc; then
5+
source .projectrc
6+
elif test -f ./scripts/.projectrc; then
7+
source ./scripts/.projectrc
8+
fi
9+
10+
if [ "$1" = "--port" ]; then
611
PORT=$2
712
fi
8-
if [ -z "$PORT" ]
9-
then
10-
PORT=5000
13+
if [ -z "$PORT" ]; then
14+
if [ -z "$APP_PORT" ]; then
15+
PORT=5000
16+
else
17+
PORT=$APP_PORT
18+
fi
1119
fi
1220

21+
echo "app port: $PORT"
1322
export FLASK_ENV=development
1423
export FLASK_APP=app.py
15-
#export FLASK_DEBUG=1
16-
flask run $1 $2
24+
# export FLASK_DEBUG=1
25+
# flask run $1 $2
26+
flask run --host=0.0.0.0 --port=$PORT

examples/lambda_sqs/.projectrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ PROJECT_NAME=template-serverless-lambda-python-lambda-sqs
22
NETWORK_NAME=service-python
33
APP_QUEUE=test-queue
44
APP_LAMBDA_NAME=lambda_sqs
5-
APP_LAMBDA_EVENT_SOURCE=true
5+
APP_LAMBDA_EVENT_SOURCE=true
6+
APP_PORT=5000
Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
python3 -m venv venv
22
source ./venv/bin/activate
33

4-
if [ "$1" = "--port" ]
5-
then
4+
if test -f .projectrc; then
5+
source .projectrc
6+
elif test -f ./scripts/.projectrc; then
7+
source ./scripts/.projectrc
8+
fi
9+
10+
if [ "$1" = "--port" ]; then
611
PORT=$2
712
fi
8-
if [ -z "$PORT" ]
9-
then
10-
PORT=5000
13+
if [ -z "$PORT" ]; then
14+
if [ -z "$APP_PORT" ]; then
15+
PORT=5000
16+
else
17+
PORT=$APP_PORT
18+
fi
1119
fi
1220

21+
echo "app port: $PORT"
1322
export FLASK_ENV=development
1423
export FLASK_APP=app.py
15-
#export FLASK_DEBUG=1
16-
flask run $1 $2
24+
# export FLASK_DEBUG=1
25+
# flask run $1 $2
26+
flask run --host=0.0.0.0 --port=$PORT

examples/lambda_sqs_light/.projectrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ PROJECT_NAME=template-serverless-lambda-python-lambda-sqs-light
22
NETWORK_NAME=service-python
33
APP_QUEUE=test-queue
44
APP_LAMBDA_NAME=lambda_sqs_light
5-
APP_LAMBDA_EVENT_SOURCE=true
5+
APP_LAMBDA_EVENT_SOURCE=true
6+
APP_PORT=5000
Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
python3 -m venv venv
22
source ./venv/bin/activate
33

4-
if [ "$1" = "--port" ]
5-
then
4+
if test -f .projectrc; then
5+
source .projectrc
6+
elif test -f ./scripts/.projectrc; then
7+
source ./scripts/.projectrc
8+
fi
9+
10+
if [ "$1" = "--port" ]; then
611
PORT=$2
712
fi
8-
if [ -z "$PORT" ]
9-
then
10-
PORT=5000
13+
if [ -z "$PORT" ]; then
14+
if [ -z "$APP_PORT" ]; then
15+
PORT=5000
16+
else
17+
PORT=$APP_PORT
18+
fi
1119
fi
1220

21+
echo "app port: $PORT"
1322
export FLASK_ENV=development
1423
export FLASK_APP=app.py
15-
#export FLASK_DEBUG=1
16-
flask run $1 $2
24+
# export FLASK_DEBUG=1
25+
# flask run $1 $2
26+
flask run --host=0.0.0.0 --port=$PORT

0 commit comments

Comments
 (0)