🗒️ 설명
스크립트 실행을 Java 단에서 사용할수있는
CommonUtil 적인 파일 하나 추가해야합니다
따로 정의해둔 스크립트를 실행시키거나 (최대한 사용)
직접적으로 Docker 명령어를 실행할수있습니다 (최대한 지양)
CommandLineUtil 를 사용하면 됩니다
해당 Class가 가지고있는 메소드의 기능은 다음과 같습니다
executeCommand: (String → String)
단순 명령어 실행 + 결과(String) 반환
executeCommandIgnoreResult: (String → void)
결과 무시
executeCommandReturnCode: (String → int)
ExitCode(정수) 반환
executeCommandAsBoolean: (String → boolean)
ExitCode 0 → true, 그 외 → false
executeCommandWithDefaultTimeout: (String → String)
기본 30초 타임아웃 적용, 결과(String) 반환
executeCommandWithTimeout: (String, long → String)
지정된 타임아웃(밀리초) 적용, 결과(String) 반환
executeCommandWithSudo: (String → String)
sudo bash -c "cmd" 형태로 실행
executeCommandWithSudoAndTimeout: (String, long → String)
sudo + 타임아웃(ExecuteWatchdog) 적용
🙋♂️ 담당자
🗒️ 설명
스크립트 실행을 Java 단에서 사용할수있는
CommonUtil 적인 파일 하나 추가해야합니다
따로 정의해둔 스크립트를 실행시키거나 (최대한 사용)
직접적으로 Docker 명령어를 실행할수있습니다 (최대한 지양)
CommandLineUtil 를 사용하면 됩니다
해당 Class가 가지고있는 메소드의 기능은 다음과 같습니다
executeCommand: (String → String)
단순 명령어 실행 + 결과(String) 반환
executeCommandIgnoreResult: (String → void)
결과 무시
executeCommandReturnCode: (String → int)
ExitCode(정수) 반환
executeCommandAsBoolean: (String → boolean)
ExitCode 0 → true, 그 외 → false
executeCommandWithDefaultTimeout: (String → String)
기본 30초 타임아웃 적용, 결과(String) 반환
executeCommandWithTimeout: (String, long → String)
지정된 타임아웃(밀리초) 적용, 결과(String) 반환
executeCommandWithSudo: (String → String)
sudo bash -c "cmd" 형태로 실행
executeCommandWithSudoAndTimeout: (String, long → String)
sudo + 타임아웃(ExecuteWatchdog) 적용
🙋♂️ 담당자