From f9e31386a29a814cde7739e63d080cce4b4ebb73 Mon Sep 17 00:00:00 2001 From: Michel ten Voorde Date: Tue, 5 Nov 2024 14:50:47 +0100 Subject: [PATCH] Added test environment --- Jenkinsfile | 83 +++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1f3e757..392bafb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,47 +13,48 @@ pipeline { // Defines the sequence of stages that will be executed stages { // This stage checks out the source code from the SCM (Source Code Management) system - stage('Checkout') { - steps { - // This command checks out the source code from the SCM into the Jenkins workspace - checkout scm - } - } - stage('Build') { - steps { - sh 'yarn install --no-progress' - sh 'npm run ng build --prod' - } - } +// stage('Checkout') { +// steps { +// // This command checks out the source code from the SCM into the Jenkins workspace +// checkout scm +// } +// } +// stage('Build') { +// steps { +// sh 'yarn install --no-progress' +// sh 'npm run ng build --prod' +// } +// } +// +// stage('Docker Build') { +// steps { +// sh 'docker build -t upquark/swiss-client:latest -t upquark/swiss-client:${BUILD_NUMBER} .' +// } +// } +// +// stage('Push the Docker Image to DockerHub') { +// steps { +// script { +// withCredentials([string(credentialsId: 'c7783e4f-2f79-482f-885f-dfb39f8c02d3', variable: 'docker_hub')]) { +// sh 'docker login -u upquark -p ${docker_hub}' +// } +// sh 'docker push upquark/swiss-client:latest' +// sh 'docker push upquark/swiss-client:${BUILD_NUMBER}' +// } +// } +// } +// +// stage('Deploy to Kubernetes') { +// steps { +// script { +// kubeconfig(credentialsId: 'k3s-kubeconfig') { +// sh 'cat k8s/deployment.yaml | sed "s/latest/$BUILD_NUMBER/g" | kubectl apply -n swiss -f -' +// sh 'kubectl apply -f k8s/service.yaml -n swiss' +// } +// } +// } +// } - stage('Docker Build') { - steps { - sh 'docker build -t upquark/swiss-client:latest -t upquark/swiss-client:${BUILD_NUMBER} .' - } - } - - stage('Push the Docker Image to DockerHub') { - steps { - script { - withCredentials([string(credentialsId: 'c7783e4f-2f79-482f-885f-dfb39f8c02d3', variable: 'docker_hub')]) { - sh 'docker login -u upquark -p ${docker_hub}' - } - sh 'docker push upquark/swiss-client:latest' - sh 'docker push upquark/swiss-client:${BUILD_NUMBER}' - } - } - } - - stage('Deploy to Kubernetes') { - steps { - script { - kubeconfig(credentialsId: 'k3s-kubeconfig') { - sh 'cat k8s/deployment.yaml | sed "s/latest/$BUILD_NUMBER/g" | kubectl apply -n swiss -f -' - sh 'kubectl apply -f k8s/service.yaml -n swiss' - } - } - } - } stage('Checkout test') { steps { // This command checks out the source code from the SCM into the Jenkins workspace @@ -63,7 +64,7 @@ pipeline { stage('Build test') { steps { sh 'yarn install --no-progress' - sh 'npm run ng build --configuration test' + sh 'ng build --configuration test' } }