Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d3da71f
ECR image updated
anand40090 Mar 29, 2023
e54b9dd
02-05-2023
anand40090 May 2, 2023
97b1163
RM#02-05-2023
anand40090 May 2, 2023
cb07ee4
p1.yml
anand40090 May 9, 2023
4372ae4
Create hosts
anand40090 May 9, 2023
6d5bfb5
Update hosts
anand40090 May 9, 2023
682b663
Update hosts
anand40090 May 9, 2023
4204f84
Update hosts
anand40090 May 9, 2023
1275a2f
Update hosts
anand40090 May 10, 2023
46cc699
Update hosts
anand40090 May 10, 2023
6937bee
Update hosts
anand40090 May 10, 2023
58842c7
Update hosts
anand40090 May 10, 2023
b3d8738
Update hosts
anand40090 May 10, 2023
a6934dd
Update hosts
anand40090 May 10, 2023
89fa6a2
hosts updates
anand40090 May 23, 2023
b9dc7d7
Update hosts
anand40090 May 23, 2023
b0b2eaa
Update hosts
anand40090 May 23, 2023
42a6d71
Update hosts
anand40090 May 23, 2023
ac2a522
Update hosts
anand40090 May 23, 2023
30af938
Update p1.yml
anand40090 May 23, 2023
0438dd6
Update p1.yml
anand40090 May 23, 2023
3994abc
Update hosts
anand40090 May 23, 2023
114b1e2
Update hosts
anand40090 May 23, 2023
65ccd83
Update hosts
anand40090 May 23, 2023
d4128cc
Update hosts
anand40090 May 24, 2023
0145afd
Update sonar-project.properties
anand40090 May 24, 2023
908e1ba
Update sonar-project.properties
anand40090 May 24, 2023
6993711
Update sonar-project.properties
anand40090 May 24, 2023
4474f59
Update hosts - 3.111.31.23
anand40090 Jun 5, 2023
da5b85d
Create webhook-test
anand40090 Jul 23, 2023
8c69ba3
Update webhook-test
anand40090 Jul 23, 2023
f8641c4
Update webhook-test
anand40090 Jul 23, 2023
4b26cb5
Update webhook-test
anand40090 Jul 23, 2023
9d066e2
Update webhook-test
anand40090 Jul 23, 2023
b600bc3
Create test1
anand40090 Aug 6, 2023
d944b3c
Create Test1
anand40090 Aug 6, 2023
9b8f45c
add
Aug 6, 2023
396de10
test1
Aug 6, 2023
a9508c0
Update test1
anand40090 Aug 6, 2023
6ad620b
add
Aug 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Blue/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM nginx

## Step 1:
RUN rm /usr/share/nginx/html/index.html

## Step 2:
# Copy source code to working directory
COPY index.html /usr/share/nginx/html

37 changes: 37 additions & 0 deletions Blue/blue-controller.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"kind":"ReplicationController",
"apiVersion":"v1",
"metadata":{
"name":"blue",
"labels":{
"app":"blue"
}
},
"spec":{
"replicas":1,
"selector":{
"app":"blue"
},
"template":{
"metadata":{
"labels":{
"app":"blue"
}
},
"spec":{
"containers":[
{
"name":"blue",
"image":"andresaaap/testblueimage",
"ports":[
{
"name":"http-server",
"containerPort":80
}
]
}
]
}
}
}
}
9 changes: 9 additions & 0 deletions Blue/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Capstone project</title>
</head>
<body style="background: blue;">
<p>Hello World, my name is Alvaro Pinzon</p>
</body>
</html>
15 changes: 15 additions & 0 deletions Blue/run_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

## Complete the following steps to get Docker running locally

# Step 1:
# Build image and add a descriptive tag
docker build --tag=testblueimage .

# Step 2:
# List docker images
docker image ls

# Step 3:
# Run flask app
docker run -p 8000:80 testblueimage
6 changes: 6 additions & 0 deletions Blue/run_kubernetes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# Step 2
# Run the Docker Hub container with kubernetes
kubectl apply -f ./blue-controller.json


