buildspec.yml:
version: 0.2
phases:
build:
commands:
- echo Build started on `date`
- echo Compiling the Python code...
- python HelloWorld_tst.py
post_build:
commands:
- echo Build completed on `date`
artifacts:
files:
- HelloWorld.py
- appspec.yml
discard-paths: yes
appspec.yml
version: 0.0
Resources:
- autovisionfunction:
Type: AWS::Lambda::Function
Properties:
Name: "autovisionfunction"
Alias: "staging"
CurrentVersion: "1"
TargetVersion: "2"
Seems while in CodePipeline can't find appspec.yml
I have downloaded artefact zip from S3 bucket, it has appspec.yml inside.
What do I miss?
Thank you
Olya
CodePipeline builds, tests, and deploys your code every time there is a code change, based on the release process models you define. AWS CodeDeploy belongs to "Deployment as a Service" category of the tech stack, while AWS CodePipeline can be primarily classified under "Continuous Deployment".
CodeBuild - A scalable service to compile, test, and package source code. CodeDeploy - A service to automate code deployments anywhere.
You use an AWS CodeDeploy action to deploy application code to your deployment fleet. Your deployment fleet can consist of Amazon EC2 instances, on-premises instances, or both. This reference topic describes the CodeDeploy deployment action for CodePipeline where the deployment platform is Amazon EC2.
I've currently been struggling with the same issue.
After some digging, I've found that it looks to be a limitation of linking the two services (codebuild and codedeploy) via codepipelines
Currently codebuild only supports ZIP/TAR/TGZ as the bundletypes (outputs) which codedeploy doesnt support
similar thread with an AWS response https://forums.aws.amazon.com/thread.jspa?messageID=864336
A work around is to trigger the codedeploy via the codebuild::project buildspec. Example below
export REVISION="revisionType=S3,s3Location{bucket=$BUCKET_DEPLOYMENTS,key=$CODEBUILD_BUILD_ID/appspec.yml,bundleType=YAML}"
aws deploy create-deployment \
--application-name=$APPLICATION_NAME \
--deployment-group-name=$DEPLOYMENT_GROUP_NAME \
--revision=$REVISION \
--deployment-config-name='CodeDeployDefault.LambdaCanary10Percent30Minutes'
Hopefully this gives you some ideas on how to work out the limitation
Regards,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With