getdownDir = ""
reportRsyncCmd = false
buildDist = true
+ buildProperties = buildPropertiesFile
switch (CHANNEL) {
case "BUILD":
// TODO: get bamboo build artifact URL for getdown artifacts
getdown_app_dir = getdown_app_dir_alt
+ buildProperties = jalviewDir + "/" + classesDir +"/" + buildPropertiesFile
break
case "RELEASE":
getdownDir = getdown_channel_name + "/" + JAVA_VERSION
getdown_app_base = getdown_channel_base + "/" + getdownDir
getdown_app_dir = getdown_app_dir_release
+ buildProperties = jalviewDir + "/" + classesDir +"/" + buildPropertiesFile
reportRsyncCommand = true
break
getdownDir = getdown_channel_name + "/" + JAVA_VERSION
getdown_app_base = getdown_channel_base + "/" + getdownDir
getdown_app_dir = getdown_app_dir_alt
- if (!file(ARCHIVEDIST).exists()) {
- print "Must provide an ARCHIVEDIST value to produce an archive distribution"
- exit(2)
+ if (!file(ARCHIVEDIR+"/"+packageDir).exists()) {
+ print "Must provide an ARCHIVEDIR value to produce an archive distribution"
+ exit
} else {
- packageDir = ARCHIVEDIST
+ packageDir = ARCHIVEDIR + "/" + packageDir
+ buildProperties = ARCHIVEDIR +"/" + classesDir + "/" + buildPropertiesFile
buildDist = false
}
reportRsyncCommand = true
break
case "ARCHIVELOCAL":
- getdown_channel_name = CHANNEL.toLowerCase()+"/"+JALVIEW_VERSION
+ getdown_channel_name = "archive" + "/" + JALVIEW_VERSION
getdownDir = getdown_channel_name + "/" + JAVA_VERSION
- //getdown_app_base = getdown_channel_base + "/" + getdownDir
getdown_app_base = file(getdownWebsiteDir).toURI().toString()
getdown_app_dir = getdown_app_dir_alt
- if (!file(ARCHIVEDIST).exists()) {
- print "Must provide an ARCHIVEDIST value to produce an archive distribution"
- exit(2)
+ if (!file(ARCHIVEDIR+"/"+packageDir).exists()) {
+ print "Must provide an ARCHIVEDIR value to produce an archive distribution"
+ exit
} else {
- packageDir = ARCHIVEDIST
+ packageDir = ARCHIVEDIR + "/" + packageDir
+ buildProperties = ARCHIVEDIR +"/" + classesDir + "/" + buildPropertiesFile
buildDist = false
}
reportRsyncCommand = true
getdownDir = getdown_channel_name + "/" + JAVA_VERSION
getdown_app_base = getdown_channel_base + "/" + getdownDir
getdown_app_dir = getdown_app_dir_alt
+ buildProperties = jalviewDir + "/" + classesDir +"/" + buildPropertiesFile
reportRsyncCommand = true
break
getdownDir = getdown_channel_name + "/" + JAVA_VERSION
getdown_app_base = getdown_channel_base + "/" + getdownDir
getdown_app_dir = getdown_app_dir_alt
+ buildProperties = jalviewDir + "/" + classesDir +"/" + buildPropertiesFile
reportRsyncCommand = true
break
getdownDir = getdown_channel_name + "/" + JAVA_VERSION
getdown_app_base = getdown_channel_base + "/" + getdownDir
getdown_app_dir = getdown_app_dir_alt
+ buildProperties = jalviewDir + "/" + classesDir +"/" + buildPropertiesFile
reportRsyncCommand = true
break
case "LOCAL":
getdown_app_base = file(getdownWebsiteDir).toURI().toString()
getdown_app_dir = getdown_app_dir_alt
+ buildProperties = jalviewDir + "/" + classesDir +"/" + buildPropertiesFile
break
default: // something wrong specified
print("CHANNEL must be one of BUILD, RELEASE, ARCHIVE, DEVELOP, TEST-RELEASE, SCRATCH-..., LOCAL [default]")
- exit(1)
+ exit
break
}
inputs.dir("$jalviewDir/$sourceDir")
inputs.dir("$classes")
inputs.dir("$jalviewDir/$resourceDir")
- outputFile "$classes/$buildPropertiesFile"
+ outputFile (buildProperties)
// taking time specific comment out to allow better incremental builds
comment "--Jalview Build Details--\n"+getDate("yyyy-MM-dd HH:mm:ss")
//comment "--Jalview Build Details--\n"+getDate("yyyy-MM-dd")
doFirst {
copy {
- from "$classes/$buildPropertiesFile"
+ from buildProperties
rename(buildPropertiesFile, getdown_build_properties)
into project.ext.getdownWebsiteDir
}
into project.ext.getdownWebsiteDir
}
- if (CHANNEL != "ARCHIVE" && CHANNEL != "DEVELOP") {
+ if (! (CHANNEL.startsWith("ARCHIVE") || CHANNEL.startsWith("DEVELOP"))) {
copy {
from getdown_txt
from getdownLauncher
doLast {
if (reportRsyncCommand) {
def fromDir = getdownWebsiteDir + (getdownWebsiteDir.endsWith("/")?"":"/")
- def toDir = getdown_smb_mount + "/" + getdownDir + (getdownDir.endsWith("/")?"":"/")
- println "LIKELY RSYNC COMMAND:\nrsync -avh --delete '$fromDir' '$toDir'"
+ def toDir = getdown_rsync_dest + "/" + getdownDir + (getdownDir.endsWith("/")?"":"/")
+ println "LIKELY RSYNC COMMAND:"
+ println "rsync -avh --delete '$fromDir' '$toDir'"
+ if (RUNRSYNC == "true") {
+ exec {
+ commandLine "mkdir", "-p", toDir
+ }
+ exec {
+ commandLine "rsync", "-avh", "--delete", fromDir, toDir
+ }
+ }
}
}
}