From 3315bd4afabff14158047fad53c0ef03e774fe25 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Tue, 8 Nov 2022 12:58:35 +0400 Subject: [PATCH] add jenkinsfile --- Jenkinsfile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..2051652 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,29 @@ +node { + def app + + stage('Clone repository') { + /* Let's make sure we have the repository cloned to our workspace */ + + checkout scm + } + + stage('Build image') { + app = docker.build("romanov73/is:ng-tracker-container-11") + } + + stage('Test image') { + /* Ideally, we would run a test framework against our image. + * For this example, we're using a Volkswagen-type approach ;-) */ + sh ./gradlew bootRun -Dng-tracker.check-run=true + app.inside { + sh 'echo "Tests passed"' + } + } + + /*stage('Push image') { + docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') { + app.push("${env.BUILD_NUMBER}") + app.push("latest") + } + }*/ +} \ No newline at end of file