зеркало из https://github.com/microsoft/spinnaker.git
publish InstallSpinnaker.sh during release process
This commit is contained in:
Родитель
136d4b94e9
Коммит
493d178eaf
28
build.gradle
28
build.gradle
|
@ -118,3 +118,31 @@ buildRpm {
|
|||
arch = NOARCH
|
||||
os = LINUX
|
||||
}
|
||||
|
||||
task publishInstallSpinnaker {
|
||||
onlyIf { project.hasProperty('bintrayUser') && project.hasProperty('bintrayKey') }
|
||||
|
||||
doLast {
|
||||
def url = "https://api.bintray.com/content/spinnaker/scripts/SpinnakerBootstrap/1.0/InstallSpinnaker.sh?publish=1&override=1".toURL()
|
||||
def conn = url.openConnection()
|
||||
|
||||
conn.setRequestMethod('PUT')
|
||||
conn.setDoOutput(true)
|
||||
conn.addRequestProperty('Authorization', 'Basic ' + ("${project.property('bintrayUser')}:${project.property('bintrayKey')}".bytes.encodeBase64().toString()))
|
||||
conn.getOutputStream().withCloseable {
|
||||
it.write(project.file('InstallSpinnaker.sh').text.bytes)
|
||||
it.flush()
|
||||
}
|
||||
int code = conn.getResponseCode()
|
||||
|
||||
if (code != 201) {
|
||||
logger.warn "Unexpected response code from InstallSpinnaker.sh publish: $code"
|
||||
} else {
|
||||
logger.info "Uploaded InstallSpinnaker.sh"
|
||||
}
|
||||
|
||||
conn.disconnect()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.release.dependsOn('publishInstallSpinnaker')
|
||||
|
|
Загрузка…
Ссылка в новой задаче