From c9f7737eb21d90c76800e9bab2bfc251c5a1fc59 Mon Sep 17 00:00:00 2001 From: iris_cx Date: Mon, 12 Jun 2023 07:04:51 +0000 Subject: [PATCH 01/13] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'jenkinsfilenew=5Fap?= =?UTF-8?q?i'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jenkinsfilenew_api | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkinsfilenew_api b/jenkinsfilenew_api index 98777f5..db18abb 100644 --- a/jenkinsfilenew_api +++ b/jenkinsfilenew_api @@ -3,10 +3,10 @@ podTemplate { env.IMAGE_NAME = "${IOT_IMAGES_REGISTRY}/${IOT}/${JOB_NAME}" env.IMAGE_NAME_SHORT = "${IOT}/${JOB_NAME}" - env.SVN_Add = "https://gitea.anxinyun.cn/free-sun/OperationalService.git" + #env.SVN_Add = "https://gitea.anxinyun.cn/free-sun/OperationalService.git" stage('Run shell') { - checkout([$class: 'SubversionSCM', filterChangelog: false, locations: [[cancelProcessOnExternalsFail: true, credentialsId: 'svn-build', depthOption: 'infinity', ignoreExternalsOption: true, local: '.', remote: "${SVN_Add}"]], quietOperation: true, workspaceUpdater: [$class: 'UpdateUpdater']]) + checkout(git credentialsId: 'gitea-builder', url: 'https://gitea.anxinyun.cn/free-sun/OperationalService.git') container('image-builder') { sh''' From 6cfe13e094b6c5892cc64aaee92bfd45372071de Mon Sep 17 00:00:00 2001 From: iris_cx Date: Mon, 12 Jun 2023 07:08:38 +0000 Subject: [PATCH 02/13] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'jenkinsfilenew=5Fap?= =?UTF-8?q?i'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jenkinsfilenew_api | 1 - 1 file changed, 1 deletion(-) diff --git a/jenkinsfilenew_api b/jenkinsfilenew_api index db18abb..8c3e5b3 100644 --- a/jenkinsfilenew_api +++ b/jenkinsfilenew_api @@ -3,7 +3,6 @@ podTemplate { env.IMAGE_NAME = "${IOT_IMAGES_REGISTRY}/${IOT}/${JOB_NAME}" env.IMAGE_NAME_SHORT = "${IOT}/${JOB_NAME}" - #env.SVN_Add = "https://gitea.anxinyun.cn/free-sun/OperationalService.git" stage('Run shell') { checkout(git credentialsId: 'gitea-builder', url: 'https://gitea.anxinyun.cn/free-sun/OperationalService.git') From 0bf3f69120921b2ea1a8a9bb3d6e9a179f270bc7 Mon Sep 17 00:00:00 2001 From: iris_cx Date: Mon, 12 Jun 2023 07:23:07 +0000 Subject: [PATCH 03/13] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'jenkinsfilenew=5Fap?= =?UTF-8?q?i'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jenkinsfilenew_api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkinsfilenew_api b/jenkinsfilenew_api index 8c3e5b3..a439a9e 100644 --- a/jenkinsfilenew_api +++ b/jenkinsfilenew_api @@ -5,7 +5,7 @@ podTemplate { env.IMAGE_NAME_SHORT = "${IOT}/${JOB_NAME}" stage('Run shell') { - checkout(git credentialsId: 'gitea-builder', url: 'https://gitea.anxinyun.cn/free-sun/OperationalService.git') + checkout([git credentialsId: 'gitea-builder', url: 'https://gitea.anxinyun.cn/free-sun/OperationalService.git']) container('image-builder') { sh''' From d711c7fe790f8c9f8d930abe4af37958c3e31588 Mon Sep 17 00:00:00 2001 From: iris_cx Date: Mon, 12 Jun 2023 07:25:54 +0000 Subject: [PATCH 04/13] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'jenkinsfilenew=5Fap?= =?UTF-8?q?i'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jenkinsfilenew_api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkinsfilenew_api b/jenkinsfilenew_api index a439a9e..0079ccc 100644 --- a/jenkinsfilenew_api +++ b/jenkinsfilenew_api @@ -5,7 +5,7 @@ podTemplate { env.IMAGE_NAME_SHORT = "${IOT}/${JOB_NAME}" stage('Run shell') { - checkout([git credentialsId: 'gitea-builder', url: 'https://gitea.anxinyun.cn/free-sun/OperationalService.git']) + git credentialsId: 'gitea-builder', url: 'https://gitea.anxinyun.cn/free-sun/OperationalService.git' container('image-builder') { sh''' From 939b0c54e0d92eea72a932dcc0313a5667381696 Mon Sep 17 00:00:00 2001 From: iris_cx Date: Mon, 12 Jun 2023 07:37:55 +0000 Subject: [PATCH 05/13] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'api/Dockerfile'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index 10fc786..8b6b379 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -6,11 +6,11 @@ WORKDIR /var/app EXPOSE 8080 -RUN npm config set registry=http://10.8.30.22:7000 +RUN npm config set registry=https://nexus.ngaiot.com/repository/fs-npm/ RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json RUN npm cache clean -f RUN rm -rf package-lock.json -RUN npm install --registry http://10.8.30.22:7000 +RUN npm install --registry https://nexus.ngaiot.com/repository/fs-npm/ FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12 From 1eeb2a0e5773d33e2d1e6c81cefd088e94b39378 Mon Sep 17 00:00:00 2001 From: iris_cx Date: Mon, 12 Jun 2023 07:38:19 +0000 Subject: [PATCH 06/13] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'jenkinsfilenew=5Fap?= =?UTF-8?q?i'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jenkinsfilenew_api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkinsfilenew_api b/jenkinsfilenew_api index 0079ccc..1e7883a 100644 --- a/jenkinsfilenew_api +++ b/jenkinsfilenew_api @@ -9,7 +9,7 @@ podTemplate { container('image-builder') { sh''' - /kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=./api/Dockerfilenew --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup + /kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=./api/Dockerfile --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup ''' } From 8cfba119ff2f19f6ea5aa8e26a81449654916760 Mon Sep 17 00:00:00 2001 From: iris_cx Date: Mon, 12 Jun 2023 08:03:42 +0000 Subject: [PATCH 07/13] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=87=B3=20''?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (*)增加商用构建文件 --- jenkinsfilenew_web | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 jenkinsfilenew_web diff --git a/jenkinsfilenew_web b/jenkinsfilenew_web new file mode 100644 index 0000000..ea99169 --- /dev/null +++ b/jenkinsfilenew_web @@ -0,0 +1,21 @@ +podTemplate { + node('pod-templ-jenkins-slave-common') { + + env.IMAGE_NAME = "${IOT_IMAGES_REGISTRY}/${IOT}/${JOB_NAME}" + env.IMAGE_NAME_SHORT = "${IOT}/${JOB_NAME}" + env.GIT_Add = "${GIT_ADDRESS}/free-sun/OperationalService/src/branch/dev/web" + + stage('Run shell') { + git credentialsId: 'gitea-builder', url: 'https://gitea.anxinyun.cn/free-sun/OperationalService.git' + + container('image-builder') { + sh''' + /kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=./web/Dockerfile --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup + ''' + } + + buildName "${IMAGE_NAME_SHORT}:${IMAGE_VERSION}" + buildDescription "${IMAGE_NAME}:${IMAGE_VERSION}" + } + } +} From 164cf52654cd3ae5fefdf3df4d36af8f35218730 Mon Sep 17 00:00:00 2001 From: iris_cx Date: Mon, 12 Jun 2023 08:05:09 +0000 Subject: [PATCH 08/13] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=BA=E5=95=86?= =?UTF-8?q?=E7=94=A8=E6=9E=84=E5=BB=BA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/Dockerfile b/web/Dockerfile index 2cc0abe..f8f81ce 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -6,15 +6,15 @@ WORKDIR /var/app EXPOSE 8080 -RUN npm config set registry=http://10.8.30.22:7000 +RUN npm config set registry=https://nexus.ngaiot.com/repository/fs-npm/ RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json RUN npm cache clean -f RUN rm -rf package-lock.json -RUN npm install --registry http://10.8.30.22:7000 +RUN npm install --registry https://nexus.ngaiot.com/repository/fs-npm/ RUN npm run build RUN rm -rf client/src RUN rm -rf node_modules -RUN npm install --production --registry http://10.8.30.22:7000 +RUN npm install --production --registry https://nexus.ngaiot.com/repository/fs-npm/ FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node-16:7.22-06-20 From 38ff3b63c62806b2e1d2a5c25b2e21d648f034da Mon Sep 17 00:00:00 2001 From: iris_cx Date: Mon, 12 Jun 2023 08:50:58 +0000 Subject: [PATCH 09/13] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=95=86=E7=94=A8?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/{Dockerfilenew => new.Dockerfile} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename api/{Dockerfilenew => new.Dockerfile} (100%) diff --git a/api/Dockerfilenew b/api/new.Dockerfile similarity index 100% rename from api/Dockerfilenew rename to api/new.Dockerfile From 890b340e34e7c69ea74147cf8dfdb110f1fd7801 Mon Sep 17 00:00:00 2001 From: iris_cx Date: Mon, 12 Jun 2023 08:51:41 +0000 Subject: [PATCH 10/13] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=95=86=E7=94=A8?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jenkinsfilenew_api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkinsfilenew_api b/jenkinsfilenew_api index 1e7883a..f7b5dca 100644 --- a/jenkinsfilenew_api +++ b/jenkinsfilenew_api @@ -9,7 +9,7 @@ podTemplate { container('image-builder') { sh''' - /kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=./api/Dockerfile --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup + /kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=./api/new.Dockerfile --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup ''' } From c984038a0263dc2e86f2afb2eb10cf9f17b6b966 Mon Sep 17 00:00:00 2001 From: iris_cx Date: Mon, 12 Jun 2023 08:56:23 +0000 Subject: [PATCH 11/13] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=95=86=E7=94=A8?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jenkinsfilenew_api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkinsfilenew_api b/jenkinsfilenew_api index f7b5dca..1e7883a 100644 --- a/jenkinsfilenew_api +++ b/jenkinsfilenew_api @@ -9,7 +9,7 @@ podTemplate { container('image-builder') { sh''' - /kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=./api/new.Dockerfile --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup + /kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=./api/Dockerfile --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup ''' } From ad0ef0eeee3e8cc5e673afc4d8c6e8b95a28ff40 Mon Sep 17 00:00:00 2001 From: iris_cx Date: Mon, 12 Jun 2023 08:56:38 +0000 Subject: [PATCH 12/13] =?UTF-8?q?=E5=88=A0=E9=99=A4=20'api/new.Dockerfile'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/new.Dockerfile | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 api/new.Dockerfile diff --git a/api/new.Dockerfile b/api/new.Dockerfile deleted file mode 100644 index b34d491..0000000 --- a/api/new.Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12-dev as builder -COPY . /var/app -WORKDIR /var/app -EXPOSE 8080 -RUN npm config set registry=https://nexus.ngaiot.com/repository/fs-npm/ -RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json -RUN npm cache clean -f -RUN rm -rf package-lock.json -RUN npm install --registry https://nexus.ngaiot.com/repository/fs-npm/ -FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12 -COPY --from=builder --chown=node /var/app /home/node/app -WORKDIR /home/node/app -CMD ["node", "server.js"] \ No newline at end of file From 68473f56b082e88bf5623a9f25b6e8f2ea85dcad Mon Sep 17 00:00:00 2001 From: iris_cx Date: Mon, 12 Jun 2023 08:57:11 +0000 Subject: [PATCH 13/13] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'api/Dockerfile'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/Dockerfile b/api/Dockerfile index 8b6b379..780ee6d 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -9,7 +9,7 @@ EXPOSE 8080 RUN npm config set registry=https://nexus.ngaiot.com/repository/fs-npm/ RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json RUN npm cache clean -f -RUN rm -rf package-lock.json +# RUN rm -rf package-lock.json RUN npm install --registry https://nexus.ngaiot.com/repository/fs-npm/ FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12