Skip to content

Commit 25dc279

Browse files
committed
jenkins-file-command-added
1 parent 80465e4 commit 25dc279

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

Jenkinsfile

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,26 @@ pipeline {
33
stages {
44
stage('Keploy Tests') {
55
steps {
6+
// Clone the git repository
67
git branch: 'chore/Integrate-github-cicd', url: 'https://github.com/Achanandhi-M/samples-java.git'
8+
// switch to the directory and run test
79
dir('spring-petclinic/spring-petclinic-rest') {
8-
sh '''
10+
sh """
911
# Download and install Keploy binary
10-
curl --silent -O -L https://keploy.io/install.sh && bash install.sh
12+
curl --silent -O -L https://keploy.io/install.sh && sudo bash install.sh
1113
14+
# Verify keploy installation
1215
which keploy
1316
14-
# Set env variables to fix docker run volume issues
15-
export KEPLOY_CONFIG_DIR="$(pwd)/.keploy-config"
16-
export KEPLOY_TEST_DIR="$(pwd)/.keploy"
17+
# Set up the environment (ensure docker is running)
18+
sudo systemctl start docker || true
1719
18-
mkdir -p "$KEPLOY_CONFIG_DIR" "$KEPLOY_TEST_DIR"
19-
20-
# Run Keploy test with proper volume mounts
21-
sudo keploy test -c "docker-compose up" \
22-
--container-name "javaApp" \
23-
-t "test-set-0" \
24-
--build-delay 50 \
25-
--delay 20 \
26-
--debug
27-
'''
20+
# Run keploy test
21+
# Using single quotes for the command to avoid escaping issues
22+
sudo keploy test -c 'docker-compose up' --container-name 'javaApp' --test-set 'test-set-0' --build-delay 50 --delay 20 --debug
23+
"""
2824
}
2925
}
3026
}
3127
}
32-
}
28+
}

0 commit comments

Comments
 (0)