0

I have created a simple deploy pipeline using jenkins, I have created the codedeploy, the S3 Bucket, the Autoscalable group, the ami. Everything listed in the docs. But it needs a appspec.yml. I have looked at the documentation for appspec.yml. And it’s very confusing.

Is there any way to generate a appspec.yml. I am not even sure what its role is. I thought the code deploy would take the zip file out of the S3 Bucket and deploy it to the scaleble group.

Any help?

Pierre.Vriens
  • 2,117
  • 75
  • 29
  • 42
Anton Cavanaugh
  • 719
  • 1
  • 4
  • 14

2 Answers2

1

Is there any way to generate a appspec.yml

You can't auto-generate the file. It must be custom designed for your specific application, and only you know what your application is, how it works, how it is configured, what are its dependencies, and so on.

Marcin
  • 215,873
  • 14
  • 235
  • 294
  • Thanks, yes that is the problem. Code deploy I thought was a case of taking something from one AWS service such as a zip file from a S3 Bucket, unzip it and put it in a location somewhere in a ec2. So I thought there would be a basic structure they all follow. – Anton Cavanaugh Aug 27 '21 at 08:27
  • @AntonCavanaugh The structure is explained in the docs already linked in the other answer. – Marcin Aug 27 '21 at 10:03
1

appspec.yml is the file that tells codedeploy service about what tasks it should do with the code on your EC2 servers. So it needs to be built according to your workflow. This documentation and the examples will help you what you want to achieve.

Ravi Kumar CH
  • 461
  • 1
  • 6
  • 16
  • Thanks for the reply, but the doc is kind of confusing for loading data on to an ec2 it just says "What it should install onto your instances from your application revision in Amazon S3 or GitHub." But an example "- location: scripts/install_dependencies.sh" does this mean write a shell script that takes a zip file out of the S3 Bucket unzip it and put it on the ec2 instance somewhere. CodeDeply has a basic structure. But there is no doc on how you take an zip out of a S3 Bucket and put it in a Ec2 instance I thouht code deply would handle all that. – Anton Cavanaugh Aug 27 '21 at 08:09
  • yes, your understanding is correct. You have to define the tasks in form of a shell script. Examples on the site are given taken into consideration that the code is usually present on a git repo. For your case if you need to get the files from S3, you could instlal AWS cli and then have a role assigned to the EC2 that will allow you to download the assets from S3 into the instance and then put the steps in the shell script that will be called by the appspec.yml – Ravi Kumar CH Aug 27 '21 at 09:48
  • Thank you. That is what I have done. I think what I will do is when I have got it working, is will update this question with the tasks. In the docs it looks like the appspec.yml is an after thought, rather than a very intergal part of code deploy – Anton Cavanaugh Aug 27 '21 at 12:20