From 37eded7a90f164d6a8ff01bc27a7f38b9da2901b Mon Sep 17 00:00:00 2001 From: Yang Date: Tue, 28 Mar 2023 07:41:26 +0800 Subject: [PATCH 01/21] fix: add Jenkinsfile of pipeline --- Jenkinsfile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000..90c4d5cfba --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,15 @@ +pipeline { + agent { + docker { + image 'node:lts-bullseye-slim' + args '-p 3000:3000' + } + } + stages { + stage('Build') { + steps { + sh 'npm install' + } + } + } +} \ No newline at end of file From 27dc02ed4e683253d412449149ddbd2e0ee282ca Mon Sep 17 00:00:00 2001 From: Yang Date: Wed, 29 Mar 2023 23:40:51 +0800 Subject: [PATCH 02/21] fix: Add 'Test' stage --- Jenkinsfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 90c4d5cfba..17ff1661f9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,5 +11,10 @@ pipeline { sh 'npm install' } } + stage('Test') { + steps { + sh './jenkins/scripts/test.sh' + } + } } } \ No newline at end of file From dddc205b165ed0083b230921f05bc6ce9d5897e2 Mon Sep 17 00:00:00 2001 From: Yang Date: Wed, 29 Mar 2023 23:44:26 +0800 Subject: [PATCH 03/21] fix: Add 'Deliver' stage --- Jenkinsfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 17ff1661f9..5da79cbdf7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,5 +16,12 @@ pipeline { sh './jenkins/scripts/test.sh' } } + stage('Deliver') { + steps { + sh './jenkins/scripts/deliver.sh' + input message: 'Finished using the web site? (Click "Proceed" to continue)' + sh './jenkins/scripts/kill.sh' + } + } } } \ No newline at end of file From 07801c2dc66f6432d86153b0ad67dbae99f2f2b9 Mon Sep 17 00:00:00 2001 From: Yang Date: Thu, 30 Mar 2023 12:28:46 +0800 Subject: [PATCH 04/21] fix: change another port --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5da79cbdf7..5bbdaab4ea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent { docker { image 'node:lts-bullseye-slim' - args '-p 3000:3000' + args '-p 33000:3000' } } stages { From 9efd1395cc046781f562a7e9228e1518bac22c42 Mon Sep 17 00:00:00 2001 From: Yang Date: Thu, 30 Mar 2023 12:39:31 +0800 Subject: [PATCH 05/21] fix: add debug info --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 5bbdaab4ea..b1615b8d42 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,6 +8,7 @@ pipeline { stages { stage('Build') { steps { + sh 'npm config ls -l' sh 'npm install' } } From 503d5271486da7df069d218964e6957bf2924908 Mon Sep 17 00:00:00 2001 From: Yang Date: Thu, 30 Mar 2023 13:11:35 +0800 Subject: [PATCH 06/21] fix: debug --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b1615b8d42..fc64be5511 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,7 +8,8 @@ pipeline { stages { stage('Build') { steps { - sh 'npm config ls -l' + sh 'npm version' + sh 'npm config get cache' sh 'npm install' } } From 44e497971d2115e8b8153ec980cf1b055e800868 Mon Sep 17 00:00:00 2001 From: Yang Date: Thu, 30 Mar 2023 13:14:05 +0800 Subject: [PATCH 07/21] fix: debug --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index fc64be5511..7ca9612af8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,6 +8,9 @@ pipeline { stages { stage('Build') { steps { + sh 'pwd' + sh 'id' + sh 'echo $HOME' sh 'npm version' sh 'npm config get cache' sh 'npm install' From 725349c88bb0f7aad17e6dc227e31819aee01d25 Mon Sep 17 00:00:00 2001 From: Yang Date: Thu, 30 Mar 2023 13:25:38 +0800 Subject: [PATCH 08/21] fix: debug --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7ca9612af8..7264e0353c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent { docker { image 'node:lts-bullseye-slim' - args '-p 33000:3000' + args '-p 33000:3000 -u node:node' } } stages { From 5a3f4d12e139d9c85f77d3e57897a3ff9740167e Mon Sep 17 00:00:00 2001 From: Yang Date: Thu, 30 Mar 2023 13:45:55 +0800 Subject: [PATCH 09/21] fix: debug --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7264e0353c..6d1e44f027 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent { docker { image 'node:lts-bullseye-slim' - args '-p 33000:3000 -u node:node' + args ' -u 1000:1000 -p 33000:3000' } } stages { From 0a64551a86b1d1f2e9af5cf89139e2dcf4a1db2a Mon Sep 17 00:00:00 2001 From: Yang Date: Thu, 30 Mar 2023 13:56:38 +0800 Subject: [PATCH 10/21] fix: debug --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6d1e44f027..7ca9612af8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent { docker { image 'node:lts-bullseye-slim' - args ' -u 1000:1000 -p 33000:3000' + args '-p 33000:3000' } } stages { From 8ff90eb40f9599d164a884ef62e79b72a9d6cecb Mon Sep 17 00:00:00 2001 From: Yang Date: Thu, 30 Mar 2023 14:08:20 +0800 Subject: [PATCH 11/21] fix: update --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7ca9612af8..d8d34a498e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent { docker { image 'node:lts-bullseye-slim' - args '-p 33000:3000' + args '-p 33000:3000 -u 1000:1000' } } stages { From c43a96c783fa6663fa3e862f435a045a5b742561 Mon Sep 17 00:00:00 2001 From: Yang Date: Thu, 30 Mar 2023 15:41:07 +0800 Subject: [PATCH 12/21] fix: debug --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d8d34a498e..0bd3cdca65 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent { docker { image 'node:lts-bullseye-slim' - args '-p 33000:3000 -u 1000:1000' + args '-p 33000:3000 -u 1000:1000 /bin/bash' } } stages { From 412ad3a3ed53b1fa8a422f4c79a725e9f3c3d430 Mon Sep 17 00:00:00 2001 From: Yang Date: Thu, 30 Mar 2023 16:05:20 +0800 Subject: [PATCH 13/21] fix: debug --- Jenkinsfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0bd3cdca65..4d65ba5867 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,16 +2,12 @@ pipeline { agent { docker { image 'node:lts-bullseye-slim' - args '-p 33000:3000 -u 1000:1000 /bin/bash' + args '-p 33000:3000 -u 1000:1000' } } stages { stage('Build') { steps { - sh 'pwd' - sh 'id' - sh 'echo $HOME' - sh 'npm version' sh 'npm config get cache' sh 'npm install' } From 2aaf4d2fbc39ef7fedf1ff34991b4e3bfb6a5bf2 Mon Sep 17 00:00:00 2001 From: Yang Date: Thu, 30 Mar 2023 17:17:30 +0800 Subject: [PATCH 14/21] fix: debug --- Dockerfile.build | 15 +++++++++++++++ Jenkinsfile | 15 ++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 Dockerfile.build diff --git a/Dockerfile.build b/Dockerfile.build new file mode 100644 index 0000000000..6138db2f2c --- /dev/null +++ b/Dockerfile.build @@ -0,0 +1,15 @@ +FROM node:lts-bullseye-slim + +ARG GID +ARG UID +ARG UNAME + +ENV GROUP_ID=$GID +ENV USER_ID=$UID +ENV USERNAME=$UNAME + +RUN mkdir /home/$USERNAME + +RUN groupadd -g $GROUP_ID $USERNAME +RUN useradd -r -u $USER_ID -g $USERNAME -d /home/$USERNAME $USERNAME +RUN chown $USERNAME:$USERNAME /home/$USERNAME diff --git a/Jenkinsfile b/Jenkinsfile index 4d65ba5867..3953184908 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,8 +1,17 @@ pipeline { + environment { + JENKINS_USER_NAME = "${sh(script:'id -un', returnStdout: true).trim()}" + JENKINS_USER_ID = "${sh(script:'id -u', returnStdout: true).trim()}" + JENKINS_GROUP_ID = "${sh(script:'id -g', returnStdout: true).trim()}" + } agent { - docker { - image 'node:lts-bullseye-slim' - args '-p 33000:3000 -u 1000:1000' + dockerfile { + filename 'Dockerfile.build' + additionalBuildArgs '''\ + --build-arg GID=$JENKINS_GROUP_ID \ + --build-arg UID=$JENKINS_USER_ID \ + --build-arg UNAME=$JENKINS_USER_NAME \ + ''' } } stages { From 3163e2b196afc31b1e72565c80c451d85f655134 Mon Sep 17 00:00:00 2001 From: Yang Date: Thu, 30 Mar 2023 17:28:05 +0800 Subject: [PATCH 15/21] fix: debug --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 3953184908..c63107f44e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,5 @@ +#!groovy + pipeline { environment { JENKINS_USER_NAME = "${sh(script:'id -un', returnStdout: true).trim()}" From 7d13af0a01ec310635b4ad7e2b7f9ffd911df249 Mon Sep 17 00:00:00 2001 From: Yang Date: Thu, 30 Mar 2023 17:37:22 +0800 Subject: [PATCH 16/21] fix: debug --- Jenkinsfile | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c63107f44e..c9b1019f2c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,18 +1,11 @@ -#!groovy - pipeline { - environment { - JENKINS_USER_NAME = "${sh(script:'id -un', returnStdout: true).trim()}" - JENKINS_USER_ID = "${sh(script:'id -u', returnStdout: true).trim()}" - JENKINS_GROUP_ID = "${sh(script:'id -g', returnStdout: true).trim()}" - } agent { dockerfile { filename 'Dockerfile.build' additionalBuildArgs '''\ - --build-arg GID=$JENKINS_GROUP_ID \ - --build-arg UID=$JENKINS_USER_ID \ - --build-arg UNAME=$JENKINS_USER_NAME \ + --build-arg GID=$(id -g) \ + --build-arg UID=$(id -u) \ + --build-arg UNAME=$(id -un) \ ''' } } From 39cbc399642ea0856c34d6e84b6311c96ad93787 Mon Sep 17 00:00:00 2001 From: Yang Date: Thu, 30 Mar 2023 17:49:28 +0800 Subject: [PATCH 17/21] fix: update --- Dockerfile.build | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile.build b/Dockerfile.build index 6138db2f2c..8210725429 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -4,12 +4,12 @@ ARG GID ARG UID ARG UNAME -ENV GROUP_ID=$GID -ENV USER_ID=$UID -ENV USERNAME=$UNAME +ENV GID=${GID} +ENV UID=${UID} +ENV UNAME=${UNAME} -RUN mkdir /home/$USERNAME +RUN mkdir /home/$UNAME -RUN groupadd -g $GROUP_ID $USERNAME -RUN useradd -r -u $USER_ID -g $USERNAME -d /home/$USERNAME $USERNAME -RUN chown $USERNAME:$USERNAME /home/$USERNAME +RUN groupadd -g $GID $UNAME +RUN useradd -r -u $UID -g $UNAME -d /home/$UNAME $UNAME +RUN chown $UNAME:$UNAME /home/$UNAME From c4dcb9264b084c31d0ba01cfb712f18af915e43f Mon Sep 17 00:00:00 2001 From: Yang Date: Fri, 31 Mar 2023 20:17:51 +0800 Subject: [PATCH 18/21] fix: exit 0 --- Dockerfile.build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile.build b/Dockerfile.build index 8210725429..cc64e522d3 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -8,8 +8,8 @@ ENV GID=${GID} ENV UID=${UID} ENV UNAME=${UNAME} -RUN mkdir /home/$UNAME +RUN mkdir /home/$UNAME; exit 0 -RUN groupadd -g $GID $UNAME -RUN useradd -r -u $UID -g $UNAME -d /home/$UNAME $UNAME -RUN chown $UNAME:$UNAME /home/$UNAME +RUN groupadd -g $GID $UNAME; exit 0 +RUN useradd -r -u $UID -g $UNAME -d /home/$UNAME $UNAME; exit 0 +RUN chown $UNAME:$UNAME /home/$UNAME; exit 0 From 09d41b0690e0b9e0cde6ec3128e098da3afe467a Mon Sep 17 00:00:00 2001 From: Yang Date: Sun, 27 Apr 2025 13:59:16 +0800 Subject: [PATCH 19/21] chore: test env --- Jenkinsfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index c9b1019f2c..9c94749476 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,6 +12,10 @@ pipeline { stages { stage('Build') { steps { + script { + BUILD_TAG = "DEV-${env.BRANCH_NAME}-${env.GIT_BRANCH}" + echo "$BUILD_TAG" + } sh 'npm config get cache' sh 'npm install' } From b5734947612524b313211512d956cdc9512b2725 Mon Sep 17 00:00:00 2001 From: Yang Date: Sun, 27 Apr 2025 14:09:25 +0800 Subject: [PATCH 20/21] chore: test env --- Jenkinsfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9c94749476..25935a4034 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,23 +13,23 @@ pipeline { stage('Build') { steps { script { - BUILD_TAG = "DEV-${env.BRANCH_NAME}-${env.GIT_BRANCH}" + BUILD_TAG = "DEV-${env.BRANCH_NAME}-${env.GIT_BRANCH}-${params.BRANCH}" echo "$BUILD_TAG" } - sh 'npm config get cache' - sh 'npm install' + // sh 'npm config get cache' + // sh 'npm install' } } stage('Test') { steps { - sh './jenkins/scripts/test.sh' + // sh './jenkins/scripts/test.sh' } } stage('Deliver') { steps { - sh './jenkins/scripts/deliver.sh' - input message: 'Finished using the web site? (Click "Proceed" to continue)' - sh './jenkins/scripts/kill.sh' + // sh './jenkins/scripts/deliver.sh' + // input message: 'Finished using the web site? (Click "Proceed" to continue)' + // sh './jenkins/scripts/kill.sh' } } } From abbc09e159a85a7839767f9a0446df9e270ebde5 Mon Sep 17 00:00:00 2001 From: Yang Date: Sun, 27 Apr 2025 14:11:20 +0800 Subject: [PATCH 21/21] chore: test --- Jenkinsfile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 25935a4034..93147e2163 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,17 +20,17 @@ pipeline { // sh 'npm install' } } - stage('Test') { - steps { - // sh './jenkins/scripts/test.sh' - } - } - stage('Deliver') { - steps { - // sh './jenkins/scripts/deliver.sh' - // input message: 'Finished using the web site? (Click "Proceed" to continue)' - // sh './jenkins/scripts/kill.sh' - } - } + // stage('Test') { + // steps { + // sh './jenkins/scripts/test.sh' + // } + // } + // stage('Deliver') { + // steps { + // sh './jenkins/scripts/deliver.sh' + // input message: 'Finished using the web site? (Click "Proceed" to continue)' + // sh './jenkins/scripts/kill.sh' + // } + // } } } \ No newline at end of file