■ ■ ■ ■ ■ ■
src/main/java/io/onedev/k8shelper/KubernetesHelper.java
| skipped 184 lines |
185 | 185 | | "@echo off", |
186 | 186 | | ":wait", |
187 | 187 | | "if exist \"" + markPrefix + ".skip\" (", |
188 | | - | " echo Skipping step ^\"" + escapedStepNames + "^\"...", |
| 188 | + | " echo \u001b[1mSkipping step ^\"" + escapedStepNames + "^\"...\u001b[0m", |
189 | 189 | | " echo " + LOG_END_MESSAGE, |
190 | 190 | | " goto :eof", |
191 | 191 | | ")", |
192 | 192 | | "if exist \"" + markPrefix + ".error\" (", |
193 | | - | " echo Running step ^\"" + escapedStepNames + "^\"...", |
| 193 | + | " echo \u001b[1mRunning step ^\"" + escapedStepNames + "^\"...\u001b[0m", |
194 | 194 | | " type " + markPrefix + ".error", |
195 | 195 | | " copy /y nul " + markPrefix + ".failed > nul", |
196 | 196 | | " echo " + LOG_END_MESSAGE, |
| skipped 34 lines |
231 | 231 | | "done", |
232 | 232 | | "if [ -f " + markPrefix + ".skip ]", |
233 | 233 | | "then", |
234 | | - | " echo 'Skipping step \"" + escapedStepNames + "\"...'", |
| 234 | + | " echo '\u001b[1mSkipping step \"" + escapedStepNames + "\"...'\u001b[0m", |
235 | 235 | | " echo " + LOG_END_MESSAGE, |
236 | 236 | | " exit 0", |
237 | 237 | | "fi", |
238 | 238 | | "if [ -f " + markPrefix + ".error ]", |
239 | 239 | | "then", |
240 | | - | " echo 'Running step \"" + escapedStepNames + "\"...'", |
| 240 | + | " echo '\u001b[1mRunning step \"" + escapedStepNames + "\"...\u001b[0m'", |
241 | 241 | | " cat " + markPrefix + ".error", |
242 | 242 | | " touch " + markPrefix + ".failed", |
243 | 243 | | " echo " + LOG_END_MESSAGE, |
| skipped 34 lines |
278 | 278 | | @Override |
279 | 279 | | public void consume(String line) { |
280 | 280 | | if (!line.contains("Warning: use -cacerts option to access cacerts keystore")) |
281 | | - | logger.error(line); |
| 281 | + | logger.error(wrapWithAnsiRed(line)); |
282 | 282 | | } |
283 | 283 | | |
284 | 284 | | }).checkReturnCode(); |
| skipped 18 lines |
303 | 303 | | |
304 | 304 | | @Override |
305 | 305 | | public void consume(String line) { |
306 | | - | logger.error(line); |
| 306 | + | logger.error(wrapWithAnsiRed(line)); |
307 | 307 | | } |
308 | 308 | | |
309 | 309 | | }; |
| skipped 642 lines |
952 | 952 | | for (String each: collection) |
953 | 953 | | replacedCollection.add(replacePlaceholders(each, buildHome)); |
954 | 954 | | return replacedCollection; |
| 955 | + | } |
| 956 | + | |
| 957 | + | public static String wrapWithAnsiRed(String text) { |
| 958 | + | return "\u001b[31m\u001b[1m" + text + "\u001b[0m"; |
| 959 | + | } |
| 960 | + | |
| 961 | + | public static String wrapWithAnsiYellow(String text) { |
| 962 | + | return "\u001b[33m\u001b[1m" + text + "\u001b[0m"; |
| 963 | + | } |
| 964 | + | |
| 965 | + | public static String wrapWithAnsiBold(String text) { |
| 966 | + | return "\u001b[35m\u001b[1m" + text + "\u001b[0m"; |
955 | 967 | | } |
956 | 968 | | |
957 | 969 | | } |
| skipped 1 lines |