From 38bb178f6dff4f593f4910f1b44c87d4bb9e1f2d Mon Sep 17 00:00:00 2001 From: dandan Date: Sat, 10 Dec 2022 18:46:09 +0000 Subject: [PATCH 01/10] Added Jenkinsfile --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a2106a4..fe1793a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,8 +30,7 @@ cat ./.env''' stage('build') { steps { - sh '''npm install -npm build''' + node(label: 'install') } } From bc0df4bd3586e3a8b4261f0d7361e2f42303d445 Mon Sep 17 00:00:00 2001 From: dandan Date: Sat, 10 Dec 2022 18:53:56 +0000 Subject: [PATCH 02/10] Added Jenkinsfile --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fe1793a..15474fe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,7 +30,9 @@ cat ./.env''' stage('build') { steps { - node(label: 'install') + sh '''ls -l +npm install +npm build''' } } From 3270b44f1d2c8310e9350ea5379f3a027418eda5 Mon Sep 17 00:00:00 2001 From: dandanalaa Date: Sat, 10 Dec 2022 19:00:13 +0000 Subject: [PATCH 03/10] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'Jenkinsfile'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 15474fe..ce3d62d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,6 @@ pipeline { agent any + tools {nodejs "Node 16.18"} stages { stage('Env reinit') { steps { @@ -29,12 +30,16 @@ cat ./.env''' } stage('build') { + steps { + sh '''ls -l''' + } + } +stage('build2') { steps { sh '''ls -l npm install npm build''' } } - } } \ No newline at end of file From 7d490ac360768fb709a47af082cc11aa137f4eb8 Mon Sep 17 00:00:00 2001 From: dandan Date: Sat, 10 Dec 2022 19:02:06 +0000 Subject: [PATCH 04/10] Added Jenkinsfile --- Jenkinsfile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ce3d62d..97b105a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,5 @@ pipeline { agent any - tools {nodejs "Node 16.18"} stages { stage('Env reinit') { steps { @@ -31,15 +30,20 @@ cat ./.env''' stage('build') { steps { - sh '''ls -l''' + sh 'ls -l' } } -stage('build2') { + + stage('build2') { steps { - sh '''ls -l -npm install -npm build''' + sh '''npm install +npm run build +npm run start''' } } + + } + tools { + nodejs 'Node 16.18' } } \ No newline at end of file From 69027e8436c7efee9db784ca2b096f2e92aa5944 Mon Sep 17 00:00:00 2001 From: dandan Date: Sat, 10 Dec 2022 19:12:30 +0000 Subject: [PATCH 05/10] Added Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 97b105a..ef730d7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,7 +38,7 @@ cat ./.env''' steps { sh '''npm install npm run build -npm run start''' +systemctl list-unit-files --type=service''' } } From b20c1327e243b7ff92df28cda2db39fe0b9a4c69 Mon Sep 17 00:00:00 2001 From: dandan Date: Sat, 10 Dec 2022 19:17:37 +0000 Subject: [PATCH 06/10] Added Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ef730d7..a2f12f5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,7 +38,7 @@ cat ./.env''' steps { sh '''npm install npm run build -systemctl list-unit-files --type=service''' +npm test''' } } From f843ee972ca192d38979963719690d86aa603d11 Mon Sep 17 00:00:00 2001 From: dandan Date: Sat, 10 Dec 2022 19:25:29 +0000 Subject: [PATCH 07/10] Added Jenkinsfile --- Jenkinsfile | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a2f12f5..1753968 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,9 +36,33 @@ cat ./.env''' stage('build2') { steps { - sh '''npm install + sh '''echo \'The following "npm" command builds your Node.js/React application for\' +echo \'production in the local "build" directory (i.e. within the\' +echo \'"/var/jenkins_home/workspace/simple-node-js-react-app" directory),\' +echo \'correctly bundles React in production mode and optimizes the build for\' +echo \'the best performance.\' +set -x npm run build -npm test''' +set +x + +echo \'The following "npm" command runs your Node.js/React application in\' +echo \'development mode and makes the application available for web browsing.\' +echo \'The "npm start" command has a trailing ampersand so that the command runs\' +echo \'as a background process (i.e. asynchronously). Otherwise, this command\' +echo \'can pause running builds of CI/CD applications indefinitely. "npm start"\' +echo \'is followed by another command that retrieves the process ID (PID) value\' +echo \'of the previously run process (i.e. "npm start") and writes this value to\' +echo \'the file ".pidfile".\' +set -x +npm start & +sleep 1 +echo $! > .pidfile +set +x + +echo \'Now...\' +echo \'Visit http://localhost:3000 to see your Node.js/React application in action.\' +echo \'(This is why you specified the "args \'\'-p 3000:3000\'\'" parameter when you\' +echo \'created your initial Pipeline as a Jenkinsfile.)\'''' } } From 71871f21a6bb763b868f2be79a06ce373b6404da Mon Sep 17 00:00:00 2001 From: dandan Date: Sat, 10 Dec 2022 19:27:03 +0000 Subject: [PATCH 08/10] Added Jenkinsfile --- Jenkinsfile | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1753968..67867eb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,33 +36,8 @@ cat ./.env''' stage('build2') { steps { - sh '''echo \'The following "npm" command builds your Node.js/React application for\' -echo \'production in the local "build" directory (i.e. within the\' -echo \'"/var/jenkins_home/workspace/simple-node-js-react-app" directory),\' -echo \'correctly bundles React in production mode and optimizes the build for\' -echo \'the best performance.\' -set -x -npm run build -set +x - -echo \'The following "npm" command runs your Node.js/React application in\' -echo \'development mode and makes the application available for web browsing.\' -echo \'The "npm start" command has a trailing ampersand so that the command runs\' -echo \'as a background process (i.e. asynchronously). Otherwise, this command\' -echo \'can pause running builds of CI/CD applications indefinitely. "npm start"\' -echo \'is followed by another command that retrieves the process ID (PID) value\' -echo \'of the previously run process (i.e. "npm start") and writes this value to\' -echo \'the file ".pidfile".\' -set -x -npm start & -sleep 1 -echo $! > .pidfile -set +x - -echo \'Now...\' -echo \'Visit http://localhost:3000 to see your Node.js/React application in action.\' -echo \'(This is why you specified the "args \'\'-p 3000:3000\'\'" parameter when you\' -echo \'created your initial Pipeline as a Jenkinsfile.)\'''' + sh '''npm run build +npm start & sleep 1''' } } From 24cca03a100a4ba99cd9ed052b07dc205c901bc2 Mon Sep 17 00:00:00 2001 From: dandan Date: Sat, 10 Dec 2022 19:27:59 +0000 Subject: [PATCH 09/10] Added Jenkinsfile --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 67867eb..137f9c4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,7 +36,8 @@ cat ./.env''' stage('build2') { steps { - sh '''npm run build + sh '''npm install +npm run build npm start & sleep 1''' } } From 755aed38d6fab32ff3d9a7d7da047175d51bd1c9 Mon Sep 17 00:00:00 2001 From: dandan Date: Sat, 10 Dec 2022 19:53:17 +0000 Subject: [PATCH 10/10] Added Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 137f9c4..3c2de08 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,7 +38,7 @@ cat ./.env''' steps { sh '''npm install npm run build -npm start & sleep 1''' +npm start & sleep 100''' } }