Aintsmartenough
Aintsmartenough

Reputation: 79

Deploy Spring Boot App with AWS CodePipeline

I am getting the following error when trying to deploy my spring boot app with AWS Codepipeline.

Unable to launch application as the source bundle does not contain either a file named application.jar or a Procfile. Unable to launch application as the source bundle does not contain either a file named application.jar or a Procfile.

When trying to deploy an app.

I tried to use CodePipeline for CI/CD (using a github repo).
I have 3 stages in my pipeline:

  1. Source, where I get the source code
  2. Build, input artifact : Source, output artifact : build_artifact
  3. Deploy, input artifact:buid_artifact

Now, the first two stages work and I don't have any problems, the problem is that I can't deploy the app.
Here are the logs https://pastebin.com/RZxzMb2c]

I found this thread Deploy Spring Boot application with Elastic BeansTalk CLI and I realised I don't have a .elasticbeanstalk folder, I tried creating it using eb init but it made me use codecommit instead of github so Instead I just copied it from that branch.
Here is the config.yml from .elasticbeanstalk

branch-defaults:
  master:
    environment: ProiectIp-env
environment-defaults:
  ProiectIp-env:
    branch: null
    repository: null
deploy:
  artifact: build/libs/application.jar
global:
  application_name: proiect-ip
  default_ec2_keyname: null
  default_platform: Java 8
  default_region: eu-central-1
  include_git_submodules: true
  instance_profile: null
  platform_name: null
  platform_version: null
  profile: eb-cli
  sc: git
  workspace_type: Application

I tried puting deploy : artifact : build/libs/application.jar as in the thread from above but I still got the same error.
Here is my buildspec.yml

version: 0.2

phases:
  install:
    runtime-versions:
      java: corretto8
  pre_build:
    commands:
      - echo Nothing to do in the pre_build phase...
  build:
    commands:
      - echo Build started on `date`
      - gradle build
  post_build:
    commands:
      - echo Build completed on `date`
artifacts:
  files:
    - build/libs/application.jar

I am using gradle and I set up rootProject.name = 'application', the application.jar file is created, as seen in the build logs : https://pastebin.com/NXHpwGLb and the deploy logs (search for build/libs/application.jar)
Here is my .gitignore file, I have no idea if that helps with anything : https://pastebin.com/8q1UwmyL

I tried using codecommit, putting deploy..., it just doesn't want to work, I don't know what to do anymore

Upvotes: 0

Views: 1153

Answers (0)

Related Questions