Skip to content

Commit b21c7e2

Browse files
committed
jenkins-file-command-added
1 parent 5d1ff9e commit b21c7e2

File tree

1 file changed

+26
-27
lines changed

1 file changed

+26
-27
lines changed

Jenkinsfile

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
11
pipeline {
2-
agent any
2+
agent {
3+
docker {
4+
image 'ubuntu:22.04'
5+
args '--privileged -u root'
6+
}
7+
}
38
stages {
49
stage('Keploy Tests') {
510
steps {
6-
// Clone the git repository
7-
git branch: 'chore/Integrate-github-cicd', url: 'https://github.com/Achanandhi-M/samples-java.git'
8-
9-
// switch to the directory and run test
10-
dir('spring-petclinic/spring-petclinic-rest') {
11-
sh """
12-
apt-get update && apt-get install -y kmod linux-headers-generic bpfcc-tools
11+
sh '''
12+
apt-get update && apt-get install -y curl kmod linux-headers-generic bpfcc-tools git openjdk-17-jdk
13+
14+
# Clone the repo
15+
git clone -b chore/Integrate-github-cicd https://github.com/Achanandhi-M/samples-java.git
16+
cd samples-java/spring-petclinic/spring-petclinic-rest
17+
18+
mkdir -p /sys/kernel/debug
19+
mkdir -p /sys/kernel/tracing
20+
21+
# Download and install Keploy
22+
curl --silent -O -L https://keploy.io/install.sh && bash install.sh
1323
14-
mkdir -p /sys/kernel/debug
15-
mkdir -p /sys/kernel/tracing
16-
# Download and install Keploy binary
17-
curl --silent -O -L https://keploy.io/install.sh && sudo bash install.sh
24+
mount -t debugfs nodev /sys/kernel/debug || true
25+
mount -t tracefs nodev /sys/kernel/tracing || true
1826
19-
# Verify keploy installation
20-
which keploy
27+
# Build the app (assuming Maven)
28+
./mvnw package -DskipTests
2129
22-
# Set up the environment (ensure docker is running)
23-
24-
# Print current directory for debugging
25-
pwd
26-
ls -la
27-
mount -t debugfs nodev /sys/kernel/debug || true
28-
mount -t tracefs nodev /sys/kernel/tracing || true
29-
30-
# Run keploy test
31-
keploy test -c "java -jar target/spring-petclinic-rest-3.0.2.jar" --delay 20
32-
"""
33-
}
30+
# Run Keploy
31+
keploy test -c "java -jar target/spring-petclinic-rest-3.0.2.jar" --delay 20 --language java
32+
'''
3433
}
3534
}
3635
}
37-
}
36+
}

0 commit comments

Comments
 (0)