Sha256: 05817d2c4d9ff24d307a751dfc137a1b9586c207629eaf7d3768dcab35337336

Contents?: true

Size: 1.08 KB

Versions: 7

Compression:

Stored size: 1.08 KB

Contents

#!/usr/bin/env bash
set -e

export RAILS_ENV=${RAILS_ENV:="production"}
export AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:=us-east-1}
export CLOUDFORMATION_BUCKET=${CLOUDFORMATION_BUCKET:="lamby.cloudformation.$(whoami)"}

./bin/build

export VPCID=${VPCID:=$(
  aws ec2 describe-vpcs \
    --output text \
    --filters 'Name=state,Values=available' \
    --query 'Vpcs[0].VpcId'
)}

export SUBNETS=${SUBNETS:=$(
  aws ec2 describe-subnets \
    --output text \
    --filters "Name=state,Values=available,Name=vpc-id,Values=$VPCID" \
    --query 'Subnets[*].SubnetId' | \
    tr -s '[:blank:]' ','
)}

sam package \
  --region ${AWS_DEFAULT_REGION} \
  --template-file ./.aws-sam/build/template.yaml \
  --output-template-file ./.aws-sam/build/packaged.yaml \
  --s3-bucket $CLOUDFORMATION_BUCKET \
  --s3-prefix "APPNAMEHERE-${RAILS_ENV}"

sam deploy \
  --template-file ./.aws-sam/build/packaged.yaml \
  --stack-name "APPNAMEHERE-${RAILS_ENV}-${AWS_DEFAULT_REGION}" \
  --capabilities "CAPABILITY_IAM" \
  --parameter-overrides \
    RailsEnv=${RAILS_ENV} \
    VpcId=${VPCID} \
    Subnets=${SUBNETS}

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
lamby-2.2.2 lib/lamby/templates/alb/deploy
lamby-2.2.1 lib/lamby/templates/alb/deploy
lamby-2.2.0 lib/lamby/templates/alb/deploy
lamby-2.1.0 lib/lamby/templates/alb/deploy
lamby-2.0.1 lib/lamby/templates/alb/deploy
lamby-2.0.0 lib/lamby/templates/alb/deploy
lamby-no-rails-1.0.3 lib/lamby/templates/application_load_balancer/deploy