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

dd #28

Open
wants to merge 354 commits into
base: copilot
Choose a base branch
from
Open

dd #28

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
354 commits
Select commit Hold shift + click to select a range
9f1b8d1
Updated to the newer version
venkatkumarv Nov 24, 2024
07d6120
Updated to the newer version
venkatkumarv Nov 24, 2024
5a29803
Updated to the newer version
venkatkumarv Nov 24, 2024
e3946f9
Updated to the newer version
venkatkumarv Nov 24, 2024
be3d78a
Updated to the newer version
venkatkumarv Nov 24, 2024
123d3cf
Updated to the newer version
venkatkumarv Nov 24, 2024
2fb2cc8
Updated to the newer version
venkatkumarv Nov 24, 2024
51c7718
Updated to the newer version
venkatkumarv Nov 24, 2024
5ea89c8
Updated to the newer version
venkatkumarv Nov 24, 2024
025cc0a
Updated to the newer version
venkatkumarv Nov 24, 2024
16ae923
Updated to the newer version
venkatkumarv Nov 24, 2024
c5703b2
Updated to the newer version
venkatkumarv Nov 24, 2024
adcaf5b
Updated to the newer version
venkatkumarv Nov 24, 2024
ef49e7b
Updated to the newer version
venkatkumarv Nov 24, 2024
6828486
Updated to the newer version
venkatkumarv Nov 24, 2024
a9c4b73
Updated to the newer version
venkatkumarv Nov 24, 2024
becd368
Updated to the newer version
venkatkumarv Nov 24, 2024
06e2c15
Updated to the newer version
venkatkumarv Nov 24, 2024
ae18c79
Updated to the newer version
venkatkumarv Nov 24, 2024
25f297b
Updated to the newer version
venkatkumarv Nov 24, 2024
e1af6ca
Updated to the newer version
venkatkumarv Nov 24, 2024
66cd681
Updated to the newer version
venkatkumarv Nov 24, 2024
d711c75
Updated to the newer version
venkatkumarv Nov 24, 2024
2e1308a
Updated to the newer version
venkatkumarv Nov 24, 2024
ae368ae
Updated to the newer version
venkatkumarv Nov 24, 2024
30a02de
Updated to the newer version
venkatkumarv Nov 24, 2024
8035076
Updated to the newer version
venkatkumarv Nov 24, 2024
3330d2c
Updated to the newer version
venkatkumarv Nov 24, 2024
9ed9ea2
Updated to the newer version
venkatkumarv Nov 24, 2024
47baa9d
Updated to the newer version
venkatkumarv Nov 24, 2024
b69dbcc
Updated to the newer version
venkatkumarv Nov 24, 2024
d2b2970
Updated to the newer version
venkatkumarv Nov 24, 2024
52afefd
Updated to the newer version
venkatkumarv Nov 24, 2024
fecdc41
Updated to the newer version
venkatkumarv Nov 24, 2024
a8b3161
Updated to the newer version
venkatkumarv Nov 24, 2024
2f079d2
Updated to the newer version
venkatkumarv Nov 24, 2024
4b167cf
Updated to the newer version
venkatkumarv Nov 24, 2024
0cf0995
Updated to the newer version
venkatkumarv Nov 24, 2024
71e5306
Updated to the newer version
venkatkumarv Nov 24, 2024
cdf1db7
Updated to the newer version
venkatkumarv Nov 24, 2024
c720de8
Updated to the newer version
venkatkumarv Nov 24, 2024
4a99351
Updated to the newer version
venkatkumarv Nov 24, 2024
12bf7fc
Updated to the newer version
venkatkumarv Nov 24, 2024
623ae89
Updated to the newer version
venkatkumarv Nov 24, 2024
f6234ad
Updated to the newer version
venkatkumarv Nov 24, 2024
a9a69b8
Updated to the newer version
venkatkumarv Nov 24, 2024
29d3559
Updated to the newer version
venkatkumarv Nov 24, 2024
b604818
Updated to the newer version
venkatkumarv Nov 24, 2024
db1eef4
Updated to the newer version
venkatkumarv Nov 24, 2024
f241f9c
Updated to the newer version
venkatkumarv Nov 24, 2024
45011ec
Updated to the newer version
venkatkumarv Nov 24, 2024
982f428
Updated to the newer version
venkatkumarv Nov 24, 2024
50954f6
Updated to the newer version
venkatkumarv Nov 24, 2024
854e560
Updated to the newer version
venkatkumarv Nov 24, 2024
4a48333
Updated to the newer version
venkatkumarv Nov 24, 2024
c9b103c
Updated to the newer version
venkatkumarv Nov 24, 2024
34040ac
Updated to the newer version
venkatkumarv Nov 24, 2024
bf89596
Updated to the newer version
venkatkumarv Nov 24, 2024
f8f013c
Updated to the newer version
venkatkumarv Nov 24, 2024
f26514c
Updated to the newer version
venkatkumarv Nov 24, 2024
e6788b9
Updated to the newer version
venkatkumarv Nov 24, 2024
f6f6606
Updated to the newer version
venkatkumarv Nov 24, 2024
6d08c63
Updated to the newer version
venkatkumarv Nov 24, 2024
5a74711
Updated to the newer version
venkatkumarv Nov 24, 2024
aaabe92
Updated to the newer version
venkatkumarv Nov 24, 2024
78430fa
Updated to the newer version
venkatkumarv Nov 24, 2024
135b48c
Updated to the newer version
venkatkumarv Nov 24, 2024
5e5e5a3
Updated to the newer version
venkatkumarv Nov 24, 2024
1afdd0d
Updated to the newer version
venkatkumarv Nov 24, 2024
3cb23fb
Updated to the newer version
venkatkumarv Nov 24, 2024
4de3c9e
Updated to the newer version
venkatkumarv Nov 24, 2024
4cb0965
Updated to the newer version
venkatkumarv Nov 24, 2024
3bb756f
Updated to the newer version
venkatkumarv Nov 24, 2024
9a5dae3
Updated to the newer version
venkatkumarv Nov 24, 2024
11cbdca
Updated to the newer version
venkatkumarv Nov 24, 2024
417aa06
Updated to the newer version
venkatkumarv Nov 24, 2024
f69b517
Updated to the newer version
venkatkumarv Nov 24, 2024
9397014
Updated to the newer version
venkatkumarv Nov 24, 2024
2853dd5
Updated to the newer version
venkatkumarv Nov 24, 2024
54ffff1
Updated to the newer version
venkatkumarv Nov 24, 2024
74de3ec
Updated to the newer version
venkatkumarv Nov 24, 2024
ed1797b
Updated to the newer version
venkatkumarv Nov 24, 2024
5b65647
Updated to the newer version
venkatkumarv Nov 24, 2024
50dfc36
Updated to the newer version
venkatkumarv Nov 24, 2024
a6ae27b
Updated to the newer version
venkatkumarv Nov 24, 2024
6fe5d21
Updated to the newer version
venkatkumarv Nov 24, 2024
a25c0ac
Updated to the newer version
venkatkumarv Nov 24, 2024
bfd3b42
Updated to the newer version
venkatkumarv Nov 24, 2024
c4671be
Updated to the newer version
venkatkumarv Nov 24, 2024
cfc7a44
Updated to the newer version
venkatkumarv Nov 24, 2024
f237269
Updated to the newer version
venkatkumarv Nov 24, 2024
0ae3576
Updated to the newer version
venkatkumarv Nov 24, 2024
40d75d7
Updated to the newer version
venkatkumarv Nov 24, 2024
6f8d2c2
Updated to the newer version
venkatkumarv Nov 24, 2024
4709df6
Updated to the newer version
venkatkumarv Nov 24, 2024
20c1d73
Updated to the newer version
venkatkumarv Nov 24, 2024
feb6d9c
Updated to the newer version
venkatkumarv Nov 24, 2024
ce84a7a
Updated to the newer version
venkatkumarv Nov 24, 2024
9b01541
Updated to the newer version
venkatkumarv Nov 24, 2024
fa9b78a
Update JenkinsfileCI
maramvenkatareddy Nov 24, 2024
79d1e6c
Update JenkinsfileCI
maramvenkatareddy Nov 24, 2024
1e4fd61
Updated to the newer version
venkatkumarv Nov 24, 2024
d882d03
Updated to the newer version
venkatkumarv Nov 24, 2024
59961c3
Updated to the newer version
venkatkumarv Nov 24, 2024
5524fbd
Updated to the newer version
venkatkumarv Nov 24, 2024
f61d328
Updated to the newer version
venkatkumarv Nov 24, 2024
04ad1db
Updated to the newer version
venkatkumarv Nov 24, 2024
49d45ba
Updated to the newer version
venkatkumarv Nov 24, 2024
643cf28
Updated to the newer version
venkatkumarv Nov 24, 2024
4b357e0
Updated to the newer version
venkatkumarv Nov 24, 2024
9770ff6
Update JenkinsfileCI
maramvenkatareddy Nov 24, 2024
e8367f0
Updated to the newer version
venkatkumarv Nov 24, 2024
50c36d4
Updated to the newer version
venkatkumarv Nov 24, 2024
fbc6c50
Updated to the newer version
venkatkumarv Nov 24, 2024
0a8d0dd
Updated to the newer version
venkatkumarv Nov 24, 2024
aa758d3
Updated to the newer version
venkatkumarv Nov 24, 2024
f3c4da9
Updated to the newer version
venkatkumarv Nov 24, 2024
0cc4525
Updated to the newer version
venkatkumarv Nov 24, 2024
d25d788
Updated to the newer version
venkatkumarv Nov 24, 2024
e9ef638
Updated to the newer version
venkatkumarv Nov 24, 2024
046b4fc
Updated to the newer version
venkatkumarv Nov 24, 2024
282a865
Updated to the newer version
venkatkumarv Nov 24, 2024
86e89ec
Update JenkinsfileCI
maramvenkatareddy Nov 24, 2024
bb1b298
Updated to the newer version
venkatkumarv Nov 24, 2024
374b04b
Updated to the newer version
venkatkumarv Nov 24, 2024
8f2ec35
Updated to the newer version
venkatkumarv Nov 24, 2024
4d46b40
Updated to the newer version
venkatkumarv Nov 24, 2024
c001ec1
Updated to the newer version
venkatkumarv Nov 24, 2024
aadabbe
Updated to the newer version
venkatkumarv Nov 24, 2024
8d3593d
Updated to the newer version
venkatkumarv Nov 24, 2024
946a789
Updated to the newer version
venkatkumarv Nov 24, 2024
bc069b1
Updated to the newer version
venkatkumarv Nov 24, 2024
e9bdaf1
Updated to the newer version
venkatkumarv Nov 24, 2024
41c8e15
Updated to the newer version
venkatkumarv Nov 24, 2024
016d7ff
Updated to the newer version
venkatkumarv Nov 24, 2024
a6d4be1
Updated to the newer version
venkatkumarv Nov 24, 2024
785dbd3
Updated to the newer version
venkatkumarv Nov 24, 2024
0a25dcd
Update JenkinsfileCI
maramvenkatareddy Nov 24, 2024
dbf9663
Update JenkinsfileCI
maramvenkatareddy Nov 24, 2024
fd01603
Updated to the newer version
venkatkumarv Nov 24, 2024
7dbe62f
Updated to the newer version
venkatkumarv Nov 24, 2024
ec192f4
Update JenkinsfileCI
maramvenkatareddy Nov 24, 2024
ad491a7
Updated to the newer version
venkatkumarv Nov 24, 2024
20a5e5d
Updated to the newer version
venkatkumarv Nov 24, 2024
b46b456
Updated to the newer version
venkatkumarv Nov 24, 2024
654d084
Update JenkinsfileCI
maramvenkatareddy Nov 24, 2024
f1cd945
Updated to the newer version
venkatkumarv Nov 24, 2024
e1b0870
Updated to the newer version
venkatkumarv Nov 24, 2024
911b96d
Updated to the newer version
venkatkumarv Nov 24, 2024
af4c766
Update JenkinsfileCI
maramvenkatareddy Nov 24, 2024
8bc520e
Updated to the newer version
venkatkumarv Nov 24, 2024
26931ad
Update JenkinsfileCI
maramvenkatareddy Nov 24, 2024
3d5cb77
Updated to the newer version
venkatkumarv Nov 24, 2024
33f3926
Updated to the newer version
venkatkumarv Nov 24, 2024
29ef846
Update JenkinsfileCI
maramvenkatareddy Nov 24, 2024
ab9be67
Updated to the newer version
venkatkumarv Nov 24, 2024
a8dadd0
Updated to the newer version
venkatkumarv Nov 24, 2024
00a54bb
Update JenkinsfileCI
maramvenkatareddy Nov 24, 2024
21bedb8
Updated to the newer version
venkatkumarv Nov 24, 2024
35804c6
Updated to the newer version
venkatkumarv Nov 24, 2024
096db3e
Updated to the newer version
venkatkumarv Nov 24, 2024
a9e83a9
Updated to the newer version
venkatkumarv Nov 24, 2024
39977d0
Updated to the newer version
venkatkumarv Nov 24, 2024
82ad5c3
Updated to the newer version
venkatkumarv Nov 24, 2024
b37bcdc
Update README.md
maramvenkatareddy Nov 24, 2024
5e1b00f
Updated to the newer version
venkatkumarv Nov 24, 2024
f6b8b38
Updated to the newer version
venkatkumarv Nov 25, 2024
8161703
Update JenkinsfileCI
maramvenkatareddy Nov 25, 2024
d2ef63e
Updated to the newer version
venkatkumarv Nov 25, 2024
8bbcec3
Updated to the newer version
venkatkumarv Nov 25, 2024
2bcc331
Updated to the newer version
venkatkumarv Nov 25, 2024
cf8551d
Updated to the newer version
venkatkumarv Nov 25, 2024
e362130
Updated to the newer version
venkatkumarv Nov 25, 2024
eccba57
Updated to the newer version
venkatkumarv Nov 25, 2024
2cf2f19
Update JenkinsfileCI
maramvenkatareddy Nov 25, 2024
32f763d
Updated to the newer version
venkatkumarv Nov 25, 2024
f45febe
Updated to the newer version
venkatkumarv Nov 25, 2024
0f72c2a
Updated to the newer version
venkatkumarv Nov 25, 2024
c452dcb
Updated to the newer version
venkatkumarv Nov 25, 2024
5a97141
Updated to the newer version
venkatkumarv Nov 25, 2024
2e4c6d4
Updated to the newer version
venkatkumarv Nov 25, 2024
3faea89
Updated to the newer version
venkatkumarv Nov 25, 2024
26da187
Update JenkinsfileCI
maramvenkatareddy Nov 25, 2024
e8f3932
Updated to the newer version [ci skip]
venkatkumarv Nov 25, 2024
a598d3c
Updated to the newer version [ci skip]
venkatkumarv Nov 25, 2024
bd27353
Updated to the newer version [ci skip]
venkatkumarv Nov 25, 2024
d87207e
Updated to the newer version [ci skip]
venkatkumarv Nov 25, 2024
baf90f2
Create New-Jenkinsfile
maramvenkatareddy Nov 25, 2024
a62f3bb
Update New-Jenkinsfile
maramvenkatareddy Nov 25, 2024
117b1a4
Update New-Jenkinsfile
maramvenkatareddy Nov 25, 2024
5405754
updating README.md for monitoring
maramvenkatareddy Nov 25, 2024
ea4bc5f
Create declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
57b3d65
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
3e7b730
chanaged to README.md
maramvenkatareddy Nov 25, 2024
3831929
Update README.md
maramvenkatareddy Nov 25, 2024
ba771b6
Update README.md
maramvenkatareddy Nov 25, 2024
8a646cd
Update README.md
maramvenkatareddy Nov 25, 2024
f5a18b6
Update README.md
maramvenkatareddy Nov 25, 2024
7d46dcb
Update README.md
maramvenkatareddy Nov 25, 2024
00b4f3e
Update README.md
maramvenkatareddy Nov 25, 2024
aabd918
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
e36b4da
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
6780bd0
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
852e251
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
f2f5aa4
Updated to the newer version [ci skip]
venkatkumarv Nov 25, 2024
935b175
Updated to the newer version [ci skip]
venkatkumarv Nov 25, 2024
1198941
Updated to the newer version [ci skip]
venkatkumarv Nov 25, 2024
aa35c7d
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
3b2aa24
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
ecb66d6
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
7c3b195
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
02e32a9
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
2812194
Update README.md
maramvenkatareddy Nov 25, 2024
ee1a7ee
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
efe2141
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
1947c52
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
7049b32
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
7d5981c
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
debd426
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
4af7a78
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
a296fd2
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
04b4976
Update declarative-jenkinsfile
maramvenkatareddy Nov 25, 2024
5aced38
Create New-Declarative-Jenkinsfile
maramvenkatareddy Nov 26, 2024
9021460
Update New-Declarative-Jenkinsfile
maramvenkatareddy Nov 26, 2024
9b5cfe8
Update New-Declarative-Jenkinsfile
maramvenkatareddy Nov 26, 2024
d129026
Update README.md
maramvenkatareddy Nov 26, 2024
c464b8f
Update README.md
maramvenkatareddy Nov 26, 2024
822ce7b
Update README.md
maramvenkatareddy Nov 26, 2024
c26e7fe
Update README.md
maramvenkatareddy Nov 26, 2024
d655079
Update README.md
maramvenkatareddy Nov 26, 2024
2096ed8
Update New-Declarative-Jenkinsfile
maramvenkatareddy Nov 26, 2024
505a161
Update New-Declarative-Jenkinsfile
maramvenkatareddy Nov 26, 2024
96fd2a8
Update New-Declarative-Jenkinsfile
maramvenkatareddy Nov 26, 2024
dd45cc7
Update New-Declarative-Jenkinsfile
maramvenkatareddy Nov 26, 2024
8228982
Update New-Declarative-Jenkinsfile
maramvenkatareddy Nov 26, 2024
44f40bf
Update README.md
maramvenkatareddy Nov 26, 2024
8f4b43c
Update declarative-jenkinsfile
maramvenkatareddy Nov 26, 2024
53b64bd
Update declarative-jenkinsfile
maramvenkatareddy Nov 26, 2024
fa32039
Update config.yaml
maramvenkatareddy Nov 26, 2024
7f21692
Update declarative-jenkinsfile
maramvenkatareddy Nov 26, 2024
92fbe89
Update declarative-jenkinsfile
maramvenkatareddy Nov 26, 2024
47b65ee
Update config.yaml
maramvenkatareddy Nov 26, 2024
d74d0ff
Update config.yaml
maramvenkatareddy Nov 26, 2024
beb6beb
Update config.yaml
maramvenkatareddy Nov 26, 2024
4f68761
Update declarative-jenkinsfile
maramvenkatareddy Nov 26, 2024
155d6d4
Update declarative-jenkinsfile
maramvenkatareddy Nov 26, 2024
b060234
Update declarative-jenkinsfile
maramvenkatareddy Nov 26, 2024
ef0ed80
Update declarative-jenkinsfile
maramvenkatareddy Nov 26, 2024
402d6bf
Update declarative-jenkinsfile
maramvenkatareddy Nov 26, 2024
76d6a23
Merge branch 'copilot' into main
maramvenkatareddy Nov 26, 2024
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
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
## Added files
FROM adoptopenjdk/openjdk11:alpine-slim as build
WORKDIR /workspace/app

