#!/usr/bin/env ruby require_relative "../lib/mobile_workflow_cli/aws_backend" require_relative "../lib/mobile_workflow_cli/heroku_backend" # Byebug for dev begin require 'byebug' rescue LoadError end if ARGV.count < 2 || ['-h', '--help'].include?(ARGV[0]) puts "USAGE: mwf_s3 " exit 0 elsif ARGV.count == 2 app_name = ARGV[1] aws = AwsBackend.new(app_name: app_name, region: 'us-east-1') if ARGV[0] == 'create' aws.create heroku = HerokuBackend.new(app_name: app_name) heroku.configure_activestorage aws.create_topic_subscription(heroku.notifications_endpoint) aws.put_env elsif ARGV[0] == 'destroy' aws.destroy end exit 0 end