From c96dd4f56757e37870609f4896726ea6b19e6145 Mon Sep 17 00:00:00 2001 From: kargor8 Date: Thu, 10 Dec 2020 17:09:46 +0100 Subject: [PATCH 1/5] Jenkins now lets build frontend and backend --- Jenkinsfile | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index edc5f50..49e2716 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,20 +1,26 @@ pipeline { - agent any + agent { + docker { + image 'kargor8/sess-comp-base:v2' + } + } + environment { + DOTNET_CLI_HOME = '/tmp/App' + } stages { - stage('Build image') { + stage('Build app') { steps { - echo "Building docker image" - script { - dir('SessionCompanion/SessionCompanion'){ - def customImage = docker.build("session-companion:${env.BUILD_ID}") - //customImage.withRun('-p 5050:5050') + dir('SessionCompanion') { + sh "echo $USER" + withEnv(["HOME=${env.WORKSPACE}"]){ + sh 'dotnet build' } } - } + } } - stage('Delete image') { - steps { - sh "docker rmi session-companion:${env.BUILD_ID}" + stage('Clarify') { + steps { + sh "echo Dziala" } } } From 8530f3e9400e2e8fbbdb747c83eff9ca06f023f6 Mon Sep 17 00:00:00 2001 From: kargor8 Date: Thu, 10 Dec 2020 17:18:02 +0100 Subject: [PATCH 2/5] Delete whats left and build npm --- Jenkinsfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 49e2716..2c35290 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,14 +13,20 @@ pipeline { dir('SessionCompanion') { sh "echo $USER" withEnv(["HOME=${env.WORKSPACE}"]){ + dir ('SessionCompanion/ClientApp') { + sh 'npm install' + } sh 'dotnet build' + } } } } } - stage('Clarify') { + stage('Clear') { steps { - sh "echo Dziala" + withEnv(["HOME=${env.WORKSPACE}"]){ + sh 'rm -rf .local' + } } } } From 0c0bdc70e55b93d23aaa210fbbe62015acee6e43 Mon Sep 17 00:00:00 2001 From: kargor8 Date: Thu, 10 Dec 2020 17:19:15 +0100 Subject: [PATCH 3/5] Delete whats left and build npm, fix typo --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2c35290..26c5cb8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,6 @@ pipeline { sh 'npm install' } sh 'dotnet build' - } } } } From 712f87c696eecc670ecff9f1cecbccef5d73099b Mon Sep 17 00:00:00 2001 From: kargor8 Date: Thu, 10 Dec 2020 17:30:06 +0100 Subject: [PATCH 4/5] Try npm cache clean --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 26c5cb8..6061d90 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,6 +14,7 @@ pipeline { sh "echo $USER" withEnv(["HOME=${env.WORKSPACE}"]){ dir ('SessionCompanion/ClientApp') { + sh 'npm cache clean --force' sh 'npm install' } sh 'dotnet build' From 553a27a92abcd482b7a6c6b86fa883a5a60966a4 Mon Sep 17 00:00:00 2001 From: kargor8 Date: Thu, 10 Dec 2020 17:32:32 +0100 Subject: [PATCH 5/5] Useless commit to see if jenkins works --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 6061d90..e2603d7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,3 +31,4 @@ pipeline { } } } +