Skip to content

Commit

Permalink
Update Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Tynab committed Nov 11, 2023
1 parent 9d6d6d7 commit 44c269e
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,10 @@ pipeline {
}
}

// stage('Push') {
// steps {
// withDockerRegistry(credentialsId: 'docker_hub', url: 'https://index.docker.io/v1/') {
// sh 'docker push yamiannephilim/yanlib'
// }
// }
// }
stage('Push') {
steps {
withDockerRegistry([credentialsId: 'docker_hub', url: 'https://index.docker.io/v1/']) {
script {
def registry = 'https://index.docker.io/v1/'
def image = 'yamiannephilim/yanlib'
def dockerCreds = docker.getRegistryCredentials('docker_hub')

docker.withRegistry(registry, dockerCreds) {
sh "echo ${dockerCreds.PASSWORD} | docker login --username ${dockerCreds.US‌ERNAME} --password-stdin"
sh "docker push ${image}"
}
}
withDockerRegistry(credentialsId: 'docker_hub', url: 'https://index.docker.io/v1/') {
sh 'docker push yamiannephilim/yanlib'
}
}
}
Expand Down

0 comments on commit 44c269e

Please sign in to comment.