Skip to content

Commit

Permalink
cicd added with jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
shaheennabi committed Oct 14, 2024
1 parent ba283fc commit 8c030fc
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pipeline {
stage('Continuous Deployment') {
steps {
sshagent(['ssh_key']) {
sh "ssh -o StrictHostKeyChecking=no -l ubuntu 54.80.194.59 'cd /home/ubuntu/ && wget https://raw.githubusercontent.com/entbappy/End-to-end-Object-Detection-Project/main/docker-compose.yml && export IMAGE_NAME=${ECR_REPOSITORY}:latest && aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin ${AWS_ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com && docker compose up -d '"
sh "ssh -o StrictHostKeyChecking=no -l ubuntu 52.55.47.4 'cd /home/ubuntu/ && wget https://raw.githubusercontent.com/shaheennabi/Object_detection-End-to-End-project/refs/heads/main/docker-compose.yml && export IMAGE_NAME=${ECR_REPOSITORY}:latest && aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin ${AWS_ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com && docker compose up -d '"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/ec2_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sudo sh get-docker.sh

sudo usermod -aG docker $USER

newgrp docker
sudo usermod -aG docker $USER

sudo apt install awscli -y

Expand Down
47 changes: 47 additions & 0 deletions scripts/jenkins.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!bin/bash

sudo apt update

sudo apt install openjdk-8-jdk -y

https://pkg.jenkins.io/
https://pkg.jenkins.io/debian-stable/

sudo systemctl start jenkins

sudo systemctl enable jenkins

sudo systemctl status jenkins



## Installing Docker

curl -fsSL https://get.docker.com -o get-docker.sh

sudo sh get-docker.sh

sudo usermod -aG docker $USER

sudo usermod -aG docker jenkins


newgrp docker

sudo apt install awscli -y

sudo usermod -a -G docker jenkins


## AWS configuration & restarts jenkins

aws configure


## Now setup elastic IP on AWS



## For getting the admin password for jenkins

sudo cat /var/lib/jenkins/secrets/initialAdminPassword

0 comments on commit 8c030fc

Please sign in to comment.