This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ruby:2.6 | |
RUN apt-get update && apt-get install libjemalloc1 && rm -rf /var/lib/apt/lists/* | |
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: pipeline-notifications | |
custom: | |
pipeline_name: "staging" | |
provider: | |
name: aws | |
runtime: ruby2.5 | |
stage: 'staging' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'aws-sdk-ecs' | |
require 'aws-sdk-rds' | |
def stop(event:, context:) | |
rds_client.stop_db_instance( | |
db_instance_identifier: ENV['DB_NAME'] | |
) | |
service_names.each do |service_name| | |
ecs_client.update_service( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: stopAndStartStaging | |
custom: | |
db_name: bloomandwild-staging | |
cluster_name: staging | |
provider: | |
name: aws | |
runtime: ruby2.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'aws-sdk-ecs' | |
def restart_service(event:, context:) | |
event['Records'].each { |record| process_record(record) } | |
{ statusCode: 200, body: JSON.generate('OK') } | |
end | |
def process_record(record) | |
record = Record.new(record) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: restartFargateServices | |
custom: | |
# SNS topic where the CloudWatch alarms will send messages when triggered | |
# We need the full Arn for the CloudFormation snippet that creates the alarms | |
snsTopic: "${self:service}-fargate-memory-alarms" | |
snsTopicArn: { "Fn::Join" : ["", ["arn:aws:sns:${self:provider.region}:", { "Ref" : "AWS::AccountId" }, ":${self:custom.snsTopic}" ] ] } | |
# Cluster and Service Fargate names that we want to monitor and restart | |
cluster_name: "my-cluster" | |
service_name: "my-service" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"containerDefinitions": [ | |
{ | |
"entryPoint": [ | |
"./docker/start-sidekiq.sh" | |
], | |
"portMappings": [], | |
"command": [ | |
"config/sidekiq.yml" | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "sidekiq" | |
Sidekiq.configure_server do |config| | |
# Touch a file so we know Sidekiq worker has started. | |
# Useful for health checks | |
config.on(:startup) do | |
FileUtils.touch(Rails.root.join("tmp", "pids", "sidekiq_started")) | |
end | |
# Delete the touched file so we know Sidekiq worker has stopped. | |
# Useful for health checks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"family": "redis-datadog", | |
"networkMode": "awsvpc", | |
"containerDefinitions": [ | |
{ | |
"name": "redis", | |
"image": "redis:latest", | |
"essential": true, | |
"dockerLabels": { | |
"com.datadoghq.ad.instances": "[{\"host\": \"%%host%%\", \"port\": 6379}]", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NilClass | |
def method_missing | |
raise StandardError "Ha, ha! Loser" | |
end | |
end |
NewerOlder