Skip to content

Commit

Permalink
Jenkinsfile: pull latest image from downloads server
Browse files Browse the repository at this point in the history
Signed-off-by: Nikhil Zinjurde <[email protected]>
  • Loading branch information
nikhil-zinjurde-imgtec committed Mar 27, 2017
1 parent cf54ab9 commit e7f2bba
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
#!/usr/bin/env groovy

import groovy.json.JsonSlurper

@NonCPS
def jsonParse(def jsonUrl) {
def result = new JsonSlurper().parse(jsonUrl)
return result
}

def getLatestImageUrl() {
def url = new URL('http://downloads.creatordev.io/openwrt/release.json')
def ci40 = jsonParse(url)
def latestImageUrl = "http://downloads.creatordev.io/openwrt/latest/pistachio/marduk/openWrt-${ci40.versions.openwrt}-${ci40.board}-${ci40.profile}-squashfs-factory.ubi"
return latestImageUrl
}

def configureDut() {
sh 'echo "ifconfig eth0 up" > /dev/ttyUSB0'
sh 'echo "ifconfig eth1 up" > /dev/ttyUSB0'
Expand Down Expand Up @@ -27,8 +44,7 @@ properties([
Path to a directory containing the packages folder,\
if null defaults to the directory of the image',
name: "PACKAGES_PATH"),
stringParam(defaultValue:
'http://downloads.creatordev.io/openwrt/ci40-v1.1.0/pistachio/marduk/openwrt-v1.1.0-pistachio-marduk-squashfs-factory.ubi',
stringParam(defaultValue: getLatestImageUrl(),
description:
'Either path directly to the image, or path to a Jenkins job from where to get the image',
name: "IMAGE_PATH"),
Expand Down

0 comments on commit e7f2bba

Please sign in to comment.