Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #4

Open
wants to merge 152 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
e0961f6
Update Jenkinsfile
PottaAkhil Oct 18, 2022
4f19b92
Update Jenkinsfile
PottaAkhil Oct 18, 2022
53fc2b7
Update Jenkinsfile
PottaAkhil Oct 18, 2022
f1a5385
Update Jenkinsfile
PottaAkhil Oct 18, 2022
5e9f108
Update Jenkinsfile
PottaAkhil Oct 18, 2022
be75c3e
Update Jenkinsfile
PottaAkhil Oct 18, 2022
228d17d
Update Jenkinsfile
PottaAkhil Oct 18, 2022
0d8d4a0
Update Jenkinsfile
PottaAkhil Oct 18, 2022
9ffcc73
Update Jenkinsfile
PottaAkhil Oct 18, 2022
b485e55
Update Jenkinsfile
PottaAkhil Oct 19, 2022
6b80237
Update Jenkinsfile
PottaAkhil Oct 19, 2022
5870cfd
Update Jenkinsfile
PottaAkhil Oct 19, 2022
d11a004
Update Jenkinsfile
PottaAkhil Oct 19, 2022
446b17d
Update Jenkinsfile
PottaAkhil Oct 19, 2022
8757f27
Update Jenkinsfile
PottaAkhil Oct 19, 2022
a895af2
Create deploymentservice.yaml
PottaAkhil Oct 20, 2022
bd718a6
Update Jenkinsfile
PottaAkhil Oct 20, 2022
d3c35cf
Update Jenkinsfile
PottaAkhil Oct 20, 2022
358e386
Update Jenkinsfile
PottaAkhil Oct 20, 2022
a7bc18f
Update Jenkinsfile
PottaAkhil Oct 20, 2022
7e5e6ff
Update Jenkinsfile
PottaAkhil Oct 20, 2022
664ef42
Update Jenkinsfile
PottaAkhil Oct 20, 2022
ac087c3
Update Jenkinsfile
PottaAkhil Oct 20, 2022
79b39b2
Update Jenkinsfile
PottaAkhil Oct 20, 2022
b5d4fab
Update Jenkinsfile
PottaAkhil Oct 20, 2022
72c3bc5
Update Jenkinsfile
PottaAkhil Oct 20, 2022
2e7bb98
Update Jenkinsfile
PottaAkhil Oct 20, 2022
469d089
Update Jenkinsfile
PottaAkhil Oct 20, 2022
e0a7ac2
Update Jenkinsfile
PottaAkhil Oct 20, 2022
fab6689
Update Jenkinsfile
PottaAkhil Oct 20, 2022
c68074e
Update Jenkinsfile
PottaAkhil Oct 20, 2022
85e9fb9
Update Jenkinsfile
PottaAkhil Oct 20, 2022
d52ce22
Update Jenkinsfile
PottaAkhil Oct 20, 2022
5e5e80d
Update Jenkinsfile
PottaAkhil Oct 20, 2022
bcfa3cc
Update Jenkinsfile
PottaAkhil Oct 20, 2022
dd856bf
Update Jenkinsfile
PottaAkhil Oct 20, 2022
cb7914d
Update deploymentservice.yaml
PottaAkhil Oct 20, 2022
1380993
Update Jenkinsfile
PottaAkhil Oct 20, 2022
2722c30
Update Jenkinsfile
PottaAkhil Oct 20, 2022
6614e5d
Update Jenkinsfile
PottaAkhil Oct 20, 2022
0344c7d
Update Jenkinsfile
PottaAkhil Oct 31, 2022
1a6a9d6
Update Jenkinsfile
PottaAkhil Oct 31, 2022
c91bf89
Update Jenkinsfile
PottaAkhil Nov 1, 2022
374304a
Update Jenkinsfile
PottaAkhil Nov 1, 2022
b8960bd
Update Jenkinsfile
PottaAkhil Nov 1, 2022
a02a661
Update Jenkinsfile
PottaAkhil Nov 1, 2022
3de8122
Update Jenkinsfile
PottaAkhil Nov 1, 2022
c5b86e6
Update Jenkinsfile
PottaAkhil Nov 1, 2022
3f7af40
Update Jenkinsfile
PottaAkhil Nov 1, 2022
be9d531
Update Jenkinsfile
PottaAkhil Nov 1, 2022
ae1233f
Update Jenkinsfile
PottaAkhil Nov 1, 2022
e7deff2
Update deploymentservice.yaml
PottaAkhil Nov 1, 2022
0f20dc6
Update Jenkinsfile
PottaAkhil Nov 1, 2022
b14d75f
Update Jenkinsfile
PottaAkhil Nov 1, 2022
27cf41c
Update Jenkinsfile
PottaAkhil Nov 1, 2022
e53d24e
Update Jenkinsfile
PottaAkhil Nov 1, 2022
2520b0c
Update Jenkinsfile
PottaAkhil Nov 1, 2022
eaa1008
Update Jenkinsfile
PottaAkhil Nov 1, 2022
17f3d87
Update Jenkinsfile
PottaAkhil Nov 1, 2022
66226fb
Update Jenkinsfile
PottaAkhil Nov 1, 2022
c873811
Update Jenkinsfile
PottaAkhil Nov 1, 2022
292be19
Update Jenkinsfile
PottaAkhil Nov 1, 2022
b3467e8
Update Jenkinsfile
PottaAkhil Nov 1, 2022
5d3086e
Update Jenkinsfile
PottaAkhil Nov 1, 2022
540e2d4
Update Jenkinsfile
PottaAkhil Nov 1, 2022
7009e25
Update Jenkinsfile
PottaAkhil Nov 1, 2022
0faefb3
Update Jenkinsfile
PottaAkhil Nov 1, 2022
a50199a
Update Jenkinsfile
PottaAkhil Nov 1, 2022
e624a93
Update Jenkinsfile
PottaAkhil Nov 1, 2022
64c4f68
Update Jenkinsfile
PottaAkhil Nov 1, 2022
1f54836
Update Jenkinsfile
PottaAkhil Nov 1, 2022
5a99881
Update Jenkinsfile
PottaAkhil Nov 1, 2022
950dc86
Update Jenkinsfile
PottaAkhil Nov 1, 2022
62ed19f
Update Jenkinsfile
PottaAkhil Nov 1, 2022
6f12bab
Update Jenkinsfile
PottaAkhil Nov 1, 2022
e6c21be
Update Jenkinsfile
PottaAkhil Nov 1, 2022
2617174
Update Jenkinsfile
PottaAkhil Nov 1, 2022
b57a3e2
Update Jenkinsfile
PottaAkhil Nov 1, 2022
f5e118d
Update Jenkinsfile
PottaAkhil Nov 1, 2022
7cfa8aa
Update Jenkinsfile
PottaAkhil Nov 1, 2022
bf2c359
Update Jenkinsfile
PottaAkhil Nov 1, 2022
427c36c
Update Jenkinsfile
PottaAkhil Nov 2, 2022
0982a94
Update Jenkinsfile
PottaAkhil Nov 2, 2022
93a434a
Update deploymentservice.yaml
PottaAkhil Nov 2, 2022
d2b0258
Update deploymentservice.yaml
PottaAkhil Nov 2, 2022
9b8133e
Create buildspec.yaml
PottaAkhil Nov 2, 2022
1ef13df
Update Jenkinsfile
PottaAkhil Nov 2, 2022
96b6224
Update buildspec.yaml
PottaAkhil Nov 2, 2022
b7616fe
Update buildspec.yaml
PottaAkhil Nov 2, 2022
f78ac43
Rename buildspec.yaml to flux.yaml
PottaAkhil Nov 2, 2022
7042c6a
Update Jenkinsfile
PottaAkhil Nov 2, 2022
ee1e7ca
Update Jenkinsfile
PottaAkhil Nov 2, 2022
1c287b4
Update Jenkinsfile
PottaAkhil Nov 2, 2022
b9d767f
Update Jenkinsfile
PottaAkhil Nov 2, 2022
a748a3c
Update flux.yaml
PottaAkhil Nov 3, 2022
5c7e1ca
Update Jenkinsfile
PottaAkhil Nov 3, 2022
2af8908
Update deployment.yml
PottaAkhil Nov 3, 2022
e03e5c0
Update deployment.yml
PottaAkhil Nov 3, 2022
22a2eb0
Update Jenkinsfile
PottaAkhil Nov 3, 2022
390ecaa
Update Jenkinsfile
PottaAkhil Nov 3, 2022
c256347
Update deployment.yml
PottaAkhil Nov 3, 2022
4b3b108
Update deployment.yml
PottaAkhil Nov 3, 2022
cb36aac
Update Jenkinsfile
PottaAkhil Nov 3, 2022
0d942d9
Update Jenkinsfile
PottaAkhil Nov 3, 2022
ac18103
Update deployment.yml
PottaAkhil Nov 3, 2022
75dd5d3
Update deploymentservice.yaml
PottaAkhil Nov 3, 2022
92d1a51
Update Jenkinsfile
PottaAkhil Nov 3, 2022
3045ad6
Update flux.yaml
PottaAkhil Nov 4, 2022
f812450
Create ingress.yaml
PottaAkhil Nov 4, 2022
b4c5f2c
Create download NLB & jenkins
PottaAkhil Nov 4, 2022
f5814dc
Update Jenkinsfile
PottaAkhil Nov 7, 2022
061cba1
Update Jenkinsfile
PottaAkhil Nov 7, 2022
18e2f91
Update Jenkinsfile
PottaAkhil Nov 7, 2022
988e225
Update Jenkinsfile
PottaAkhil Nov 7, 2022
60899d1
Update deployment.yml
PottaAkhil Nov 7, 2022
910230e
Update Jenkinsfile
PottaAkhil Nov 8, 2022
04ffd56
Update Jenkinsfile
PottaAkhil Nov 8, 2022
c4f8739
Update Jenkinsfile
PottaAkhil Nov 8, 2022
8bbaebc
Update Jenkinsfile
PottaAkhil Nov 8, 2022
ea90582
Update Jenkinsfile
PottaAkhil Nov 8, 2022
2eb6608
Update Jenkinsfile
PottaAkhil Nov 8, 2022
f488806
Update Jenkinsfile
PottaAkhil Nov 8, 2022
78729c2
Update Jenkinsfile
PottaAkhil Nov 8, 2022
fd00357
Update Jenkinsfile
PottaAkhil Nov 8, 2022
4ae52f9
Update Jenkinsfile
PottaAkhil Nov 8, 2022
ef25a31
Update Jenkinsfile
PottaAkhil Nov 8, 2022
ac864cf
Update flux.yaml
PottaAkhil Nov 8, 2022
b004f23
Update Jenkinsfile
PottaAkhil Nov 8, 2022
7c2d260
Update Jenkinsfile
PottaAkhil Nov 8, 2022
1b5433d
Update deploymentservice.yaml
PottaAkhil Nov 8, 2022
a490f7c
Update Jenkinsfile
PottaAkhil Nov 8, 2022
195eef0
Update Jenkinsfile
PottaAkhil Nov 8, 2022
52f4621
Update Jenkinsfile
PottaAkhil Nov 8, 2022
0c5a5ec
Update Jenkinsfile
PottaAkhil Nov 8, 2022
877baaf
Update Jenkinsfile
PottaAkhil Nov 8, 2022
3916108
Update Jenkinsfile
PottaAkhil Nov 8, 2022
10b0f74
Update Jenkinsfile
PottaAkhil Nov 8, 2022
6b59997
Update Jenkinsfile
PottaAkhil Nov 8, 2022
d5eda30
Update Jenkinsfile
PottaAkhil Nov 8, 2022
5f1239d
Update Jenkinsfile
PottaAkhil Nov 8, 2022
5e52842
Update Jenkinsfile
PottaAkhil Nov 8, 2022
2932eb1
Update Jenkinsfile
PottaAkhil Nov 8, 2022
3215a78
Update Jenkinsfile
PottaAkhil Nov 8, 2022
209b374
Update Jenkinsfile
PottaAkhil Nov 8, 2022
f8ea60d
Update Jenkinsfile
PottaAkhil Nov 8, 2022
1dc656a
Update Jenkinsfile
PottaAkhil Nov 8, 2022
5cff9a2
Update Jenkinsfile
PottaAkhil Nov 8, 2022
eb569fc
Update Jenkinsfile
PottaAkhil Nov 8, 2022
ce4302a
Update Jenkinsfile
PottaAkhil Nov 8, 2022
c532628
Update Jenkinsfile
PottaAkhil Nov 8, 2022
d672afa
Update index.js
PottaAkhil Nov 9, 2022
3efaabc
Update Jenkinsfile
PottaAkhil Nov 9, 2022
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
98 changes: 68 additions & 30 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,73 @@
pipeline {
agent any
environment {
DOCKERHUB_CREDENTIALS = credentials('valaxy-dockerhub')
}
stages {
stage('SCM Checkout') {
steps{
git 'https://github.com/ravdy/nodejs-demo.git'
}
podTemplate(yaml: '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: nodejs
image: node:6-alpine
command:
- sleep
args:
- 999999
- name: kubectl
image: bitnami/kubectl
command:
- sleep
args:
- 9999999
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
command:
- sleep
args:
- 9999999
volumeMounts:
- name: kaniko-secret
mountPath: /kaniko/.docker
restartPolicy: Never
volumes:
- name: kaniko-secret
secret:
secretName: dockercred
items:
- key: .dockerconfigjson
path: config.json
''') {

node(POD_LABEL) {
stage('Get a nodejs project') {
git url: 'https://github.com/PottaAkhil/nodejs-OBT.git', branch: 'master'
container('nodejs') {
stage('Build a nodejs project') {
sh '''
echo pwd
'''
}
}
}
stage('SonarQube analysis') {
def scannerHome = tool 'sonarqube';
withSonarQubeEnv('sonarqube') {
sh "${scannerHome}/bin/sonar-scanner \
-D sonar.login=admin \
-D sonar.password=admin \
-D sonar.projectKey= nodejs \
-D sonar.exclusions=vendor/**,resources/**,**/*.js \
-D sonar.host.url=http://54.169.237.40:9000/"
}
}

stage('Build docker image') {
steps {
sh 'docker build -t valaxy/nodeapp:$BUILD_NUMBER .'
}
}
stage('login to dockerhub') {
steps{
sh 'echo $DOCKERHUB_CREDENTIALS_PSW | docker login -u $DOCKERHUB_CREDENTIALS_USR --password-stdin'
}
}
stage('push image') {
steps{
sh 'docker push valaxy/nodeapp:$BUILD_NUMBER'
}
}
}
post {
always {
sh 'docker logout'
stage('Build nodejs Image') {
container('kaniko') {
stage('Build a Go project') {
sh '''
/kaniko/executor --context `pwd` --destination 957288871734.dkr.ecr.ap-southeast-1.amazonaws.com/images:$BUILD_NUMBER && \
/kaniko/executor --context `pwd` --destination 957288871734.dkr.ecr.ap-southeast-1.amazonaws.com/images:latest
'''
}
}
}


}
}

41 changes: 41 additions & 0 deletions deploymentservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nodejs-k8s-Deployment
labels:
app: nodejs-k8s
annotations:
fluxcd.io/automated: "true"
spec:
selector:
matchLabels:
app: nodejs-k8s
replicas: 3
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: nodejs-k8s
spec:
containers:
- name: nodejs-k8s
image: 957288871734.dkr.ecr.ap-southeast-1.amazonaws.com/images
ports:
- containerPort: 80
protocol: TCP
imagePullPolicy: Always

apiVersion: v1
kind: Service
metadata:
name: nodejs-k8ssvc
spec:
selector:
app: nodejst-k8s
type: LoadBalancer
ports:
- protocol: "TCP"
port: 8080
targetPort: 8080
type: NodePort
2 changes: 2 additions & 0 deletions download NLB & jenkins
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://kubernetes.github.io/ingress-nginx/deploy/#digital-ocean ==== to download the Ngnix Load Balancer and attach it to the node
https://devopscube.com/jenkins-build-agents-kubernetes/ -setup jekins agent on
37 changes: 37 additions & 0 deletions flux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: awsome-app-flux
labels:
app: awsome-app-flux
annotations:
fluxcd.io/automated: "true"
spec:
replicas: 1
selector:
matchLabels:
app: awsome-app-flux
template:
metadata:
labels:
app: awsome-app-flux
spec:
containers:
- name: awsome-app-flux
image: 957288871734.dkr.ecr.ap-southeast-1.amazonaws.com/images:latest
ports:
- containerPort: 8080

---

apiVersion: v1
kind: Service
metadata:
name: awsome-app-flux-svc
spec:
selector:
app: awsome-app-flux
ports:
- protocol: "TCP"
port: 80
targetPort: 3000
20 changes: 20 additions & 0 deletions ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: simple-ingress
annotations:
kubernetes.io/ingress.class: nginx
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
spec:
rules:
- host:
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: awsome-app-flux-svc
port:
number: 80
2 changes: 1 addition & 1 deletion nodeapp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var express = require('express');
var app = express();

app.get('/', function (req, res) {
res.send('{ "response": "Hello, Welcome to Valaxy" }');
res.send('{ "response": "Hello, Welcome to Minfy" }');
});

app.get('/will', function (req, res) {
Expand Down