2 changes: 2 additions & 0 deletions Blue/test1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
iiiii jjjjjjJQJji
udffuuf
18 changes: 18 additions & 0 deletions Blue/upload_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# This file tags and uploads an image to Docker Hub

# Assumes that an image is built via `run_docker.sh`

# Step 1:
# Create dockerpath
# dockerpath=<your docker ID/path>
dockerpath=testblueimage

# Step 2:
# Authenticate & tag
echo "Docker ID and Image: $dockerpath"
docker login --username anand40090
docker tag testblueimage anand40090/testblueimage
# Step 3:
# Push image to a docker repository
docker push anand40090/testblueimage
9 changes: 9 additions & 0 deletions Green/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM nginx

## Step 1:
RUN rm /usr/share/nginx/html/index.html

## Step 2:
# Copy source code to working directory
COPY index.html /usr/share/nginx/html

1 change: 1 addition & 0 deletions Green/Test1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

37 changes: 37 additions & 0 deletions Green/green-controller.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"kind":"ReplicationController",
"apiVersion":"v1",
"metadata":{
"name":"green",
"labels":{
"app":"green"
}
},
"spec":{
"replicas":1,
"selector":{
"app":"green"
},
"template":{
"metadata":{
"labels":{
"app":"green"
}
},
"spec":{
"containers":[
{
"name":"green",
"image":"andresaaap/testgreenimage",
"ports":[
{
"name":"http-server",
"containerPort":80
}
]
}
]
}
}
}
}
9 changes: 9 additions & 0 deletions Green/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Capstone project</title>
</head>
<body style="background: green;">
<p>Hello World, my name is Alvaro Pinzon</p>
</body>
</html>
15 changes: 15 additions & 0 deletions Green/run_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

## Complete the following steps to get Docker running locally

# Step 1:
# Build image and add a descriptive tag
docker build --tag=testgreenimage .

# Step 2:
# List docker images
docker image ls

# Step 3:
# Run flask app
docker run -p 8000:80 testgreenimage
6 changes: 6 additions & 0 deletions Green/run_kubernetes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# Step 2
# Run the Docker Hub container with kubernetes
kubectl apply -f ./green-controller.json


18 changes: 18 additions & 0 deletions Green/upload_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# This file tags and uploads an image to Docker Hub

# Assumes that an image is built via `run_docker.sh`

# Step 1:
# Create dockerpath
# dockerpath=<your docker ID/path>
dockerpath=testgreenimage

# Step 2:
# Authenticate & tag
echo "Docker ID and Image: $dockerpath"
docker login --username anand40090
docker tag testgreenimage anand40090/testgreenimage
# Step 3:
# Push image to a docker repository
docker push anand40090/testgreenimage
2 changes: 2 additions & 0 deletions hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[ciservers]
3.111.31.23 ansible_user=root
12 changes: 12 additions & 0 deletions p1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
- hosts: ciservers
become: true
tasks:
- name: Log into AWS ECR docker registry
ansible.builtin.shell: aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 400150977086.dkr.ecr.ap-south-1.amazonaws.com
- name: pull ecr image
command: docker pull 400150977086.dkr.ecr.ap-south-1.amazonaws.com/springboot:38
- name: Delete existing container
command: docker rm -f tt
- name: Create a docker container
command: docker run -itd --name tt -p 8080:8080 400150977086.dkr.ecr.ap-south-1.amazonaws.com/springboot:38
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# must be unique in a given SonarQube instance
sonar.projectKey=springboot-maven-course-micro-svc

# --- optional properties ---
# --- optional properties ----

# defaults to project key
#sonar.projectName=springboot-maven-course-micro-svc
Expand Down
2 changes: 1 addition & 1 deletion springboot-deployment-ecr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ spec:
spec:
containers:
- name: springboot
image: 811502318109.dkr.ecr.us-east-1.amazonaws.com/devopsdemocicd:5
image: 400150977086.dkr.ecr.ap-south-1.amazonaws.com/springboot:18
ports:
- containerPort: 8080
2 changes: 2 additions & 0 deletions webhook-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bdgsgdfgd
fgffzdgzdfdzt