Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Dev 3 deployment in dockerswarm #111

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ca0f12f
Create Dockerfile
riteshk0398 Jun 30, 2021
81f1b82
Create Jenkinsfile
riteshk0398 Jun 30, 2021
14a3fe2
Update Jenkinsfile
riteshk0398 Jun 30, 2021
006f4d2
Update Jenkinsfile
riteshk0398 Jun 30, 2021
372e91d
Update Jenkinsfile
riteshk0398 Jun 30, 2021
4e30901
Update Jenkinsfile
riteshk0398 Jun 30, 2021
8152bba
Update Jenkinsfile
riteshk0398 Jul 1, 2021
ffe6bf7
Merge pull request #1 from riteshk0398/development
riteshk0398 Jul 1, 2021
a53092c
Update index.html
riteshk0398 Jul 1, 2021
2f7c502
Update index.html
riteshk0398 Jul 1, 2021
a32c2f0
Update index.css
riteshk0398 Jul 1, 2021
adc8e03
Update Button.css
riteshk0398 Jul 1, 2021
2bc459f
Update index.html
riteshk0398 Jul 1, 2021
66f7bb1
Merge branch 'master' into development
riteshk0398 Jul 1, 2021
37a7b85
Merge pull request #2 from riteshk0398/development
riteshk0398 Jul 1, 2021
75f4016
Update index.html
riteshk0398 Jul 2, 2021
c37569c
Merge pull request #3 from riteshk0398/development
riteshk0398 Jul 2, 2021
ec39293
Update Jenkinsfile
riteshk0398 Aug 31, 2021
d9fa840
Merge pull request #5 from riteshk0398/development
riteshk0398 Aug 31, 2021
ac7d529
Update Jenkinsfile
riteshk0398 Aug 31, 2021
1bffeda
Update Jenkinsfile
riteshk0398 Aug 31, 2021
4bf31a6
Merge branch 'master' into development
riteshk0398 Aug 31, 2021
56fbede
Merge pull request #6 from riteshk0398/development
riteshk0398 Aug 31, 2021
d570575
Update Jenkinsfile
riteshk0398 Aug 31, 2021
4189ed2
Update Jenkinsfile
riteshk0398 Aug 31, 2021
07f511b
Update Jenkinsfile
riteshk0398 Aug 31, 2021
cc3220c
Update Jenkinsfile
riteshk0398 Oct 12, 2021
f540221
Update Jenkinsfile
riteshk0398 Oct 12, 2021
633a661
Merge branch 'DEV-3-deployment-in-dockerswarm' into master
riteshk0398 Oct 12, 2021
723d1b3
Merge pull request #9 from riteshk0398/master
riteshk0398 Oct 12, 2021
cf3c13e
Update Jenkinsfile
riteshk0398 Oct 12, 2021
95dae63
Update index.html
riteshk0398 Oct 13, 2021
f5fb627
Merge pull request #10 from riteshk0398/development
riteshk0398 Oct 13, 2021
5c05184
Update index.html
riteshk0398 Oct 16, 2021
29d7b3a
Merge pull request #12 from riteshk0398/development
riteshk0398 Oct 16, 2021
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
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#Build
FROM node:10-alpine
WORKDIR /app
COPY package.json .
RUN npm install
COPY . .
RUN npm run build
###########################
#Deploy
FROM nginx
COPY --from=0 /app/build /usr/share/nginx/html/
WORKDIR /usr/share/nginx/html/calculator
RUN mv ../static .
EXPOSE 80
49 changes: 49 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
pipeline {
environment {
registry = "riteshk0398/calculator"
registryCredential = 'dockerhub'


}
agent any
stages {
stage('Building image') {
steps{
sh "printenv"

sh "docker build -t riteshk03/calculator1:$BUILD_ID-$BRANCH_NAME ."
//sh "docker run -dp 80:80 riteshk03/calculator:$BUILD_ID-$BRANCH_NAME"
sh "docker push riteshk03/calculator1:$BUILD_ID-$BRANCH_NAME"
}
}
stage('Creating Deployment') {
steps {

sh '''#!/bin/bash

if [[ $GIT_BRANCH == "development" ]]
then

kubectl set image deployment/aes-app nginx=riteshk03/calculator1:$BUILD_ID-$BRANCH_NAME -n $BRANCH_NAME
elif [[ $GIT_BRANCH == "DEV-3-deployment-in-dockerswarm" ]]
then
kubectl set image deployment/aes-app nginx=riteshk03/calculator1:$BUILD_ID-$BRANCH_NAME -n jira
elif [[ $GIT_BRANCH == "master" ]]
then
kubectl set image deployment/aes-app nginx=riteshk03/calculator1:$BUILD_ID-$BRANCH_NAME -n production

fi
'''
}
}

stage('') {
steps{
sh '''

kubectl get svc -n $BRANCH_NAME
'''
}
}
}
}
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, user-scalable=no">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<title>React Calculator</title>
<title>This is Calculator</title>
</head>
<body>
<noscript>
Expand Down
2 changes: 1 addition & 1 deletion src/component/Button.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
}

.component-button.orange button {
background-color: #f5923e;
background-color: #503ef5;
color: white;
}
2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ html {
}

body {
background-color: black;
background-color: red;
margin: 0;
padding: 0;
font-family: sans-serif;
Expand Down