From d2863c8a83f650c7861d0896e0846fc9da673913 Mon Sep 17 00:00:00 2001 From: Wes Date: Wed, 16 Jun 2021 21:33:32 -0400 Subject: [PATCH 1/4] starter code for lab Committer: Wes --- .github/workflows/deploy-pipeline.yaml | 46 ++++++++++++++++++++++++++ function/lambda_function.py | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy-pipeline.yaml diff --git a/.github/workflows/deploy-pipeline.yaml b/.github/workflows/deploy-pipeline.yaml new file mode 100644 index 000000000..678300fc6 --- /dev/null +++ b/.github/workflows/deploy-pipeline.yaml @@ -0,0 +1,46 @@ +name: Deploy Lambda Function +on: [push] + +jobs: + + lint: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install libraries + run: pip install flake8 + - name: Lint with flake8 + run: | + cd function + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + + build: + runs-on: ubuntu-latest + needs: lint + steps: + - name: Check out code + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install libraries + run: | + cd function + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt -t .; fi + - name: Zip bundle + run: | + cd function + zip -r ../${{ github.sha }}.zip . + - name: Archive artifact + uses: actions/upload-artifact@v2 + with: + name: zipped-bundle + path: ${{ github.sha }}.zip \ No newline at end of file diff --git a/function/lambda_function.py b/function/lambda_function.py index 2809ce09b..96a4f6afa 100644 --- a/function/lambda_function.py +++ b/function/lambda_function.py @@ -8,7 +8,7 @@ def lambda_handler(event, context): Returns: string: greeting response """ - print('Starting functions\n---------------------------------------------' + print('Starting functions\n---------------------------------------------') if event["input"] == "Hello": From d187e29f38acd2c9ea9c6d6f8b92f473439ba08d Mon Sep 17 00:00:00 2001 From: Wes Date: Wed, 16 Jun 2021 21:38:41 -0400 Subject: [PATCH 2/4] updated libs --- function/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/function/requirements.txt b/function/requirements.txt index 65a457e70..569d20bbe 100644 --- a/function/requirements.txt +++ b/function/requirements.txt @@ -1,2 +1,2 @@ -Github==1.55 +PyGithub==1.55 boto3==1.17.96 \ No newline at end of file From bfb1eb639ac60d912690c99a9038bf299c99b23f Mon Sep 17 00:00:00 2001 From: Wes Date: Tue, 29 Jun 2021 17:18:58 -0400 Subject: [PATCH 3/4] add userguide --- userguide.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 userguide.md diff --git a/userguide.md b/userguide.md new file mode 100644 index 000000000..71cc37841 --- /dev/null +++ b/userguide.md @@ -0,0 +1,20 @@ +# User Guide + +## Install + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + +## Troubleshooting + +- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +- Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +- Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. +- Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + +## Contact us + +| Lorem | ipsum | dolor | +| ------------- |-------------| -----| +| Ut enim ad minim veniam | quis nostrud exercitation ullamco | laboris nisi ut aliquip ex ea commodo consequat | +| Duis aute irure | dolor in reprehenderit in | voluptate velit esse cillum dolore eu fugiat nulla pariatur | +| Excepteur sint occaecat | cupidatat non proident | sunt in culpa qui officia deserunt mollit anim id est laborum | \ No newline at end of file From d89afe73420e0446852c91adc2e33a56f28ee2f1 Mon Sep 17 00:00:00 2001 From: nehaPrakashAND <119417477+nehaPrakashAND@users.noreply.github.com> Date: Fri, 11 Aug 2023 20:03:49 +0100 Subject: [PATCH 4/4] Update deploy-pipeline.yaml --- .github/workflows/deploy-pipeline.yaml | 31 +++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-pipeline.yaml b/.github/workflows/deploy-pipeline.yaml index 678300fc6..1b3ff75e2 100644 --- a/.github/workflows/deploy-pipeline.yaml +++ b/.github/workflows/deploy-pipeline.yaml @@ -43,4 +43,33 @@ jobs: uses: actions/upload-artifact@v2 with: name: zipped-bundle - path: ${{ github.sha }}.zip \ No newline at end of file + path: ${{ github.sha }}.zip + + publish: + runs-on: ubuntu-latest + needs: build + steps: + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.github_token }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.run_number }} + release_name: Release ${{ github.run_number }} + body: New release for ${{ github.sha }}. Release notes can be found in the docs. + draft: false + prerelease: false + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: zipped-bundle + - name: Upload release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.github_token }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./${{ github.sha }}.zip + asset_name: source_code_with_libraries.zip + asset_content_type: application/zip