Parcourir la source

feat:增加了NODE18的构建模板

xuxiaopang il y a 2 ans
Parent
commit
6b7b45ec36

+ 4 - 0
web/src/main/java/cn/seecoder/web/core/pipeline/template/PipelineTemplateTable.java

@@ -27,10 +27,12 @@ public class PipelineTemplateTable {
 
     //模板名
     public static final String SPRINGBOOT_JAVA8 = "SPRINGBOOT_JAVA8";
+    public static final String SPRINGBOOT_JAVA17 = "SPRINGBOOT_JAVA17";
     public static final String NODE_10 = "NODE_10";
     public static final String NODE_12 = "NODE_12";
     public static final String NODE_14 = "NODE_14";
     public static final String NODE_16 = "NODE_16";
+    public static final String NODE_18 = "NODE_18";
     public static final String MYSQL = "MYSQL";
     public static final String SONAR_JAVA8 = "SONAR_JAVA8";
 
@@ -44,7 +46,9 @@ public class PipelineTemplateTable {
         templateNames.add(NODE_12);
         templateNames.add(NODE_14);
         templateNames.add(NODE_16);
+        templateNames.add(NODE_18);
         templateNames.add(SPRINGBOOT_JAVA8);
+        templateNames.add(SPRINGBOOT_JAVA17);
         templateNames.add(MYSQL);
         templateNames.add(SONAR_JAVA8);
     }

+ 18 - 0
web/src/main/resources/template/config/NODE_18.json

@@ -0,0 +1,18 @@
+[
+  {
+    "name": "node-image-build",
+    "active": true,
+    "configs": {
+      "repoUrl": "#todo",
+      "branchName": "#todo",
+      "nginxConfig": "#todo"
+    }
+  },
+  {
+    "name": "deploy",
+    "active": true,
+    "configs": {
+      "port": "#todo"
+    }
+  }
+]

+ 13 - 0
web/src/main/resources/template/dockerfile/NODE_18

@@ -0,0 +1,13 @@
+# 前端打包dockerfile
+FROM node:18-alpine as builder
+WORKDIR /code
+RUN yarn config set registry https://registry.npm.taobao.org/
+ADD package.json /code
+RUN yarn install
+ADD . /code
+RUN yarn build
+
+FROM nginx:1.19-alpine
+COPY --from=builder /code/nginx.conf /etc/nginx/conf.d/nginx.conf
+COPY --from=builder /code/dist/ /var/www/html/dist/
+RUN chmod -R 777 /var/www/html/dist/