moonshot 0.7.7 → 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/moonshot +11 -0
- data/lib/default/Moonfile.rb +0 -0
- data/lib/moonshot.rb +33 -6
- data/lib/moonshot/always_use_default_source.rb +17 -0
- data/lib/moonshot/artifact_repository/s3_bucket_via_github_releases.rb +140 -3
- data/lib/moonshot/ask_user_source.rb +38 -0
- data/lib/moonshot/build_mechanism/github_release.rb +1 -1
- data/lib/moonshot/build_mechanism/script.rb +1 -1
- data/lib/moonshot/command.rb +64 -0
- data/lib/moonshot/command_line.rb +150 -0
- data/lib/moonshot/commands/build.rb +12 -0
- data/lib/moonshot/commands/console.rb +19 -0
- data/lib/moonshot/commands/create.rb +37 -0
- data/lib/moonshot/commands/delete.rb +12 -0
- data/lib/moonshot/commands/deploy.rb +12 -0
- data/lib/moonshot/commands/doctor.rb +12 -0
- data/lib/moonshot/commands/list.rb +16 -0
- data/lib/moonshot/commands/new.rb +99 -0
- data/lib/moonshot/commands/parameter_arguments.rb +27 -0
- data/lib/moonshot/commands/push.rb +12 -0
- data/lib/moonshot/commands/ssh.rb +12 -0
- data/lib/moonshot/commands/status.rb +12 -0
- data/lib/moonshot/commands/update.rb +29 -0
- data/lib/moonshot/commands/version.rb +12 -0
- data/lib/moonshot/config.rb +0 -0
- data/lib/moonshot/controller.rb +106 -42
- data/lib/moonshot/controller_config.rb +31 -13
- data/lib/moonshot/deployment_mechanism/code_deploy.rb +17 -7
- data/lib/moonshot/json_stack_template.rb +17 -0
- data/lib/moonshot/parameter_collection.rb +50 -0
- data/lib/moonshot/parent_stack_parameter_loader.rb +51 -0
- data/lib/moonshot/resources.rb +3 -3
- data/lib/moonshot/resources_helper.rb +2 -2
- data/lib/moonshot/ssh_command.rb +31 -0
- data/lib/moonshot/ssh_config.rb +1 -1
- data/lib/moonshot/stack.rb +66 -77
- data/lib/moonshot/stack_list_printer.rb +21 -0
- data/lib/moonshot/stack_lister.rb +16 -6
- data/lib/moonshot/stack_parameter.rb +64 -0
- data/lib/moonshot/stack_parameter_printer.rb +3 -49
- data/lib/moonshot/stack_template.rb +13 -25
- data/lib/moonshot/task.rb +10 -0
- data/lib/moonshot/tools/asg_rollout.rb +1 -1
- data/lib/moonshot/tools/asg_rollout/instance_health.rb +1 -1
- data/lib/moonshot/tools/asg_rollout_config.rb +1 -1
- data/lib/moonshot/yaml_stack_template.rb +17 -0
- metadata +51 -9
- data/lib/moonshot/cli.rb +0 -220
- data/lib/moonshot/environment_parser.rb +0 -32
@@ -1,32 +0,0 @@
|
|
1
|
-
require 'ostruct'
|
2
|
-
|
3
|
-
module Moonshot
|
4
|
-
# This module supports massaging of the incoming environment.
|
5
|
-
module EnvironmentParser
|
6
|
-
def self.parse(log)
|
7
|
-
log.debug('Starting to parse environment.')
|
8
|
-
|
9
|
-
# Ops Bastion servers export AWS_CREDENTIAL_FILE, instead of key and
|
10
|
-
# secret keys, so we support both here. We then set them as environment
|
11
|
-
# variables which will be respected by aws-sdk.
|
12
|
-
parse_credentials_file if ENV.key?('AWS_CREDENTIAL_FILE')
|
13
|
-
|
14
|
-
# Ensure the aws-sdk is able to find a set of credentials.
|
15
|
-
creds = Aws::CredentialProviderChain.new(OpenStruct.new).resolve
|
16
|
-
|
17
|
-
raise 'Unable to find AWS credentials!' unless creds
|
18
|
-
|
19
|
-
log.debug('Environment parsing complete.')
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.parse_credentials_file
|
23
|
-
File.open(ENV.fetch('AWS_CREDENTIAL_FILE')).each_line do |line|
|
24
|
-
key, val = line.chomp.split('=')
|
25
|
-
case key
|
26
|
-
when 'AWSAccessKeyId' then ENV['AWS_ACCESS_KEY_ID'] = val
|
27
|
-
when 'AWSSecretKey' then ENV['AWS_SECRET_ACCESS_KEY'] = val
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|