Trouble deploying Django application to AWS via Jenkins and Elastic Beanstalk

131 Views Asked by At

I have a Django application hosted on an EC2 instance that I deploy manually via eb deploy. This is my production instance, and works fine. The Ec2 instance is an Amazon Linux 2 Platform.

I'm standing up a dev server using this tutorial. I wanted to include a Jenkins pipeline, so I am. I was able to deploy a barebones EB application to an Amazon Linux 2023 platform, but now I'm trying to deploy my own application. I think the change from Amazon Linux 2 to Amazon Linux 2023 might be a part of the issue. I'm pretty new to dev ops/infra and I'm trying my best to figure it out.

The tutorial I'm following (as well as several other sources) made it seem that I need to use an Ubuntu EC2 instance. So Ubuntu as the OS w/ Amazon Linux 2023 as the platform (please correct me if my terminology is incorrect)

My Jenkins builds are pushing to AWS for deployment, but they are failing. The intial errors complain about yum and amazon-linux-extras. Through some reaserch, I beleve that the amazon-linux-extras package is not requred on Amazon Linux 2023, but maybe that's not correct.

Regardless, when I push with the 01_packages.config empty, rather than what my production uses:

commands:
    01_postgres_activate:
        command: sudo amazon-linux-extras enable postgresql10
    02_postgres_install:
        command: sudo yum install -y postgresql-devel

as well as clear out my linux.config (probably needs to be adjusted for Ubuntu somehow, but making it empty does not work either):

commands:
  libcurl-devel:
    command: sudo yum install -y libcurl-devel
    ignoreErrors: true
  openssl-devel:
    command: sudo yum install -y openssl-devel
    ignoreErrors: true

my config.yml file looks like:

branch-defaults:
  main:
    environment: RVM-dev
    group_suffix: null
environment-defaults:
  Rvm-dev-env:
    branch: null
    repository: null
global:
  application_name: RVM-dev
  branch: null
  default_ec2_keyname: rvm_keypair
  default_platform: Python 3.11
  default_region: us-east-1
  include_git_submodules: true
  instance_profile: null
  platform_name: null
  platform_version: null
  profile: eb-cli
  repository: null
  sc: git
  workspace_type: Application

The deployment fails. When I download the full logs, I don't see anything pertaining to deployment errors.

Any suggestions on what is incorrect, or how I can debug further?

1

There are 1 best solutions below

0
On

Ok so I'm sure that this would work with Ubuntu if I reconfigured my app to work that way (deps and such). However, here is how I got it all working by switching to amazon linux 2:

Jenkins unable to connect to github private repo