Skip to content

Commit

Permalink
构建版本状态、升级node插件
Browse files Browse the repository at this point in the history
  • Loading branch information
cgw committed Aug 27, 2023
1 parent 2c0ef84 commit 4c1c1fd
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ protected String buildVersion(BuildParam buildParam) {
logger.info("Start to build version");

// 2.下载分支代码
if (context.getCodeRepoStrategy().downloadCode(context)) {
if (context.getCodeRepoStrategy().downloadBranch(context)) {
logger.info("Download branch successfully");
} else {
LogUtils.throwException(logger, MessageCodeEnum.DOWNLOAD_BRANCH);
Expand Down Expand Up @@ -652,9 +652,9 @@ private boolean execCommand(String customizedJavaHome, String cmd) {
while ((line = in.readLine()) != null) {
logger.info(line);
}

p.waitFor();
return p.exitValue() == 0;
}catch (IOException e) {
}catch (Exception e) {
logger.error("Failed read proccss message", e);
LogUtils.throwException(logger, MessageCodeEnum.PACK_FAILURE);
}finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public abstract class CodeRepoStrategy {

public static final Logger logger = LoggerFactory.getLogger(CodeRepoStrategy.class);

void clearOldCode(DeploymentContext context) {
void clearHistoryBranch(DeploymentContext context) {
File[] hisBranchs = new File(localPathOfBranch(context)).getParentFile().listFiles();
//异步清除历史代码
ThreadPoolUtils.async(new Runnable() {
Expand All @@ -31,19 +31,19 @@ public void run() {
try {
FileUtils.deleteDirectory(h);
} catch (IOException e) {
logger.error("Failed to clear branch file", e);
logger.error("Failed to clear local branch", e);
}
}
}
});
}

public boolean downloadCode(DeploymentContext context) {
clearOldCode(context);
return doDownloadCode(context);
public boolean downloadBranch(DeploymentContext context) {
clearHistoryBranch(context);
return doDownloadBranch(context);
}

abstract boolean doDownloadCode(DeploymentContext context);
abstract boolean doDownloadBranch(DeploymentContext context);

public abstract void mergeBranch(DeploymentContext context);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class GitHubCodeRepoStrategy extends CodeRepoStrategy {

@Override
public boolean doDownloadCode(DeploymentContext context) {
public boolean doDownloadBranch(DeploymentContext context) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
public class GitLabCodeRepoStrategy extends CodeRepoStrategy {

@Override
public boolean doDownloadCode(DeploymentContext context) {
public boolean doDownloadBranch(DeploymentContext context) {
String appId = context.getApp().getCodeRepoPath();
String branchName = context.getBranchName();
GitLabApi gitLabApi = gitLabApi(context.getGlobalConfigAgg().getCodeRepo());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
<version>1.13.4</version>
<executions>
<execution>
<id>install node and pnpm</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
<version>1.13.4</version>
<executions>
<execution>
<id>install node and npm</id>
Expand Down
8 changes: 4 additions & 4 deletions static/page/app/add.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
<div class="layui-form-item">
<label class="layui-form-label required">Node版本</label>
<div class="layui-input-block">
<input name="extendNodeParam.nodeVersion" placeholder="如:v16.15.1" autocomplete="off" class="layui-input">
<input name="extendNodeParam.nodeVersion" placeholder="如:v18.17.1" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
Expand All @@ -158,13 +158,13 @@
<div class="layui-form-item" style="display:none" id="npmVersionAddDiv">
<label class="layui-form-label required">Npm版本</label>
<div class="layui-input-block">
<input type="text" name="extendNodeParam.npmVersion" id="npmVersion" placeholder="如:v8.11.0" autocomplete="off" class="layui-input">
<input type="text" name="extendNodeParam.npmVersion" id="npmVersion" placeholder="如:v9.8.1" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item" style="display:none" id="pnpmVersionAddDiv">
<label class="layui-form-label required">Pnpm版本</label>
<div class="layui-input-block">
<input type="text" name="extendNodeParam.pnpmVersion" id="pnpmVersion" placeholder="如:v8.11.0" autocomplete="off" class="layui-input">
<input type="text" name="extendNodeParam.pnpmVersion" id="pnpmVersion" placeholder="如:v8.7.0" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
Expand Down Expand Up @@ -214,7 +214,7 @@
<div class="layui-form-item">
<label class="layui-form-label required">基础镜像</label>
<div class="layui-input-block">
<input type="text" name="baseImageNodejs" placeholder="如:dockerproxy.com/library/node:16.15.1" autocomplete="off" class="layui-input">
<input type="text" name="baseImageNodejs" placeholder="如:dockerproxy.com/library/node:18.17.1" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item required">
Expand Down
8 changes: 4 additions & 4 deletions static/page/app/update.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
<div class="layui-form-item">
<label class="layui-form-label required">Node版本</label>
<div class="layui-input-block">
<input name="extendNodeParam.nodeVersion" placeholder="如:v16.15.1" autocomplete="off" class="layui-input">
<input name="extendNodeParam.nodeVersion" placeholder="如:v18.17.1" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
Expand All @@ -160,13 +160,13 @@
<div class="layui-form-item" style="display:none" id="npmVersionUpdateDiv">
<label class="layui-form-label required">Npm版本</label>
<div class="layui-input-block">
<input type="text" name="extendNodeParam.npmVersion" id="npmVersion" placeholder="如:v8.11.0" autocomplete="off" class="layui-input">
<input type="text" name="extendNodeParam.npmVersion" id="npmVersion" placeholder="如:v9.8.1" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item" style="display:none" id="pnpmVersionUpdateDiv">
<label class="layui-form-label required">Pnpm版本</label>
<div class="layui-input-block">
<input type="text" name="extendNodeParam.pnpmVersion" id="pnpmVersion" placeholder="如:v8.11.0" autocomplete="off" class="layui-input">
<input type="text" name="extendNodeParam.pnpmVersion" id="pnpmVersion" placeholder="如:v8.7.0" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
Expand Down Expand Up @@ -216,7 +216,7 @@
<div class="layui-form-item">
<label class="layui-form-label required">基础镜像</label>
<div class="layui-input-block">
<input type="text" name="baseImageNodejs" placeholder="如:dockerproxy.com/library/node:16.15.1" autocomplete="off" class="layui-input">
<input type="text" name="baseImageNodejs" placeholder="如:dockerproxy.com/library/node:18.17.1" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item required">
Expand Down

0 comments on commit 4c1c1fd

Please sign in to comment.