1

I have a web and a worker environment on Elastic Beanstalk. I have a cron.yaml file that has a task that runs every hour. It was working fine in the beginning when I was deploying using eb-cli.

Then I decided to use AWS code pipeline to deploy code and that's when the cron job stopped working. The way it works is that the build stage of the pipeline creates a docker image and pushes it to my ECR repo. This image is then used (using Dockerrun.aws.json) in the next stage to run the app in both environments. But this approach does not schedule the tasks defined in cron.yaml.

I think with eb-cli, when elastic beanstalk unzips the archive uploaded to s3 for deployment by eb-cli, it finds that cron.yaml file and schedules the task. But with ECR, it's just the docker image and that cron.yaml is not available. If this is the case, how can I provide the cron.yaml file to elastic beanstalk when deploying from ECR repo?

What am I missing?

Farhat Nawaz
  • 202
  • 5
  • 20

1 Answers1

0

I was able to solve this issue myself. All you need to do is add cron.yaml file to artifacts in your buildspec.yml file, like so:

artifacts:
    files:
      - Dockerrun.aws.json
      - cron.yaml
Farhat Nawaz
  • 202
  • 5
  • 20