pipeline { environment { registry = "hftstuttgart/modocot-backend" //wie hier lösen? registryCredential = 'Dockerhub' dockerImage = '' } agent any tools { jdk 'Java11' maven 'Maven_Home' } stages { stage('Checkout') { steps { echo 'Checkout Repository..' git branch: 'master', // Cred löschen da final repo public credentialsId: '1651d97b-1744-4af3-bdd0-0fc9a5a90ef7', //url auf finales repo anpassen url: 'https://gitlab.rz.hft-stuttgart.de/swp2-lc/MoJEC-Backend.git' } } stage('Build') { steps { echo 'Maven Build..' sh 'mvn clean package -DskipTests=false' } } stage('Docker Build..') { steps{ script { dockerImage = docker.build registry + ":latest" } } } stage('Push to Dockerhub..') { steps{ script { docker.withRegistry( '', registryCredential ) { dockerImage.push() } } } } stage('ShellScript') { steps { echo 'Exectue Shellscript..' sh 'chmod 744 restart_modocot_backend.sh && ./restart_modocot_backend.sh' } } } }