From 5bb23e786e5ba0d406b5fecdcade624aa802260a Mon Sep 17 00:00:00 2001 From: dovlous Date: Sun, 19 Nov 2023 13:19:04 +0100 Subject: [PATCH 01/12] Add Jenkinsfile --- public/Jenkinsfile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 public/Jenkinsfile diff --git a/public/Jenkinsfile b/public/Jenkinsfile new file mode 100644 index 0000000..8d9d88d --- /dev/null +++ b/public/Jenkinsfile @@ -0,0 +1,41 @@ +pipeline { + agent any + + stages { + stage('Install Dependencies') { + steps { + script { + // Install Node.js dependencies + sh 'npm install' + } + } + } + + stage('Run Dev Server') { + steps { + script { + // Run dev server with live preview + sh 'npm run watch' + } + } + } + + stage('Build for Production') { + steps { + script { + // Make a production build + sh 'npm run build' + } + } + } + } + + post { + success { + echo 'Pipeline succeeded! You may want to add additional steps or notifications here.' + } + failure { + echo 'Pipeline failed! You may want to handle failure scenarios here.' + } + } +} \ No newline at end of file From 92258f93f5aefe50dae90c2a6c56046b5837854e Mon Sep 17 00:00:00 2001 From: dovlous Date: Sun, 19 Nov 2023 13:21:23 +0100 Subject: [PATCH 02/12] Fltyy --- public/Jenkinsfile => Jenkinsfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename public/Jenkinsfile => Jenkinsfile (100%) diff --git a/public/Jenkinsfile b/Jenkinsfile similarity index 100% rename from public/Jenkinsfile rename to Jenkinsfile From 1943f4afd004350c213d52730e978e08fe902d79 Mon Sep 17 00:00:00 2001 From: dovlous Date: Sun, 19 Nov 2023 13:33:25 +0100 Subject: [PATCH 03/12] addDocker --- Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8d9d88d..7329756 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,9 @@ pipeline { - agent any + agent { + docker { + image 'node:14' // Use the desired Node.js version + } + } stages { stage('Install Dependencies') { From dc0628e8bd8394b8c48d3224ddeecf1e1e9ca82d Mon Sep 17 00:00:00 2001 From: dovlous Date: Sun, 19 Nov 2023 15:00:07 +0100 Subject: [PATCH 04/12] AddNPM --- Jenkinsfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 7329756..4ca86c0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,6 +6,15 @@ pipeline { } stages { + stage('Fix npm Cache Ownership') { + steps { + script { + // Run the chown command + sh 'sudo chown -R 126:137 "/.npm"' + } + } + } + stage('Install Dependencies') { steps { script { From 350b4ccfb4517de98cfe760eeac6ef8f8e04ad11 Mon Sep 17 00:00:00 2001 From: dovlous Date: Sun, 19 Nov 2023 15:02:54 +0100 Subject: [PATCH 05/12] NPM2 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4ca86c0..7216d5e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { steps { script { // Run the chown command - sh 'sudo chown -R 126:137 "/.npm"' + sh 'chown -R 126:137 /.npm' } } } From cac711d99444735cf42054c3ef952d8c2eac883a Mon Sep 17 00:00:00 2001 From: dovlous Date: Sun, 19 Nov 2023 15:04:54 +0100 Subject: [PATCH 06/12] f --- Jenkinsfile | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7216d5e..7329756 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,15 +6,6 @@ pipeline { } stages { - stage('Fix npm Cache Ownership') { - steps { - script { - // Run the chown command - sh 'chown -R 126:137 /.npm' - } - } - } - stage('Install Dependencies') { steps { script { From 6afe265249bbf65cf2795e8c581e691cf3d8d38b Mon Sep 17 00:00:00 2001 From: dovlous Date: Sun, 19 Nov 2023 15:08:35 +0100 Subject: [PATCH 07/12] j --- Jenkinsfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 7329756..7f6f267 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,6 +6,15 @@ pipeline { } stages { + stage('Clean npm Cache') { + steps { + script { + // Clean npm cache + sh 'npm cache clean --force' + } + } + } + stage('Install Dependencies') { steps { script { From 03db637c3e1f53c3d98dbe3d8a9bf489067cdf74 Mon Sep 17 00:00:00 2001 From: dovlous Date: Sun, 19 Nov 2023 15:14:18 +0100 Subject: [PATCH 08/12] sAddhome --- Jenkinsfile | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7f6f267..b478dc6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,17 +4,13 @@ pipeline { image 'node:14' // Use the desired Node.js version } } + environment { + HOME = '.' + } stages { - stage('Clean npm Cache') { - steps { - script { - // Clean npm cache - sh 'npm cache clean --force' - } - } - } + stage('Install Dependencies') { steps { script { From 760ed556779472c796451a24d8c6abc5f19d83e3 Mon Sep 17 00:00:00 2001 From: dovlous Date: Sun, 19 Nov 2023 15:35:23 +0100 Subject: [PATCH 09/12] NPM start --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index b478dc6..096483b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,6 +25,7 @@ pipeline { script { // Run dev server with live preview sh 'npm run watch' + sh 'npm start' } } } From 8f014d8a467bac979c1cd373ed1964ba8cfea5dd Mon Sep 17 00:00:00 2001 From: dovlous Date: Sun, 19 Nov 2023 15:38:34 +0100 Subject: [PATCH 10/12] Start --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 096483b..a4554ee 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,6 @@ pipeline { steps { script { // Run dev server with live preview - sh 'npm run watch' sh 'npm start' } } From e7b1ce3c03c84fb3ef94c3b1f1a2d00cc90d420c Mon Sep 17 00:00:00 2001 From: dovlous Date: Sun, 19 Nov 2023 15:42:54 +0100 Subject: [PATCH 11/12] start --- Jenkinsfile | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a4554ee..b64ac2e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,42 +9,41 @@ pipeline { } stages { - - stage('Install Dependencies') { steps { script { - // Install Node.js dependencies sh 'npm install' } } } - stage('Run Dev Server') { + stage('Build') { steps { script { - // Run dev server with live preview - sh 'npm start' + sh 'npm run build' } } } - stage('Build for Production') { + stage('Run Local Test Version') { steps { script { - // Make a production build - sh 'npm run build' + // Assuming you have a script to start your application locally + sh 'npm start' } } } + + // Add other stages as needed + } post { success { - echo 'Pipeline succeeded! You may want to add additional steps or notifications here.' + echo 'Pipeline succeeded!' } failure { - echo 'Pipeline failed! You may want to handle failure scenarios here.' + echo 'Pipeline failed!' } } } \ No newline at end of file From c4d49c3fd52af32cc314402cece8dbcb2d304c97 Mon Sep 17 00:00:00 2001 From: dovlous Date: Sun, 19 Nov 2023 15:47:28 +0100 Subject: [PATCH 12/12] Run watch --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b64ac2e..cdb528d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,7 +29,7 @@ pipeline { steps { script { // Assuming you have a script to start your application locally - sh 'npm start' + sh 'npm run watch' } } }