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

Commit c9eb58f

Browse files
Merge pull request #19 from madeiramadeirabr/feat/improvements_examples
Feat/improvements examples
2 parents 34958f3 + 3f3bd4a commit c9eb58f

File tree

707 files changed

+19437
-6453
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

707 files changed

+19437
-6453
lines changed

.github/workflows/build.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- production
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
jobs:
9+
sonarcloud:
10+
name: SonarCloud
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
16+
- name: SonarCloud Scan
17+
uses: SonarSource/sonarcloud-github-action@master
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
20+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/pylint.yml renamed to .github/workflows/lambda_api_pylint.yml

+41-23
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,60 @@ name: Execute the pylint analysis
1313
# push: # Triggers on each pushed commit
1414
# branches:
1515
# - 'master'
16-
on: [push]
16+
on: [ push ]
1717

1818
jobs:
1919
setup-environment:
20-
name: Setup deployment environment (Ubuntu 18.04 - Python 3.x)
20+
name: Lambda API - Setup deployment environment (Ubuntu 18.04 - Python 3.x)
2121
runs-on: ubuntu-18.04
2222
strategy:
2323
matrix:
24-
python-version: [ "3.8", "3.9" ]
24+
# python-version: [ "3.8", "3.9" ]
25+
python-version: [ "3.8" ]
2526
steps:
2627
- uses: actions/checkout@v2
2728
- name: Set up Python ${{ matrix.python-version }}
2829
uses: actions/setup-python@v2
2930
with:
3031
python-version: ${{ matrix.python-version }}
3132
architecture: x64
32-
pylint:
33+
setup-project:
34+
name: Lambda API - Setup project (Ubuntu 18.04 - Python 3.x)
3335
runs-on: ubuntu-18.04
36+
strategy:
37+
matrix:
38+
python-version: [ "3.8" ]
3439
needs: setup-environment
3540
steps:
36-
- uses: actions/checkout@v2
37-
- name: Install pylint
38-
run: |
39-
python -m pip install --upgrade pip
40-
pip install pylint
41-
# todo: futuramente separar em mais passos (um para cada pasta)
42-
- name: Execute pylint
43-
run: |
44-
source ./scripts/variables.sh
45-
ROOT_DIR=$(pwd)/
46-
for example_path in "${arr[@]}"
47-
do
48-
echo "Pylint in ${example_path} ..."
49-
# change dir to enable the pylint to find the modules of the app
50-
cd ${example_path}
51-
echo "Current dir is..."
52-
echo $(pwd)
53-
pylint --rcfile ${ROOT_DIR}.pylintrc ./app.py ./lambda_app
54-
done
41+
- uses: actions/checkout@v2
42+
- name: Set up Python ${{ matrix.python-version }}
43+
uses: actions/setup-python@v2
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
architecture: x64
47+
- name: Set up requirements ${{ matrix.python-version }}
48+
run: |
49+
python -m pip install --upgrade pip
50+
python -m pip install -r ./examples/lambda_api/requirements.txt -t .
51+
python -m pip install -r ./examples/lambda_api/requirements-vendor.txt -t .
52+
pylint:
53+
name: Lambda API - Setup pylint (Ubuntu 18.04)
54+
runs-on: ubuntu-18.04
55+
strategy:
56+
matrix:
57+
python-version: [ "3.8" ]
58+
needs: setup-project
59+
steps:
60+
- uses: actions/checkout@v2
61+
- name: Set up Python ${{ matrix.python-version }}
62+
uses: actions/setup-python@v2
63+
with:
64+
python-version: ${{ matrix.python-version }}
65+
architecture: x64
66+
- name: Install pylint
67+
run: |
68+
pip install pylint
69+
- name: Execute pylint
70+
run: |
71+
cd ./examples/lambda_api
72+
./scripts/pylint.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Summary:
2+
# Execute the pylint analysis on code
3+
# Read here for mode info: https://pylint.pycqa.org/en/latest/ and https://www.python.org/dev/peps/pep-0008/
4+
5+
name: Execute the pylint analysis
6+
7+
#on:
8+
# # There are several ways to trigger Github actions - See https://help.github.com/en/actions/reference/events-that-trigger-workflows#example-using-a-single-event for a comprehensive list:
9+
# # - "push": Triggers each time a commit is pushed
10+
# # - "pull_request": Triggers each time a commit is pushed within a pull request, it makes it much easier to write comments within the PR, but it suffers some strong limitations:
11+
# # - There is no way to trigger when a PR is merged into another - See https://github.community/t/pull-request-action-does-not-run-on-merge/16092?u=vadorequest
12+
# # - It won't trigger when the PR is conflicting with its base branch - See https://github.community/t/run-actions-on-pull-requests-with-merge-conflicts/17104/2?u=vadorequest
13+
# push: # Triggers on each pushed commit
14+
# branches:
15+
# - 'master'
16+
on: [ push ]
17+
18+
jobs:
19+
setup-environment:
20+
name: Lambda API RESTful - Setup deployment environment (Ubuntu 18.04 - Python 3.x)
21+
runs-on: ubuntu-18.04
22+
strategy:
23+
matrix:
24+
# python-version: [ "3.8", "3.9" ]
25+
python-version: [ "3.8" ]
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v2
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
architecture: x64
33+
setup-project:
34+
name: Lambda API RESTful - Setup project (Ubuntu 18.04 - Python 3.x)
35+
runs-on: ubuntu-18.04
36+
strategy:
37+
matrix:
38+
python-version: [ "3.8" ]
39+
needs: setup-environment
40+
steps:
41+
- uses: actions/checkout@v2
42+
- name: Set up Python ${{ matrix.python-version }}
43+
uses: actions/setup-python@v2
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
architecture: x64
47+
- name: Set up requirements ${{ matrix.python-version }}
48+
run: |
49+
python -m pip install --upgrade pip
50+
python -m pip install -r ./examples/lambda_api_restful/requirements.txt -t .
51+
python -m pip install -r ./examples/lambda_api_restful/requirements-vendor.txt -t .
52+
pylint:
53+
name: Lambda API RESTful - Setup pylint (Ubuntu 18.04)
54+
runs-on: ubuntu-18.04
55+
strategy:
56+
matrix:
57+
python-version: [ "3.8" ]
58+
needs: setup-project
59+
steps:
60+
- uses: actions/checkout@v2
61+
- name: Set up Python ${{ matrix.python-version }}
62+
uses: actions/setup-python@v2
63+
with:
64+
python-version: ${{ matrix.python-version }}
65+
architecture: x64
66+
- name: Install pylint
67+
run: |
68+
pip install pylint
69+
- name: Execute pylint
70+
run: |
71+
cd ./examples/lambda_api_restful
72+
./scripts/pylint.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Summary:
2+
# Execute the pylint analysis on code
3+
# Read here for mode info: https://pylint.pycqa.org/en/latest/ and https://www.python.org/dev/peps/pep-0008/
4+
5+
name: Execute the pylint analysis
6+
7+
#on:
8+
# # There are several ways to trigger Github actions - See https://help.github.com/en/actions/reference/events-that-trigger-workflows#example-using-a-single-event for a comprehensive list:
9+
# # - "push": Triggers each time a commit is pushed
10+
# # - "pull_request": Triggers each time a commit is pushed within a pull request, it makes it much easier to write comments within the PR, but it suffers some strong limitations:
11+
# # - There is no way to trigger when a PR is merged into another - See https://github.community/t/pull-request-action-does-not-run-on-merge/16092?u=vadorequest
12+
# # - It won't trigger when the PR is conflicting with its base branch - See https://github.community/t/run-actions-on-pull-requests-with-merge-conflicts/17104/2?u=vadorequest
13+
# push: # Triggers on each pushed commit
14+
# branches:
15+
# - 'master'
16+
on: [ push ]
17+
18+
jobs:
19+
setup-environment:
20+
name: Lambda SQS Light - Setup deployment environment (Ubuntu 18.04 - Python 3.x)
21+
runs-on: ubuntu-18.04
22+
strategy:
23+
matrix:
24+
# python-version: [ "3.8", "3.9" ]
25+
python-version: [ "3.8" ]
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v2
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
architecture: x64
33+
setup-project:
34+
name: Lambda SQS Light - Setup project (Ubuntu 18.04 - Python 3.x)
35+
runs-on: ubuntu-18.04
36+
strategy:
37+
matrix:
38+
python-version: [ "3.8" ]
39+
needs: setup-environment
40+
steps:
41+
- uses: actions/checkout@v2
42+
- name: Set up Python ${{ matrix.python-version }}
43+
uses: actions/setup-python@v2
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
architecture: x64
47+
- name: Set up requirements ${{ matrix.python-version }}
48+
run: |
49+
python -m pip install --upgrade pip
50+
python -m pip install -r ./examples/lambda_sqs_light/requirements.txt -t .
51+
python -m pip install -r ./examples/lambda_sqs_light/requirements-vendor.txt -t .
52+
pylint:
53+
name: Lambda SQS Light - Setup pylint (Ubuntu 18.04)
54+
runs-on: ubuntu-18.04
55+
strategy:
56+
matrix:
57+
python-version: [ "3.8" ]
58+
needs: setup-project
59+
steps:
60+
- uses: actions/checkout@v2
61+
- name: Set up Python ${{ matrix.python-version }}
62+
uses: actions/setup-python@v2
63+
with:
64+
python-version: ${{ matrix.python-version }}
65+
architecture: x64
66+
- name: Install pylint
67+
run: |
68+
pip install pylint
69+
- name: Execute pylint
70+
run: |
71+
cd ./examples/lambda_sqs_light
72+
./scripts/pylint.sh
+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Summary:
2+
# Execute the pylint analysis on code
3+
# Read here for mode info: https://pylint.pycqa.org/en/latest/ and https://www.python.org/dev/peps/pep-0008/
4+
5+
name: Execute the pylint analysis
6+
7+
#on:
8+
# # There are several ways to trigger Github actions - See https://help.github.com/en/actions/reference/events-that-trigger-workflows#example-using-a-single-event for a comprehensive list:
9+
# # - "push": Triggers each time a commit is pushed
10+
# # - "pull_request": Triggers each time a commit is pushed within a pull request, it makes it much easier to write comments within the PR, but it suffers some strong limitations:
11+
# # - There is no way to trigger when a PR is merged into another - See https://github.community/t/pull-request-action-does-not-run-on-merge/16092?u=vadorequest
12+
# # - It won't trigger when the PR is conflicting with its base branch - See https://github.community/t/run-actions-on-pull-requests-with-merge-conflicts/17104/2?u=vadorequest
13+
# push: # Triggers on each pushed commit
14+
# branches:
15+
# - 'master'
16+
on: [ push ]
17+
18+
jobs:
19+
setup-environment:
20+
name: Lambda SQS - Setup deployment environment (Ubuntu 18.04 - Python 3.x)
21+
runs-on: ubuntu-18.04
22+
strategy:
23+
matrix:
24+
# python-version: [ "3.8", "3.9" ]
25+
python-version: [ "3.8" ]
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v2
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
architecture: x64
33+
setup-project:
34+
name: Lambda SQS - Setup project (Ubuntu 18.04 - Python 3.x)
35+
runs-on: ubuntu-18.04
36+
strategy:
37+
matrix:
38+
python-version: [ "3.8" ]
39+
needs: setup-environment
40+
steps:
41+
- uses: actions/checkout@v2
42+
- name: Set up Python ${{ matrix.python-version }}
43+
uses: actions/setup-python@v2
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
architecture: x64
47+
- name: Set up requirements ${{ matrix.python-version }}
48+
run: |
49+
python -m pip install --upgrade pip
50+
python -m pip install -r ./examples/lambda_sqs/requirements.txt -t .
51+
python -m pip install -r ./examples/lambda_sqs/requirements-vendor.txt -t .
52+
pylint:
53+
name: Lambda SQS - Setup pylint (Ubuntu 18.04)
54+
runs-on: ubuntu-18.04
55+
strategy:
56+
matrix:
57+
python-version: [ "3.8" ]
58+
needs: setup-project
59+
steps:
60+
- uses: actions/checkout@v2
61+
- name: Set up Python ${{ matrix.python-version }}
62+
uses: actions/setup-python@v2
63+
with:
64+
python-version: ${{ matrix.python-version }}
65+
architecture: x64
66+
- name: Install pylint
67+
run: |
68+
pip install pylint
69+
- name: Execute pylint
70+
run: |
71+
cd ./examples/lambda_sqs
72+
./scripts/pylint.sh

