0

I need a step by step guide on setting up a CI/CD pipeline using AWS CodePipeline for a Flask application deployed using Zappa.

Zappa is an open source framework that helps in building and deploying server-less, event-driven Python applications particularly WSGI web applications like Django and Flask applications on AWS Lambda and API Gateway. The GitHub repository for Zappa can be found at https://github.com/Miserlou/Zappa.

Rupam Kundu
  • 271
  • 1
  • 3
  • 10

2 Answers2

1

Here are some general guidelines that should assist you with your task.

  1. Use Pipenv for your project and install all packages via pipenv install command

  2. Install Zappa on your pipenv env. using pipenv install zappa

  3. Run zappa Init to create the zappa_settings.json file

  4. Edit and configure your zappa_settings.json according to your project requirements.

  5. IMPORTANT - you will have to specify the AWS key & secret directly to the pipeline.
    For this purpose make sure you delete the profile_name key from the zappa_settings.json and provide them via the pipeline Keystore settings.

  6. Run the first zappa deploy and confirmed everything runs smoothly.

  7. configure the pipeline to retrieve changes automatically from your repository and deploy it official python docker image

  8. Add the following lines to your buildspec.yml file:

    commands:
        - pip install pipenv
        - pipenv install
        - pipenv run zappa update
    

Good Luck!

Dudi
  • 43
  • 5
0

prerequisites: Inlocal machine do zappa init which will create zappa_settings.json file. you can modify zappa_settings.json according to your requirements. include zappa_settings.json and requirements.txt in the root directory

  • use docker image for python example "frolvlad/alpine-python3"
  • apk add build-base
  • apk add python3-dev
  • pip install pipenv
  • pipenv run pip install -r requirements.txt(where u can specify the packages to be installed along with their version)
  • pipenv run zappa deploy --all(or any environment you have specified in zappa_settings.jsonfile) || pipenv run zappa update --all
sindhuja
  • 1
  • 1