Deploy from the CLI

Note: The stack referred to in this article is no longer maintained and this article is kept purely for reference.

Welcome to the user guide for deploying to Engine Yard Cloud with the engineyard gem. For more information about Engine Yard's CLI, refer to the Engine Yard CLI User Guide.

To deploy an application from the CLI

  1. Install the engineyard gem:

    gem install engineyard
  2. Switch to your local application directory that contains your git repository:

    cd ~/my_application
  3. Deploy your application:

    ey deploy

    If your application is running in multiple environments, append -e environment_name to disambiguate, for example, ey deploy -e production.

  4. The first time you run the engineyard gem, enter your Engine Yard account credentials (email address and password) at the prompts. You only have to enter these once.

    Your application is now deployed.

Common Errors

If you get the following error when deploying the application:

mceclip0.png

You will need to install OpenSSL and then rebuild eventmachine.

For .nix environments (including WSL):

  1. sudo apt-get install openssl
  2. gem install eventmachine

For Windows environments: 

  1. Download and install OpenSSL 
  2. Add it to the path as described on Installing OpenSSL on Windows 10 and updating PATH.
  3. Rebuild eventmachine by running gem install eventmachine

If you have feedback or questions about this page, add a comment below. If you need help, submit a ticket with Engine Yard Support.

Comments

  • Avatar
    kranthi reddy

    Hi, i'm getting the following error when installing the engineyard gem. Could you please look into this

    $ gem install engineyard

    ERROR: While executing gem ... (NoMethodError)

    undefined method `call' for nil:NilClass

    0
    Comment actions Permalink
  • Avatar
    J. Austin Hughey

    Hi Kranthi,

    We've responded to the ticket you already had open with us in support. Please direct all further questions regarding your issue installing the engineyard gem to that ticket. Thanks!

    0
    Comment actions Permalink
  • Avatar
    Norman Bean

    Hi there,

    I had to deploy some fixes to my server. Since the dashboard is not yet working,  I had to try CLI.  

    First problem is that I don't have "~/my_application" directory.  My application is at /data/my_application.  In that directly, I tried running ey deploy.  It doesn't really use the working directory as input, it listed the environments that I can deploy instead.  It was helpful.  But then when I run it, I got this problem that it doesn't have ssh-key:

     

    ip-10-212-70-9 .ssh # ey deploy --environment='staging' --app='my_app' --account='my_account' --branch 'refs/heads/production'

    Loading application data from EY Cloud...

    Beginning deploy of ref 'refs/heads/production2' for 'my_app' in 'Staging' on server...

    Running command on deploy@ec2-xxx-xx-xxx-xxx.compute-1.amazonaws.com.

    Error encountered during deploy.

    Failed deployment recorded in EY Cloud

    Authentication Failed: Please add your environment's ssh key with: ssh-add path/to/key

    I tried doing ssh-add to the app's ssh key to access github, but it doesn't work.  I thought my environment is the most typical engineyard environment.  But this instruction seems to not support that.   Would you please give some pointers?

     

    Thanks in advance.

    0
    Comment actions Permalink
  • Avatar
    Norman Bean

    Thanks for the great support.  They pointed out that I am actualy to install and use the EngineYard gem CLI on my local machine.  Once I know that,  it went very smoothly and my app is deployed. 

    0
    Comment actions Permalink
  • Avatar
    Jane Day

    Thank you very much for your feedback. We have updated this page to clarify that the engineyard gem runs on your local machine.

    0
    Comment actions Permalink
  • Avatar
    Tom Hoen

    Small comment. The doc above says that ey logout will take down the maintenance page. I believe it will log you out instead.

    0
    Comment actions Permalink
  • Avatar
    Keri Meredith

    Hi Tom, thanks for the catch! We appreciate the feedback. kjm

    0
    Comment actions Permalink
  • Avatar
    Avenida Global

    Hi there! is there any way through the CLI tool or maybe another way, to display the Maintenance Page to all the visitor, except to the ones accessing from an specific IP? Thanks in advance for your time!

    0
    Comment actions Permalink
  • Avatar
    Tom Hoen

    +1 for Agustin suggestion

    0
    Comment actions Permalink
  • Avatar
    J. Austin Hughey

    Hi Agustin, Tom,

    Our CLI does not have this capability at present (nor does the dashboard). Generally speaking, you should be able to push new code changes to a staging environment and preview them there before deploying live (so you can see the changes without affecting users). However, if that isn't sufficient for your needs, I recommend opening a feature request at our feature request forums.

    https://support.cloud.engineyard.com/forums/30086-feature-requests

    0
    Comment actions Permalink
  • Avatar
    Fritz Madden

    Do you have a client tool for PHP deployments for is the this a Ruby only solution?

    0
    Comment actions Permalink
  • Avatar
    Evan Machnic

    Hi Fritz,

    While the engineyard gem is really focused on deploying Ruby applications, it should still be possible to use it to deploy a PHP app. Features related to migrations and database operations will likely not work but most of the other features should still be very useful for a PHP developer.

    Note that to use the CLI, you will need to have Ruby installed and then you should be able to install it with $ (sudo) gem install engineyard . After that, just run ey help to see what commands are available to you.

    Thanks,

    Evan Machnic

    0
    Comment actions Permalink
  • Avatar
    Sundeep Chugani

    Hi all, 

    Please give me sample code for mongoid.yml and ey.yml for engine yard.

     

    Thanks & Regards

     

    Sundeep

    0
    Comment actions Permalink
  • Avatar
    Matt Scilipoti

    FYI: there is no mention of ey rollback

    0
    Comment actions Permalink
  • Avatar
    Keri Meredith

    Thanks, Matt. What we really need is automated push of the https://github.com/engineyard/engineyard/blob/master/README.rdoc to this doc! :) 

    thanks again, kjm

    0
    Comment actions Permalink
  • Avatar
    Adam Raouki

    After installing the 'engineyard gem' and issued the 'ey deploy' command, I got the following

       

    Loading application data from Engine Yard Cloud...

    Using current HEAD branch "master".

    The environment 'kodefugeEnv' does not have a master instance.

     

    Any clue?

       

    0
    Comment actions Permalink
  • Avatar
    Liricco Dev

    if you find the output is

    "No application found matching remotes:"

    you should provide the environment arguments

    i.e. # ey ssh -e NAME

    1
    Comment actions Permalink
  • Avatar
    Sean Knox

    Another cause of the "No application found matching remotes:" error is your git remote name. git/Github don't care about case sensitivity, but the engineyard gem does.

    For example, this wasn't working for me:

    origin https://github.com/sean/my-neat-repo (fetch)
    origin https://github.com/sean/my-neat-repo (push)

    I could happily push/pull with that Github remote, but the actual project repo name was uppercase:

    origin https://github.com/sean/My-Neat-Repo (fetch)
    origin https://github.com/sean/My-Neat-Repo (push)

    :tired_face:

    0
    Comment actions Permalink
  • Avatar
    Tyler Code

    Is `ey-core` a drop-in replacement for the `engineyard` gem referenced? When I try to install `engineyard` on modern Ruby I encounter "key not found: :ciphers".

    0
    Comment actions Permalink
  • Avatar
    Pasan Chamikara

    Hello Tyler,

    Yes you are indeed correct on this, `ey-core` is an updated version of the engineyard gem. Therefore we do recommend utilizing `ey-core` instead of `ey` in the new chef customizations and in deployments.

    You can find more information regarding this gem at https://github.com/engineyard/core-client-rb

    Pasan

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk