Bash script to easily deploy applications with AWS Code Deploy. Designed to be used with CI systems such as TravisCI, CircleCI, and CodeShip and provide functionality that is not included in the out-of-box solutions from these vendors.
Given that CodeDeploy has a memory leak based on the size of the zip it tries to extract ( aws/aws-codedeploy-agent#32 ) would be good if the zip / tar process excluded the node-modules itself, or an array of supplied directories. If using the NPM version of the install its impossible to not have that be part of the archive itself currently.
Full
Step 6: Checking Application Source
✖ The specified source directory "/home/circleci/project" does not contain an "appspec.yml" in the application root.
I've been struggling to get this to work for a while. I wasn't able to get the example circle.yml file to work. Could a more complete example be provided? I may have broke something in the process, as I haven't gotten environment variables to be set without doing them manually through CircleCI's UI.
I'm trying to deploy to AWS China using your aws-code-deploy.
The endpoint of CodeDeploy in AWS China is different than in AWS.
Is there a way to create a Environment Variable of the codedeploy endpoint?
I'd like to ask is there any chance of enabling the option of creating a deployment bundle as a .tar.gz archive, instead of the .zip
The reasoning behind is this bug with the CodeDeploy tool, where someone reported it works without the memory leak if tgz is used, and apparently it works faster: aws/aws-codedeploy-agent#32 (comment)
success "Successfully compressed \"$APP_SOURCE\" ($DEPLOYMENT_COMPRESS_ORIG_DIR_SIZE) into \"$APP_LOCAL_FILE\" ($DEPLOYMENT_COMPRESS_FILESIZE)"
- if it could support an option parameter to try the tar-gzipping, I'd like to try it out to see if that works better than gzip for the memory leak AWS doesn't really seem to put enough resources into really fixing it.
I've been using this on my Mac and ran into a few issues:
readlink -f fails with an error (the -f flag doesn't exist) – I got around this by running brew install coreutils and changing readlink to greadlink.
sed -r fails for presumably similar reasons. Again, brew install gnu-sed then replacing it with gsed -r worked.
my AWS account credentials live in ~/.aws/credentials (which I think the AWS CLI docs recommend) but this script errors when looking for them in ~/.aws/config, so I changed those paths
my first successful run of the script uploaded a file called .zip because I forgot to set AWS_CODE_DEPLOY_S3_FILENAME – the other "required" variables cause the script to throw an error if they're not set, so maybe this one should too?
Hope this helps! Probably not worth me patching anything as these changes will likely break the app for non-OSX *nixes, but maybe worth noting somewhere in the readme?
I'd like to have my deployments overwrite existing content. You can specify this under the advanced options in the AWS CodeDeploy web interface but it does not currently seem to be a supported option for this tool. If I was to submit a PR adding the --file-exists-behavior flag to create-deployment command in aws-code-deploy.sh and update the README to reflect that change would it be accepted?
AWS defaults--file-exists-behavior to DISALLOW if it is not provided. That said, this would not be a breaking change because passing in DISALLOW in the absence of user input would result in the current behavior.