fix 修复构建触发器无法执行

This commit is contained in:
bwcx_jzy 2022-02-10 21:33:44 +08:00
parent 6f5170a5ff
commit 1397dc2562
No known key found for this signature in database
GPG Key ID: 5E48E9372088B9E5
3 changed files with 28 additions and 1 deletions

View File

@ -16,6 +16,7 @@
4. 【agent】项目 dsl 模式执行脚本变量支持直接引入 ${PROJECT_ID}、同时保留 #{PROJECT_ID} 引用
5. 【server】多处日志查看弹窗新增高亮搜索
6. 【server】本地构建命令 容器构建支持引用工作空间变量
7. 【server】修复构建触发器无法执行感谢@[老诗人](https://gitee.com/laoshirenggo)
------

View File

@ -35,6 +35,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import io.jpom.build.BuildExecuteService;
import io.jpom.common.BaseJpomController;
import io.jpom.common.BaseServerController;
import io.jpom.common.ServerOpenApi;
import io.jpom.common.interceptor.NotLogin;
import io.jpom.controller.build.BuildInfoTriggerController;
@ -119,7 +120,7 @@ public class BuildTriggerApiController extends BaseJpomController {
Assert.notNull(userModel, "没有对应数据:-1");
Assert.state(StrUtil.equals(token, item.getTriggerToken()), "触发token错误,或者已经失效");
BaseServerController.resetInfo(userModel);
JsonMessage<Integer> start = buildExecuteService.start(id, userModel, Convert.toInt(delay, 0), 1, buildRemark);
return start.toString();
}
@ -179,6 +180,7 @@ public class BuildTriggerApiController extends BaseJpomController {
jsonObject.put("msg", updateItemErrorMsg);
return;
}
BaseServerController.resetInfo(userModel);
//
JsonMessage<Integer> start = buildExecuteService.start(id, userModel, delay, 1, buildRemark);
jsonObject.put("msg", start.getMsg());

View File

@ -20,6 +20,7 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
@ -353,4 +354,27 @@ public class Test {
});
resultCallback.awaitCompletion();
}
@org.junit.Test
public void testDockerfile() throws InterruptedException {
File dir = FileUtil.file("/Users/user/IdeaProjects/Jpom-demo-case/springboot-test-jar/");
BuildImageCmd buildImageCmd = dockerClient.buildImageCmd();
buildImageCmd
.withDockerfile(FileUtil.file(dir, "Dockerfile"))
.withBaseDirectory(dir)
// .withQuiet()
.withTags(CollUtil.newHashSet("jpom-test2"));
buildImageCmd.exec(new InvocationBuilder.AsyncResultCallback<BuildResponseItem>() {
@Override
public void onNext(BuildResponseItem object) {
String stream = object.getStream();
if (stream == null) {
return;
}
System.out.print(stream);
}
}).awaitCompletion();
}
}