Skip to content
This repository has been archived by the owner on Jun 28, 2019. It is now read-only.

Allow specifying a separate application name so that sub applications… #55

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

eyespies
Copy link

… can be deployed without having to change server tags. We have a use case where we build and deploy multiple, separate, applications as different directories within a single virtual host where we also have multiple hosts, e.g. the Widget application is deployed to the Factory host as http://www.factory.com/widget/ and the Water and Fish applications are deployed to the Ocean host as http://www.ocean.com/water/ and http://www.ocean.com/fish/.

In order to prevent the need for us to create a very long tag value (Tag Name=Projects, Tag Value=widget1,widget2,widget3,widget4, etc) we want to group the applications based on the host/domain name and not the application name. To accomplish this, we have created an override value called ec2_application which supersedes the application setting but only if it is set.

This does not affect existing behavior because it defaults to using the normal :application setting if the :ec2_application value is not set. My Ruby skills are only moderate, so please double check the if ... statement I wrote.

I tested this by doing the following:

  1. Test that :application value still works
    • Configure Capistrano with only the :application value
    • Configure a single server with the Project tag set to the :application value
    • Run cap dev ec2:status --> the one server was returned (expected behavior)
  2. Test a missing :ec2_application shows no results
    • Configure Capistrano with only the :application value
    • Configure a single server with the Project tag set to a value OTHER than the :application value
    • Run cap dev ec2:status --> no results returned (the expected behavior)
  3. Test that :ec2_application value overrides the :application value
    • Configure Capistrano with both the :application value AND the :ec2_application value
    • Configure a single server with the Project tag set to the :application value
    • Run cap dev ec2:status --> no results returned (the expected behavior)
    • Configure Capistrano with both the :application value AND the :ec2_application value
    • Configure a single server with the Project tag set to the :ec2_application value
    • Run cap dev ec2:status --> one result returned (the expected behavior)

Justin Spies and others added 4 commits July 14, 2015 09:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants