Skip to content

Commit

Permalink
ci: add docker login for smoke tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulguptajss committed Nov 4, 2024
1 parent 01dcf9d commit 685f669
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion integration/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pipeline {
cleanWs()
stopAndRemoveDockers()
setupWorkspace()
dockerLogin()
}
}
stage('Install NATIVE pkg') {
Expand Down Expand Up @@ -111,6 +112,7 @@ pipeline {
cleanWs()
stopAndRemoveDockers()
setupWorkspace()
dockerLogin()
}
}
stage('Install RPM pkg') {
Expand Down Expand Up @@ -166,6 +168,7 @@ pipeline {
cleanWs()
stopAndRemoveDockers()
setupWorkspace()
dockerLogin()
}
}
stage('Install Docker') {
Expand Down Expand Up @@ -226,6 +229,7 @@ pipeline {
cleanWs()
stopAndRemoveDockers()
setupWorkspace()
dockerLogin()
}
}
stage('Install Docker FIPS') {
Expand Down Expand Up @@ -284,7 +288,7 @@ def void stopAndRemoveDockers() {
sh '''
for container_id in $(docker ps -a -q);do docker stop $container_id;done
for container_id in $(docker ps -a -q);do docker rm $container_id;done
docker system prune --force --volumes
docker system prune --all --force --volumes
volumes=$(docker volume ls -qf dangling=true)
if [ "$volumes" ]; then
docker volume rm $volumes
Expand All @@ -308,4 +312,10 @@ def void printNodeInfo() {
socket.connect(InetAddress.getByName("8.8.8.8"), 10002);
nodeIp = socket.getLocalAddress().getHostAddress();
println("The Node IP Address is: ${nodeIp}")
}

def void dockerLogin() {
withDockerRegistry([credentialsId: "DockerHub", url: ""]) {
sh 'docker login'
}
}
2 changes: 1 addition & 1 deletion jenkins/artifacts/jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def void stopAndRemoveDockers() {
rm -rf /opt/home/nightly/
mkdir -p /opt/home/nightly/
for container_id in $(docker ps -a -q);do docker stop $container_id;done
docker system prune --force --volumes
docker system prune --all --force --volumes
volumes=$(docker volume ls -qf dangling=true)
if [ "$volumes" ]; then
docker volume rm $volumes
Expand Down

0 comments on commit 685f669

Please sign in to comment.