Build file is not added to elastic beanstalk

Hi guys,

It the moment I am strugling with an issue I can’t resolve by my own .

#!/bin/bash -eo pipefail
bash ./build.sh && cd /go/src/github.com/XXXX/XXXX/deploy && ls && eb deploy XXXX
application  frontend  migrations
Creating application version archive "app-c282-190715_195652".
Uploading XXXX/app-c282-190715_195652.zip to S3. This may take a while.
Upload Complete.
2019-07-15 19:56:55    INFO    Environment update is starting.      
 -- Events -- (safe to Ctrl+C) Use "eb abort" to cancel the command.2019-07-15 19:57:33    INFO    Deploying new version to instance(s).
 -- Events -- (safe to Ctrl+C) Use "eb abort" to cancel the command.2019-07-15 19:57:38    ERROR   Unable to launch application as the source bundle does not contain a Buildfile, Procfile or an executable.
2019-07-15 19:57:40    ERROR   [Instance: i-032c4c91d9ae92bd4] Command failed on instance. Return code: 1 Output: (TRUNCATED)...grations/201907101155_market_item.up.sql  
Unable to launch application as the source bundle does not contain a Buildfile, Procfile or an executable.
Unable to launch application as the source bundle does not contain a Buildfile, Procfile or an executable. 
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/01_configure_application.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2019-07-15 19:57:40    INFO    Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2019-07-15 19:57:40    ERROR   Unsuccessful command execution on instance id(s) 'i-032c4c91d9ae92bd4'. Aborting the operation.
2019-07-15 19:57:40    ERROR   Failed to deploy application.  

I am building the executable with go and place it in the /deploy folder. … with a quick ls we can see that the application executable is present … but it isn’t send to eb.

The elastic beanstalk config is this :

branch-defaults:
  master:
    environment: XXXX
global:
  application_name: XXXX
  default_ec2_keyname: XXXX
  default_platform: 64bit Amazon Linux 2017.09 v2.6.2 running Ruby 2.4 (Passenger Standalone)
  default_region: eu-central-1
  sc: git

circleci/config.yml

version: 2
jobs:
  deploy:
    working_directory: /go/src/github.com/XXXX/XXXX
    docker:
      - image: circleci/golang
    steps:
      - checkout
      - run: sudo apt-get -y -qq update --assume-yes
      - run: sudo apt-get install python-pip python-dev build-essential --assume-yes
      - run: sudo pip install awsebcli --upgrade
      - run: >
          bash ./build.sh
          && cd /go/src/github.com/XXXX/XXXX/deploy
          && ls
          && eb deploy XXXX
workflows:
  version: 2
  build_and_test:
    jobs:
      - deploy

I have solved the issue by placing a .ebignore to the deploy folder… for what I understand eb deploy respects the gitignore rules and by adding the ebignore file you can get around it.