|  | 
| 1 | 1 | // Copyright (c) 2017, 2022, Oracle and/or its affiliates. | 
| 2 | 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. | 
| 3 | 3 | // | 
|  | 4 | +import groovy.json.JsonSlurper | 
|  | 5 | +import java.time.Instant | 
|  | 6 | +import java.time.temporal.ChronoUnit | 
|  | 7 | + | 
| 4 | 8 | def kind_k8s_map = [ | 
| 5 | 9 |  '0.11.1': [ | 
| 6 | 10 |  '1.23.3': 'kindest/node:v1.23.3@sha256:0cb1a35ccd539118ce38d29a97823bae8fcef22fc94e9e33c0f4fadcdf9d4059', | 
| @@ -51,6 +55,26 @@ def kind_k8s_map = [ | 
| 51 | 55 | ] | 
| 52 | 56 | def _kind_image = null | 
| 53 | 57 | 
 | 
|  | 58 | +def printLatestChanges() { | 
|  | 59 | + // Show the latest changes for toolkit projects to help with troubleshooting build failures | 
|  | 60 | + def projectMap = [ 'WIT': 'https://api.github.com/repos/oracle/weblogic-image-tool/commits', | 
|  | 61 | + 'WDT': 'https://api.github.com/repos/oracle/weblogic-deploy-tooling/commits'] | 
|  | 62 | + def result = new StringBuilder().append("Project changes in last 2 days:") | 
|  | 63 | + def since = Instant.now().minus(2, ChronoUnit.DAYS).toString() | 
|  | 64 | + for ( def project in projectMap.entrySet() ) { | 
|  | 65 | + def projectCommitsResp = httpRequest project.value + '?since=' + since | 
|  | 66 | + if(projectCommitsResp.getStatus() == 200) { | 
|  | 67 | + def projectCommits = new JsonSlurper().parseText( projectCommitsResp.getContent() ) | 
|  | 68 | + projectCommits.each{ | 
|  | 69 | + result.append('\n').append(project.key).append(' : ').append(it.commit.message) | 
|  | 70 | + } | 
|  | 71 | + } else { | 
|  | 72 | + result.append('\n').append(project.key).append(' : HTTP ERROR, failed to get commits') | 
|  | 73 | + } | 
|  | 74 | + } | 
|  | 75 | + print result | 
|  | 76 | +} | 
|  | 77 | + | 
| 54 | 78 | pipeline { | 
| 55 | 79 |  agent { label 'VM.Standard2.8' } | 
| 56 | 80 |  options { | 
| @@ -254,6 +278,7 @@ pipeline { | 
| 254 | 278 |  ulimit -a | 
| 255 | 279 |  ulimit -aH | 
| 256 | 280 |  ''' | 
|  | 281 | + printLatestChanges() | 
| 257 | 282 |  script { | 
| 258 | 283 |  def knd = params.KIND_VERSION | 
| 259 | 284 |  def k8s = params.KUBE_VERSION | 
|  | 
0 commit comments