Sha256: c92708334ca2b06e99f348542f173750f44f4b9c7ed4a83b2b54bf8f52225da0

Contents?: true

Size: 1.55 KB

Versions: 4

Compression:

Stored size: 1.55 KB

Contents

require 'spec_helper'

class EY::Serverside::Source::Archive
  def fetch_command
    "cp #{uri} #{source_cache}"
  end
end

describe "Deploying a simple application" do

  before(:all) do
    adapter = EY::Serverside::Adapter.new do |args|
      args.account_name = "account"
      args.app = "application_name"
      args.stack = "nginx_unicorn"
      args.environment_name = "environment_name"
      args.framework_env = "production"
      args.archive = FIXTURES_DIR.join('retwisj.war')
      args.verbose = true
      args.instances = [{ :hostname => "localhost", :roles => ["solo"], :name => "single" }]
      args.serverside_version = Gem::Version.create(EY::Serverside::VERSION.dup).release
      args.config = {
        "deploy_to" => deploy_dir.to_s,
        "group"            => GROUP
      }
    end
    argv = adapter.deploy.commands.last.to_argv[2..-1]
    with_mocked_commands do
      capture do
        EY::Serverside::CLI::App.start(argv)
      end
    end
  end

  it "exploded the war" do
    %w(META-INF WEB-INF).each {|dir|
      File.exists?(deploy_dir.join('current', dir))
    }
  end

  it "creates a REVISION file" do
    path = deploy_dir.join('current', 'REVISION')
    expect(path).to exist
    checksum = File.read(path).strip
    expect(checksum).to match(/7400dc058376745c11a98f768b799c6651428857\s+.*retwisj.war$/)
  end

  it "restarts the app servers" do
    restart = deploy_dir.join('current', 'restart')
    expect(restart).to exist
    expect(restart.read.chomp).to eq(%|LANG="en_US.UTF-8" /engineyard/bin/app_application_name deploy|)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
engineyard-serverside-2.8.0.pre4 spec/archive_deploy_spec.rb
engineyard-serverside-2.8.0.pre spec/archive_deploy_spec.rb
engineyard-serverside-2.6.17 spec/archive_deploy_spec.rb
engineyard-serverside-2.6.15.pre spec/archive_deploy_spec.rb