-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
260 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
node { | ||
def SOURCEDIR = pwd() | ||
try { | ||
stage("Clean up") { | ||
step([$class: 'WsCleanup']) | ||
} | ||
stage("Checkout Code") { | ||
checkout scm | ||
} | ||
stage("Test with Docker") { | ||
withEnv(["API_KEY=${env.ROSETTE_API_KEY}", "ALT_URL=${env.BINDING_TEST_URL}"]) { | ||
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source rosetteapi/docker-r" | ||
} | ||
} | ||
slack(true) | ||
} catch (e) { | ||
currentBuild.result = "FAILED" | ||
slack(false) | ||
throw e | ||
} | ||
} | ||
|
||
def slack(boolean success) { | ||
def color = success ? "#00FF00" : "#FF0000" | ||
def status = success ? "SUCCESSFUL" : "FAILED" | ||
def message = status + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})" | ||
slackSend(color: color, channel: "#rapid", message: message) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
source("../R/Api.R") | ||
library(jsonlite) | ||
library("optparse") | ||
|
||
option_list = list( make_option(c("-k", "--key"), action="store", default=NA, type='character', | ||
help="Rosette API key"), make_option(c("-u", "--url"), action="store", default=NA, type='character', | ||
help="Rosette API url")) | ||
opt_parser = OptionParser(option_list=option_list) | ||
opt = parse_args(opt_parser) | ||
|
||
name_dedupe_data <- "John Smith,Johnathon Smith,Fred Jones" | ||
|
||
|
||
text <- unlist(strsplit(name_dedupe_data, ",")) | ||
targetLanguage <- rep("eng", length(text)) | ||
targetScript <- rep("Latn", length(text)) | ||
|
||
names = data.frame(text, targetLanguage, targetScript) | ||
parameters <- list() | ||
parameters[[ "names" ]] <- names | ||
parameters[[ "threshold" ]] <- 0.75 | ||
|
||
if (is.na(opt$url)){ | ||
result <- api(opt$key, "name-deduplication", parameters) | ||
} else { | ||
result <- api(opt$key, "name-deduplication", parameters, NULL, NULL, opt$url) | ||
} | ||
print(jsonlite::toJSON(result$header, pretty = TRUE)) | ||
print(jsonlite::toJSON(result$content, pretty = TRUE)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.