Last active
July 26, 2016 14:10
-
-
Save achauve/a53f1ca20871eae17d5f1bd415e0b0d8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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