From 5009fe2eec71e7f05969581c2b564e1dbac985c8 Mon Sep 17 00:00:00 2001 From: Isaac Uche <85682126+cloudzeee@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:15:14 +0100 Subject: [PATCH 01/11] Create Jenkinsfile --- Jenkinsfile | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..dbf35d6 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,40 @@ +pipeline { + agent any + + stages { + stage('Checkout') { + steps { + // Checkout your Angular application code from SCM (e.g., Git) + checkout([$class: 'GitSCM', branches: [[name: '*/master']], userRemoteConfigs: [[url: 'YOUR_GIT_REPO_URL']]]) + } + } + + stage('Install Dependencies') { + steps { + // Use Node.js to install project dependencies + sh 'npm install' + } + } + + stage('Build Angular Application') { + steps { + // Use Angular CLI to build the application + sh 'npm run build' + } + } + + stage('Deploy to Server') { + steps { + // Add your deployment steps here, e.g., copying files to a server + // or deploying to a cloud platform like AWS, Azure, or Firebase. + // You can use Jenkins plugins or custom scripts for deployment. + } + } + } + + post { + success { + // Add post-build actions here if needed + } + } +} From d6bad3b484d09933aec7b9f219f03ae128648dcd Mon Sep 17 00:00:00 2001 From: Isaac Uche <85682126+cloudzeee@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:17:38 +0100 Subject: [PATCH 02/11] Update Jenkinsfile --- Jenkinsfile | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dbf35d6..50e4d39 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,20 +16,7 @@ pipeline { } } - stage('Build Angular Application') { - steps { - // Use Angular CLI to build the application - sh 'npm run build' - } - } - - stage('Deploy to Server') { - steps { - // Add your deployment steps here, e.g., copying files to a server - // or deploying to a cloud platform like AWS, Azure, or Firebase. - // You can use Jenkins plugins or custom scripts for deployment. - } - } + } post { From a0ced010aa1fb132c0a5f6ae4d7f3a97e4506350 Mon Sep 17 00:00:00 2001 From: Isaac Uche <85682126+cloudzeee@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:18:51 +0100 Subject: [PATCH 03/11] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 50e4d39..6a09b26 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,7 +21,7 @@ pipeline { post { success { - // Add post-build actions here if needed + echo 'This was successful' } } } From 0759e84d7f191443a36c5f97954f34cdee4293b2 Mon Sep 17 00:00:00 2001 From: Isaac Uche <85682126+cloudzeee@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:20:54 +0100 Subject: [PATCH 04/11] Update Jenkinsfile --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6a09b26..7bfdc40 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,8 +4,7 @@ pipeline { stages { stage('Checkout') { steps { - // Checkout your Angular application code from SCM (e.g., Git) - checkout([$class: 'GitSCM', branches: [[name: '*/master']], userRemoteConfigs: [[url: 'YOUR_GIT_REPO_URL']]]) + checkout scm } } From 992cb31140352b3d4b5af9aee2530e7c58cdcd0e Mon Sep 17 00:00:00 2001 From: Isaac Uche <85682126+cloudzeee@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:24:00 +0100 Subject: [PATCH 05/11] Update package.json --- EmployeeDB/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/EmployeeDB/package.json b/EmployeeDB/package.json index 66c600a..dd2e19a 100644 --- a/EmployeeDB/package.json +++ b/EmployeeDB/package.json @@ -7,6 +7,8 @@ }, "dependencies": { "express": "4.17.1", + "npm": "8.3.1", + "node"" "16.14.0", "jade": "*", "stylus": "*", "mongodb": ">= 0.9.6-7", From 694d8568d29277b1894ead4476b819f15b1849f3 Mon Sep 17 00:00:00 2001 From: Isaac Uche <85682126+cloudzeee@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:28:34 +0100 Subject: [PATCH 06/11] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7bfdc40..78dc693 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { stage('Install Dependencies') { steps { // Use Node.js to install project dependencies - sh 'npm install' + bat 'npm install' } } From a5a8aa1e880f35e07ae0863f060b77fa984cb365 Mon Sep 17 00:00:00 2001 From: Isaac Uche <85682126+cloudzeee@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:35:24 +0100 Subject: [PATCH 07/11] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 78dc693..7bfdc40 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { stage('Install Dependencies') { steps { // Use Node.js to install project dependencies - bat 'npm install' + sh 'npm install' } } From 47e6c5ef5f7ae13106c1f58703d50709d4a3c831 Mon Sep 17 00:00:00 2001 From: Isaac Uche <85682126+cloudzeee@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:36:28 +0100 Subject: [PATCH 08/11] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7bfdc40..e2ad641 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { stage('Install Dependencies') { steps { // Use Node.js to install project dependencies - sh 'npm install' + run 'npm install' } } From 38610c57d2d644c3342b89697773514b7f1311c0 Mon Sep 17 00:00:00 2001 From: Isaac Uche <85682126+cloudzeee@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:37:32 +0100 Subject: [PATCH 09/11] Update Jenkinsfile --- Jenkinsfile | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e2ad641..b76af64 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,15 +6,6 @@ pipeline { steps { checkout scm } - } - - stage('Install Dependencies') { - steps { - // Use Node.js to install project dependencies - run 'npm install' - } - } - } From 4a8c606977b52685b04380fab77a02290db0492a Mon Sep 17 00:00:00 2001 From: Isaac Uche <85682126+cloudzeee@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:38:30 +0100 Subject: [PATCH 10/11] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b76af64..4376554 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { steps { checkout scm } - + } } post { From aac6cf309f6f2e707f97c996b7014dda51cf36d4 Mon Sep 17 00:00:00 2001 From: Isaac Uche <85682126+cloudzeee@users.noreply.github.com> Date: Wed, 23 Oct 2024 05:43:44 +0100 Subject: [PATCH 11/11] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..358e217 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,21 @@ +# Node.js +# Build a general Node.js project with npm. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript + +trigger: +- master + +pool: + vmImage: ubuntu-latest + +steps: +- task: NodeTool@0 + inputs: + versionSpec: '20.x' + displayName: 'Install Node.js' + +- script: | + npm install + npm run build + displayName: 'npm install and build'