Skip to content
Permalink
Browse files

Add r package upload

  • Loading branch information...
mhamilton723 committed Jul 8, 2019
1 parent 2fbd81c commit dc1554f00e0ed2829e65d0414da847ad59094e45
Showing with 24 additions and 4 deletions.
  1. +23 −3 build.sbt
  2. +1 −1 pipeline.yaml
@@ -1,6 +1,6 @@
import java.io.{File, PrintWriter}
import java.io.File
import java.net.URL
import java.util.{Random, UUID}
import java.util.UUID

import org.apache.commons.io.FileUtils
import sbt.internal.util.ManagedLogger
@@ -119,6 +119,17 @@ def downloadFromBlob(source: String, dest: String,
"--account-key", Secrets.storageKey)
Process(osPrefix ++ command) ! log
}
def singleUploadToBlob(source: String, dest: String,
container: String, log: ManagedLogger,
accountName: String="mmlspark"): Int = {
val command = Seq("az", "storage", "blob", "upload",
"--file", source,
"--container-name", container,
"--name", dest,
"--account-name", accountName,
"--account-key", Secrets.storageKey)
Process(osPrefix ++ command) ! log
}

val publishDocs = TaskKey[Unit]("publishDocs", "publish docs for scala and python")
publishDocs := {
@@ -151,7 +162,7 @@ val downloadCloudCodeCov = TaskKey[Unit]("downloadCloudCodeCov",
"download code coverage files from blob")
downloadCloudCodeCov := {
val s = streams.value
val scoverageDir = join("target", "scala-2.11", "scoverage-data")
val scoverageDir = join("target", "scala-2.11", "scoverage-data")
val v = version.value
downloadFromBlob(v + "/**/scoverage.measurements.*", scoverageDir.toString, "coverage", s.log)
join(scoverageDir.toString, v).listFiles().foreach { d =>
@@ -167,6 +178,15 @@ downloadCloudCodeCov := {
FileUtils.forceDelete(join(scoverageDir.toString, v))
}

val publishR = TaskKey[Unit]("publishR", "publish R package to blob")
publishR := {
val s = streams.value
(run in IntegrationTest2).toTask("").value
val rPackage = join("target", "scala-2.11", "generated", "package", "R")
.listFiles().head
singleUploadToBlob(rPackage.toString,rPackage.getName, "rrr", s.log)
}

def pythonizeVersion(v: String): String = {
if (v.contains("+")){
v.split("+".head).head + ".dev1"
@@ -71,7 +71,7 @@ jobs:
- bash: |
source activate mmlspark
sbt packagePython
sbt publishBlob publishDocs
sbt publishBlob publishDocs publishR
sbt genBuildInfo
echo "##vso[task.uploadsummary]$(pwd)/target/Build.md"
displayName: Publish Artifacts

0 comments on commit dc1554f

Please sign in to comment.
You can’t perform that action at this time.