Git Product home page Git Product logo

techpivot / aws-code-deploy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jazzmind/wercker-aws-code-deploy

122.0 122.0 40.0 79 KB

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.

License: MIT License

Shell 100.00%
aws aws-codedeploy bash-script ci circleci codeship travis-ci

aws-code-deploy's People

Contributors

billbrower avatar mylesharding avatar nhuray avatar virgofx avatar zappan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-code-deploy's Issues

Syntax issue on CircleCI

I use the following command on CircleCI:

  • run:
    name: Deploy to S3
    command: sh /var/www/html/aws-code-deploy.sh

Then I got the following output from CircleCI:
#!/bin/bash -eo pipefail
sh /var/www/html/aws-code-deploy.sh

/var/www/html/aws-code-deploy.sh: 106: /var/www/html/aws-code-deploy.sh: Syntax error: "(" unexpected (expecting "}")
Exited with code 2

Any idea how I can solve that?

Please let me know if I can supply more information to solve the issue.

Thanks

Step 6: appspec.yml not found.

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.

Endpoint Environment Variable

Hey,

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?

Any chance of allowing bundle creation as tar-gzip via an option switch?

Hi,

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)

I'm referring to this block in this utility:

if [ -d "$APP_SOURCE" ]; then
if [ ! -e "$APP_SOURCE/appspec.yml" ]; then
error "The specified source directory \"${APP_SOURCE}\" does not contain an \"appspec.yml\" in the application root."
exit 1
fi
if ! typeExists "zip"; then
note "Installing zip binaries ..."
sudo apt-get install -y zip
note "Zip binaries installed."
fi
DEPLOYMENT_COMPRESS_ORIG_DIR_SIZE=$(du -hs $APP_SOURCE | awk '{ print $1}')
APP_LOCAL_FILE="${AWS_CODE_DEPLOY_S3_FILENAME%.*}.zip"
APP_LOCAL_TEMP_FILE="/tmp/$APP_LOCAL_FILE"
runCommand "cd \"$APP_SOURCE\" && zip -rq \"${APP_LOCAL_TEMP_FILE}\" ." \
"Unable to compress \"$APP_SOURCE\""
DEPLOYMENT_COMPRESS_FILESIZE=$(ls -lah "${APP_LOCAL_TEMP_FILE}" | awk '{ print $5}')
BUNDLE_TYPE="zip"
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.

Thanks

OS X compatibility

Hi – thanks for your great script.

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?

Is there anyway to set content options?

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.

The deployment failed because a specified file already exists at this location

Having the following error

Deployment is OK via CodeDeploy console, or aws deploy create-deployment command

Instance: i-0191d585e6da80b5c
Instance ID: ###########
Status: Failed
Last Updated At: Mon Nov 12 10:44:26 UTC 2018

✔ [Succeeded] ApplicationStop
✔ [Succeeded] DownloadBundle
✔ [Succeeded] BeforeInstall
✖ [Failed] Install
UnknownError The deployment failed because a specified file already exists at this location: /var/www/html/#######/styles/scss/.DS_Store
[Skipped] AfterInstall
[Skipped] ApplicationStart
[Skipped] ValidateService

Error: Exited with code 1
Step failed
Error: runner failed
Task failed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.