Expand All @@ -15,5 +16,6 @@ ARG DEPENDENCY=/workspace/app/target/dependency
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-Dserver.port=${PORT}","-cp","app:app/lib/*","com.example.demo.DemoApplication"]
EXPOSE 8080
ENTRYPOINT ["java","-cp","app:app/lib/*","com.example.demo.DemoApplication"]
ENTRYPOINT ["java","-cp","app:app/lib/*","com.example.demo.DemoApplication"]
15 changes: 15 additions & 0 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# Use an official OpenJDK runtime as a parent image
FROM openjdk:17-jdk-slim

# Set the working directory in the container
WORKDIR /app

# Copy the JAR file into the container at /app
COPY target/demo-0.0.1-SNAPSHOT.jar /app/demo.jar

# Expose the port that your app will run on
EXPOSE 8080

# Run the JAR file
ENTRYPOINT ["java", "-jar", "/app/demo.jar"]
14 changes: 14 additions & 0 deletions Dockerfile.qa
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Use an official OpenJDK runtime as a parent image
FROM openjdk:17-jdk-slim

# Set the working directory in the container
WORKDIR /app

# Copy the JAR file into the container at /app
COPY target/demo-0.0.1-SNAPSHOT.jar /app/demo.jar

# Expose the port that your app will run on
EXPOSE 8080

# Run the JAR file
ENTRYPOINT ["java", "-jar", "/app/demo.jar"]
14 changes: 14 additions & 0 deletions Jenkinsfile-publishHtml-1
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
}
stages {
stage('Build') {
steps {
sh './mvnw clean install site surefire-report:report'
sh 'tree'
}
}
}
}
19 changes: 19 additions & 0 deletions Jenkinsfile-publishHtml-2
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
}
stages {
stage('Build') {
steps {
sh './mvnw clean install site surefire-report:report'
sh 'tree'
}
}
}
post {
success {
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'target/site', reportFiles: 'surefire-report.html', reportName: 'Surefire Report', reportTitles: '', useWrapperFileDirectly: true])
}
}
}
155 changes: 155 additions & 0 deletions JenkinsfileCI
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
def notifySlack(String buildStatus = 'SUCCESS') {
def colorMap = [
'SUCCESS': 'good',
'FAILURE': 'danger',
'UNSTABLE': 'warning',
'ABORTED': '#808080'
]

def message = """
*Build Status*: ${buildStatus}
*Job*: ${env.JOB_NAME}
*Build Number*: #${env.BUILD_NUMBER}
//*Branch*: ${gitbranch}
*Duration*: ${currentBuild.durationString}
*Build URL*: ${env.BUILD_URL}
*Environment*: ${ENVIRONMENT}
""".stripIndent()

slackSend(
channel: config.SLACK_CHANNEL,
color: colorMap[buildStatus],
message: message
)
}
node('master') {
checkout scm
def data_helper_repo_url = 'https://github.com/maramvenkatareddy/node_js.git'
def platform_app_url = 'https://github.com/maramvenkatareddy/java-web-app.git'
// def gitbranch = 'main'
def GITHUB_TOKEN = credentials('ggit')
properties([
pipelineTriggers([
// Poll SCM for changes in the specific repository
pollSCM("* * * * *") // This is the cron schedule format
])
])

try {
// Read the config file and set the environment
property = readYaml file: "config.yaml"
if (ENVIRONMENT == "qa") {
config = property.qa
echo "Config: ${config}"
} else if (ENVIRONMENT == "prod") {
config = property.prod
echo "Config: ${config}"
} else {
error "ENVIRONMENT variable not set or invalid!"
}
} catch (Exception e) {
error "Failed at reading config file. Error: ${e}"
}

try {
def commitHash = sh(script: "git rev-parse HEAD", returnStdout: true).trim()
// Debugging: echo the repository URLs
echo "Data Helper Repo URL: ${data_helper_repo_url}"
echo "Platform App Repo URL: ${platform_app_url}"
echo "commit_hash: ${commitHash}"
sh "printenv"

// Clone Datahelper Repository
stage('Clone Platform Application Repository') {
dir('repo2') {
echo "Cloning repository: ${platform_app_url}"
git branch: 'main', url: "${platform_app_url}"
echo "Checked out Platform Application Repository"
sh "ls"
// sh "git branch"
}
}
stage('Clone Datahelper Repository') {
dir('repo1') {
echo "Cloning repository: ${data_helper_repo_url}"
echo "commit_hash: ${commitHash}"
git branch: 'main', url: "${data_helper_repo_url}"
echo "Checked out Datahelper Repository"
sh "ls"
sh "git branch"
}
}
stage('build the dependency') {
dir('repo1') {
sh "npm install"
}
}

stage('buidl') {
dir('repo2') {
sh "mvn clean install"
}
}
stage('Docker build') {
dir("${config.path}") {
current = "Stage Docker build"
if (ENVIRONMENT == "qa") {
sh "docker build -t ${config.ecr_url}/${config.repo_name}:${config.environment}-${commitHash} -f Dockerfile.qa ."
} else if (ENVIRONMENT == "prod") {
sh "docker build -t ${config.ecr_url}/${config.repo_name}:${config.environment}-${commitHash} -f Dockerfile.prod ."
}
sh "docker tag ${config.ecr_url}/${config.repo_name}:main-1 ${config.ecr_url}/${config.repo_name}:latest"
}
}

stage('Docker Image Push to ECR Repo') {
dir("${config.path}") {
stage('Docker Image Push to Ecr') {
current = "Stage Docker Image Push to Ecr"
sh "aws ecr get-login-password --region ${config.region} | docker login --username AWS --password-stdin ${config.ecr_url}"
sh "docker push ${config.ecr_url}/${config.repo_name}:${config.environment}-${commitHash}"
sh "docker push ${config.ecr_url}/${config.repo_name}:latest"
}
}
}
stage('Update Image Tag in Deployment File') {
dir('repo2') {
// Set Git configuration
sh 'git config user.email "venkat@gmail.com"'
sh 'git config user.name "venkat"'

// Define the deployment file path
def deploymentFile = 'eks/prod/deployment.yaml'

// Ensure the deployment file exists
if (fileExists(deploymentFile)) {
echo "Updating image tag in ${deploymentFile}"

// Replace 'tag' placeholder with the desired image version (e.g., 1.23)
sh "sed -i 's|image: 619071347058.dkr.ecr.us-west-2.amazonaws.com|image: 619071347058.dkr.ecr.us-west-2.amazonaws.com/prod-video:${config.environment}-${commitHash}|g' ${deploymentFile}"
// sh "sed -i 's|image: [^ ]*|image: \"${config.ecr_url}/${config.repo_name}:${config.environment}-${commitHash}\"|g' ${deploymentFile}"

// Git commit and push using the credentials
sh 'git add .'
sh 'git commit -m "Updated to the newer version [ci skip]"'
// Use the credentials for Git push
withCredentials([usernamePassword(credentialsId: 'ggit', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
echo "username is $USERNAME"
echo "password is $PASSWORD"
sh 'git push https://${USERNAME}:${PASSWORD}@github.com/${USERNAME}/java-web-app.git'
}
sh "cat ${deploymentFile}"
} else {
error "Deployment file ${deploymentFile} not found!"
}
}
}

notifySlack('SUCCESS')

} catch (Exception e) {
error "Pipeline failed with error: ${e}"
notifySlack('FAILURE')
error "Your continuous build failed at ${current}: ${e.getMessage()}"
}
}
Loading