set up access and secret key in credentials.tf
:
variable "aws_access_key" {
description = "aws access key"
default = "XXX"
}
variable "aws_secret_key" {
description = "aws_secret_key"
default = "XXX"
}
terraform init
# terraform plan
terraform apply
curl <public-ip-output>
Hello World
[X] create new github repo which contains only spring boot app with maven ( take it from jenkinsFile-helloWorld repo)
- Create in that repo, jenkinsFile and teraform file for the deployment from jenkins
- Divide the job to 2 main phases:
- build, test ,create docker image and push to docker-registry/nexus
- configure the teraform script to pull and run the docker image
- Configure jenkins to install the terraform tool automatically ( low priority )
- Install & run docker/docker-compose under ec2-user permissions ( currently everything runs on root )