Created
August 7, 2021 01:58
-
-
Save bharathirajatut/bdb0bc898d6628f8301a5c53071381c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline{ | |
agent any | |
environment { | |
DOCKERHUB_CREDENTIALS=credentials('dockerhub-cred-raja') | |
} | |
stages { | |
stage('Build') { | |
steps { | |
sh 'docker build -t bharathirajatut/nodeapp:latest .' | |
} | |
} | |
stage('Login') { | |
steps { | |
sh 'echo $DOCKERHUB_CREDENTIALS_PSW | docker login -u $DOCKERHUB_CREDENTIALS_USR --password-stdin' | |
} | |
} | |
stage('Push') { | |
steps { | |
sh 'docker push bharathirajatut/nodeapp:latest' | |
} | |
} | |
} | |
post { | |
always { | |
sh 'docker logout' | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment