Sha256: e62e2d206c0208555e7f70f08ceb0e53ec26e4753a13bf3468a9bfc9bf909baa
Contents?: true
Size: 1.18 KB
Versions: 22
Compression:
Stored size: 1.18 KB
Contents
class Jets::Cfn::TemplateMappers class ApiGatewayDeploymentMapper < ChildMapper def logical_id self.class.logical_id end def timestamp self.class.timestamp end # stage_name: stag, stag-1, stag-2, etc def stage_name self.class.stage_name end def parameters { RestApi: "!GetAtt ApiGateway.Outputs.RestApi" } end def depends_on expression = "#{Jets::Naming.template_path_prefix}-*_controller*" controller_logical_ids = [] Dir.glob(expression).each do |path| next unless File.file?(path) # @s3_bucket is available from the inherited ChildMapper class map = ChildMapper.new(path, @s3_bucket) controller_logical_ids << map.logical_id end controller_logical_ids end # Returns: "ApiGatewayDeployment[timestamp]" def self.logical_id "ApiGatewayDeployment#{timestamp}" end @@timestamp = nil def self.timestamp @@timestamp ||= Time.now.strftime("%Y%m%d%H%M%S") end def self.stage_name [Jets.config.short_env, Jets.config.env_extra].compact.join('_').gsub('-','_') # Stage name only allows a-zA-Z0-9_ end end end
Version data entries
22 entries across 22 versions & 1 rubygems