The Wayback Machine - https://web.archive.org/web/20201013155504/https://github.com/wuakitv/codedeploy-multideployer
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

README.md

codedeploy-multideployer

codedeploy-multideployer uses AWS CodeDeploy to deploy multiple applications on the same instance in one shot.

Motivation

AWS CodeDeploy is a great tool, but it's designed to deploy only one application to a single instance. Associating multiple deployment groups to the same AutoScaling group is not recommended:

codedeploy-multideployer groups multiple deploys in one so only one deployment group needs to be associated to an AutoScaling group.

Requirements

codedeploy-local

codedeploy_local is a feature not yet integrated to any release in AWS CodeDeploy. It allows to localy deploy a specific release to a specific instance.

codedeploy_multideployer uses this tool to locally deploy all the required applications to a deployment group.

How to install

It can be installed either system-wide or inside a virtualenv:

python3 setup.py install

CodeDeploy agent needs to be installed following AWS documentation

codedeploy_local also has to be installed independently from the regular codedeploy-agent. As this tool is not yet ready for production, some changes are required before it can be used. We've opened a pull request to the main project so this change is merged into master.

Until then it needs to be installed with our modifications on a different path:

git clone https://github.com/wuakitv/aws-codedeploy-agent.git
cd aws-codedeploy-agent/
gem build codedeploy_agent-1.1.0.gemspec
gem install --no-ri --no-rdoc \
	--install-dir=/opt/codedeploy-local \
    --bindir=/opt/codedeploy-local/bin \
    aws_codedeploy_agent-0.1.gem
cp -r certs/ /opt/codedeploy-local/gems/aws_codedeploy_agent-0.1/
cat << EOF > /usr/local/bin/codedeploy-local
#!/bin/bash
GEM_PATH=/opt/codedeploy-local /opt/codedeploy-local/gems/aws_codedeploy_agent-0.1/bin/codedeploy-local
EOF
chmod +x /usr/local/bin/codedeploy-local

Example deploy

codedeploy-multideployer is designed to work using an independent repository where all the applications to be deployed and their releases are specified in a YAML file.

The wuakitv/codedeploy-multideployer-example repository has an example configuration to deploy the awslabs/aws-codedeploy-sample-tomcat application.

In your AWS CodeDeploy console, configure a new application and deployment group. Then deploy a new revision of the wuakitv/codedeploy-multideployer-example repository.

Once the new deploy is triggered the following will happen:

  1. Every codedeploy-agent installed in each instance will receive a signal and will start the deployment lifecycle
  2. When reached the AfterInstall hook, codedeploy-multideployer will be triggered as specified in the after_install.sh script
  3. codedeploy-multideployer will parse the provided multideployer.yaml file and process each one of the specified applications.
  4. For each app, codedeploy-multideployer will download the code directly from GitHub. If the specified repository is not public, appropiate credentials should be provided via the MULTIDEPLOYER_GITHUB_TOKEN environment variable or the --github-token parameter
  5. After the code has been downloaded, codedeploy-local be executed with the required parameters. Each application needs to have an appspec.yml file with the instructions on how to deploy it.
  6. codedeploy-local will copy all the files specified in the appspec.yml file and run the scripts for each one of the hooks
  7. If the application to be deployed has already been deployed with the same release hash and the parameter force in the multideployer.yaml file is not true, the deployment will be skipped
  8. If one application's deployment fails, the whole deployment will fail

About

Deploys multiple CodeDeploy projects in one shot.

Topics

Resources

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages

You can’t perform that action at this time.