-
Notifications
You must be signed in to change notification settings - Fork 25
Home
Welcome to the devops-weekend-session wiki!
- create a ec2 server (build machine) install the required tools sudo yum update -y sudo yum install git -y sudo yum install java-11-amazon-corretto-headless -y sudo wget https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/apache-maven-3.8.5-bin.tar.gz tar xvf apache-maven-3.8.5-bin.tar.gz vi ~/.bashrc source ~/.bashrc export PATH=$PATH:/home/ec2-user/apache-maven-3.8.5/bin mvn --version
git clone https://github.com/bcreddydevops/devops-weekend-session.git cd devops-weekend-session/ mvn clean install cd target/ java -jar devops-weekend-session-0.0.1-SNAPSHOT.jar
step2: push artifact to s3 bucket create bucket bcreddy-devops-weekend-session
we need permission form ec2 to s3 for the we need to create iam role ex:ec2-s3-role once its created you have to attach to ec2 select server->actions->security->modify iam role
now upload jar file to s3 bucket from target folder aws s3 cp devops-weekend-session-0.0.1-SNAPSHOT.jar s3://bcreddy-devops-weekend-session now check the s3 bucket updated successfully or not .
#To pull the image the from s3 project to vm s3://bcreddy-devops-weekend-session/devops-weekend-session-0.0.1-SNAPSHOT.jar
add the application port in the security group http://54.82.110.155:33333/listallcustomers
step3:build the docker image sudo yum install docker sudo service docker start sudo service docker status sudo chmod 777 /var/run/docker.sock docker build -t chinnareddaiah/devops-weekend-session:v1 . docker login -u chinnareddaiah docker push chinnareddaiah/devops-weekend-session:v1 docker container run --name=demo-pp -p 33333:33333 -d chinnareddaiah/devops-weekend-session:v1 docker container logs cbfa4d8839ce
docker pull chinnareddaiah/devops-weekend-session:v1