To deploy a change to an app to stage, in the current workflow, you'd do the following:
- Accept our previous github invitation for user
l85mat https://github.com/gruntwork-io git clone https://github.com/gruntwork-io/sample-app-tesla && cd sample-app-tesladocker-compose up- Open http://localhost:3000 to see the app.
- Make whatever changes you want and refresh your browser. A good file to change is
app/index.html. git commit -am "some commit message"git push- Normally, this would kick off a build in Jenkins which would automatically push a new Docker image to ECR and then auto-deploy to stage or prod. But because we haven't configured Jenkins yet, you would manually deploy as follows:
- Login your local environment to ECR:
aws ecr get-login --region us-east-1 cd sample-app-tesla- Build the new Docker image:
docker build -t sample-app-tesla . - Tag it:
docker tag sample-app-tesla:latest 427672229586.dkr.ecr.us-east-1.amazonaws.com/sample-app-tesla:latest - Push it to Amazon ECR:
docker push 427672229586.dkr.ecr.us-east-1.amazonaws.com/sample-app-tesla:latest - Change this value in
terraform.tfvarsto the new docker image tag value (e.g.latest). - From this directory, run
terraform apply. - Amazon ECS will auto-deploy to http://stage.gruntwork-tesla.com/
- Login your local environment to ECR: