diff --git a/Jenkinsfile b/Jenkinsfile index 57af0cdc..753af4f5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,5 +20,32 @@ pipeline { shared() } } + stage('Building our image') { + steps { + sh "docker build . -t vinnimous/privategpt:latest" + } + } + stage('Login to Docker') { + when { + allOf { + branch 'master' + } + } + steps { + withCredentials([string (credentialsId: 'docker_hub_token', variable: 'token')]) { + sh "docker login --username vinnimous --password ${token}" + } + } + } + stage('Push to Docker') { + when { + allOf { + branch 'master' + } + } + steps { + sh "docker image push vinnimous/privategpt:latest" + } + } } }