-
Notifications
You must be signed in to change notification settings - Fork 13
Assignment 7
Dan Carr edited this page Feb 28, 2017
·
1 revision
- Student has Github account
- Student has a DockerHub account
- Student has an AWS account
- Student has Docker installed.
- Adequate bandwidth. This is not a cafe exercise.
- Student has completed Assignment 6
- EC2 Container Service Deployment
- Delete current repo if you have it already
- Go to this repo and Fork it
https://github.com/pdxdiver/ecs-push
- Copy the link of your forked copy of the repo and clone it
git clone https://github.com/[YOUR_USERNAME]/ecs-push.git
cd ecs-push
- Sign up for Docker Hub account @ https://hub.docker.com
- Create a repository called
django-web
- Remember your repository name, username and password
- Create secrets environment variables script
mv secrets.template.sh secrets.sh
- Change to your credentials - Create environment variables script
mv env.template.sh env.sh
- change:
DOCKER_REPO
to your docker repo
DOCKER_USERNAME
to your docker username
AWS_KEY_PAIR
to your AWS Keypair
- From the project root directory source your secrets config script
source ./bin/secrets.sh
- From the project root directory run the ecs-cli config script
./bin/config-ecs-cli.sh
-
Verify that the CLI is working properly:
ecs-cli --version
-
Then initiate the tests:
./bin/test-proj.sh
- From the project root directory run the ecs-cli config script
./bin/standup-ecs-cluster.sh
Wait for the script to finish:
- Go to the AWS Console|Compute|EC2 Container Service and inspect your ECS Cluster
- Go to the AWS Console|Management Tools|Cloudformation and check to see that your stack
assign-7-hacko
has been created with a status ofCREATE_COMPLETE
- Go to https://travis-ci.org
- Hook up your repo to Travis
- Click on + next to "My Repositories"
- Click on the "gear" icon next to your repository
- Configure environment variables
Create the following environment variables:
ECS CLUSTER
replacing with assign7-hacko
DOCKER_USERNAME
with your docker hub user name
DOCKER_PASSWORD
with your docker hub password
AWS_ACCESS_KEY_ID
with your aws access key id
AWS_SECRET_ACCESS_KEY
with your aws secret access key
NOTE: Make sure that your AWS and Docker Hub credentials are not visible.
Check your code in:
git add .
git commit -m 'some random ecs deploy test'
git push
Watch the travis console. When it completes swap over to your AWS Console|Compute|ECS Cluster
- Click on the
assign7-hacko
cluster - Click on the
assign7
service - Click on the
assign7:1
task definition - Click on the
web
container - Click on the
external link
address and you should see your DRF API up and running
ecs-cli down --force