.gitignore

+21-8
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,22 @@ venv
1717
/docker/elk/logs/elasticsearch.log
1818
/.infrastructure/.terraform/
1919
/.chalice/deployments/
20-
/target/
21-
/target/dynamodb-local/
2220
*_us-east-2.db
2321
*_sa-east-1.db
2422
/docker/aws/credentials
2523
/deployment.zip
2624
/sam.json
2725
/.coverage
2826

27+
# mantem a vendor
28+
!vendor
29+
# ignora os demais arquivos
30+
vendor/*
31+
# mantem essa pasta
32+
!/vendor/public
33+
# mantem essa pasta
34+
!/vendor/datasources
35+
2936
# Coverage results and execution report
3037
!/target/integration/report.xml
3138
!/target/component/report.xml
@@ -50,9 +57,15 @@ imagedefinitions.json
5057
config/integration.en
5158
/node_modules/
5259

53-
/examples/lambda_api/vendor/*
54-
/examples/lambda_cron/vendor/*
55-
/examples/lambda_s3/vendor/*
56-
/examples/lambda_sns/vendor/*
57-
/examples/lambda_sqs/vendor/*
58-
/vendor/
60+
/lambda-full.zip
61+
62+
#output lambda
63+
output/response.json
64+
/output/
65+
/include/
66+
/env/integration.env
67+
/env/production.env
68+
/env/staging.env
69+
/env/_staging.env
70+
/env/_integration.env
71+
/env/_production.env

.pep8

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[pycodestyle]
2+
max_line_length = 120
3+
ignore = E501

0 commit comments

Comments
 (0)