Skip to content

Instantly share code, notes, and snippets.

Avatar

dennismclaugh

View GitHub Profile
View read_parameters_from_aws.rb
require 'aws-sdk-ssm'
class AWSHelper
@@ssm_parameters = []
@@test_environment = nil
# Reads and stores Parameter Store values for a particular path.
def self.load_ssm_parameters(test_environment)
@@test_environment = test_environment
@dennismclaugh
dennismclaugh / save_parameters_to_aws.sh
Last active Apr 8, 2019
Short script that demonstrates how to save secrets up in AWS Parameter Store.
View save_parameters_to_aws.sh
# This script will automatically add and update secrets in the AWS Parameter Store.
# Example: "./set_parameters_to_aws.sh test_environment.txt" will store the secrets at path /WebDriver_Tests/my_parameters
#
# Check if an input file was specified
if [ $# -eq 0 ] || [ ! -f $1 ]; then
echo
echo "No test environment specified or config file not found. Example usage '$ set_parameters_to_aws.sh tesT_environment.txt'"
echo
exit 1
View store_file_in_s3
require 'aws-sdk-s3'
# Saves a file to an AWS S3 bucket.
def store_file_in_s3
Aws.config.update({
region: 'us-east-1'
credentials: Aws::Credentials.new('AWS_ACCESS_KEY_GOES_HERE', 'AWS_SECRET_KEY_GOES_HERE')
})
bucketname = 'my_s3_bucket'
@dennismclaugh
dennismclaugh / dockerfile
Last active Jan 17, 2020
Dockerfile based on Alpine Linux complete with Ruby, Watir Webdriver, Shopify API, Chrome, and Firefox. https://www.dennismclaughlin.tech/build-docker-image-ruby-watir-webdriver-shopify-and-chrome/
View dockerfile
FROM alpine:latest
# Point to specific Alpine Package repositories for Chromium and Firefox.
RUN apk update && apk upgrade \
&& echo @latest-stable http://nl.alpinelinux.org/alpine/latest-stable/community >> /etc/apk/repositories \
&& echo @latest-stable http://nl.alpinelinux.org/alpine/latest-stable/main >> /etc/apk/repositories \
&& echo @edge-testing http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories \
&& echo @edge-main http://dl-cdn.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories
# Install Ruby dev environment