Skip to content

Instantly share code, notes, and snippets.

@achauve
Last active July 26, 2016 14:10
Show Gist options
  • Save achauve/a53f1ca20871eae17d5f1bd415e0b0d8 to your computer and use it in GitHub Desktop.
Save achauve/a53f1ca20871eae17d5f1bd415e0b0d8 to your computer and use it in GitHub Desktop.
machine:
environment:
CURRENT_IP: $(dig +short myip.opendns.com @resolver1.opendns.com)
dependencies:
override:
- pip install -r requirements.txt
# also install awscli tools
- pip install awscli==1.7.36
test:
pre:
# add current circleci instance public IP to AWS security group to be able to ssh a worker machine
- aws ec2 authorize-security-group-ingress --region=YOUR_AWS_REGION --group-name YOUR_SECURITY_GROUP_NAME --protocol tcp --port 22 --cidr $CURRENT_IP/32
# ssh tunnel to access AWS redshift for tests
- ssh -nNT -L YOUR_LOCAL_PORT:YOUR_REDSFHIT_HOST:YOUR_REDSHIFT_PORT YOUR_USER@YOUR_EC2_INSTANCE_IP:
background: true
post:
- aws ec2 revoke-security-group-ingress --region=YOUR_AWS_REGION --group-name YOUR_SECURITY_GROUP_NAME --protocol tcp --port 22 --cidr $CURRENT_IP/32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment