def download(self, step, buildIdFile, tgzFile):
# only download if requested
if not self.canDownloadJenkins():
return ""
return "\n" + textwrap.dedent("""\
if [[ ! -e {RESULT} ]] ; then
BOB_DOWNLOAD_BID="$(hexdump -ve '/1 "%02x"' {BUILDID}){GEN}"
BOB_DOWNLOAD_URL="{URL}/${{BOB_DOWNLOAD_BID:0:2}}/${{BOB_DOWNLOAD_BID:2:2}}/${{BOB_DOWNLOAD_BID:4}}{SUFFIX}"
curl -sSg --fail -o {RESULT} "$BOB_DOWNLOAD_URL" || echo Download failed: $?
fi
""".format(URL=self.__url.geturl(), BUILDID=quote(buildIdFile), RESULT=quote(tgzFile),
GEN=ARCHIVE_GENERATION, SUFFIX=ARTIFACT_SUFFIX))
评论列表
文章目录