From 55534b191dbc3ef712e8228c3c5f944f9c1bf306 Mon Sep 17 00:00:00 2001 From: ShankarMounesh Date: Wed, 20 Apr 2022 04:20:25 +0000 Subject: [PATCH] Upload files to '' --- Jenkinsfile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..879e1432 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,31 @@ +pipeline { + agent { label 'linux' } + options { + buildDiscarder(logRotator(numToKeepStr: '5')) + } + environment { + DOCKERHUB_CREDENTIALS = credentials('dockerhub') + } + stages { + stage('Build') { + steps { + sh 'docker build -t buzzerburger/test:latest ./app' + } + } + stage('Login') { + steps { + sh 'echo $DOCKERHUB_CREDENTIALS_PSW | docker login -u $DOCKERHUB_CREDENTIALS_USR --password-stdin' + } + } + stage('Push') { + steps { + sh 'docker push buzzerburger/test:latest' + } + } + } + post { + always { + sh 'docker logout' + } + } +} \ No newline at end of file