Skip to content

Commit 808a366

Browse files
committed
Merge branch 'develop'
2 parents 69e2468 + 69b374d commit 808a366

20 files changed

+1028
-144
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,10 @@ TestResults/
211211
build.txt
212212
build.bat
213213
test.bat
214+
215+
# Intellij
216+
.idea/
217+
218+
# Examples
219+
rosette_apiExamples/*.exe
220+
rosette_apiExamples/*.dll

CI.Jenkinsfile

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
node ("docker-light") {
2+
def sourceDir = pwd()
3+
try {
4+
stage("Clean up") {
5+
step([$class: 'WsCleanup'])
6+
}
7+
stage("Checkout Code") {
8+
checkout scm
9+
}
10+
stage("Build & Test") {
11+
withSonarQubeEnv {
12+
mySonarOpts="/k:\"rosette-api-csharp-binding\" /d:sonar.host.url=${env.SONAR_HOST_URL} /d:sonar.login=${env.SONAR_AUTH_TOKEN}"
13+
14+
if("${env.CHANGE_ID}" != "null"){
15+
mySonarOpts = "$mySonarOpts /d:sonar.pullrequest.key=${env.CHANGE_ID}"
16+
} else {
17+
mySonarOpts = "$mySonarOpts /d:sonar.branch.name=${env.BRANCH_NAME}"
18+
}
19+
20+
if ("${env.CHANGE_BRANCH}" != "null") {
21+
mySonarOpts="$mySonarOpts /d:sonar.pullrequest.base=${env.CHANGE_TARGET} /d:sonar.pullrequest.branch=${env.CHANGE_BRANCH}"
22+
}
23+
24+
sh "docker run --rm \
25+
--pull always \
26+
--volume ${sourceDir}:/source \
27+
mono:6 \
28+
bash -c \"echo && \
29+
echo [INFO] Updating package manager database. && \
30+
apt-get update -qq && \
31+
echo && \
32+
echo [INFO] Installing required OS packages. && \
33+
apt-get -qq install unzip default-jre-headless -y > /dev/null && \
34+
echo && \
35+
echo [INFO] Updating CA Certs file to address expired Lets Encrypt certificate. && \
36+
echo [INFO] https://github.com/KSP-CKAN/CKAN/wiki/SSL-certificate-errors#removing-expired-lets-encrypt-certificates && \
37+
sed -i 's,^mozilla/DST_Root_CA_X3.crt\$,!mozilla/DST_Root_CA_X3.crt,' /etc/ca-certificates.conf && \
38+
echo && \
39+
echo [INFO] Running update-ca-certificates && \
40+
update-ca-certificates && \
41+
echo && \
42+
echo [INFO] Running cert-sync && \
43+
cert-sync /etc/ssl/certs/ca-certificates.crt && \
44+
echo && \
45+
echo [INFO] Setting up Sonar Scanner && \
46+
mkdir -p /opt/sonar-scanner && \
47+
pushd /opt/sonar-scanner && \
48+
curl --silent --output sonar-scanner.zip --location https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/5.15.0.80890/sonar-scanner-msbuild-5.15.0.80890-net46.zip && \
49+
unzip -q sonar-scanner.zip && \
50+
chmod a+x /opt/sonar-scanner/sonar-scanner-*/bin/* && \
51+
pushd /source && \
52+
echo && \
53+
echo [INFO] Running Sonar Scanner Begin && \
54+
mono /opt/sonar-scanner/SonarScanner.MSBuild.exe begin ${mySonarOpts} && \
55+
echo && \
56+
echo [INFO] Restoring the solution. && \
57+
nuget restore rosette_api.sln && \
58+
echo && \
59+
echo [INFO] Running msbuild Release configuration. && \
60+
msbuild /p:Configuration=Release rosette_api.sln /t:Rebuild && \
61+
echo && \
62+
echo [INFO] Running Sonar Scanner End && \
63+
mono /opt/sonar-scanner/SonarScanner.MSBuild.exe end /d:sonar.login=\"${env.SONAR_AUTH_TOKEN}\" && \
64+
echo && \
65+
echo [INFO] Running unit tests && \
66+
mono ./packages/NUnit.Console.3.0.1/tools/nunit3-console.exe ./rosette_apiUnitTests/bin/Release/rosette_apiUnitTests.dll\""
67+
68+
// TODO: Finish coverage data gathering for Sonar.
69+
///opt/maven-basis/bin/mvn --batch-mode clean install sonar:sonar $mySonarOpts\""
70+
//pushd /tmp
71+
//dotcover_version=2022.3.1
72+
//curl --silent --location --output dotcover.tar.gz https://download.jetbrains.com/resharper/dotUltimate.2022.3.1/JetBrains.dotCover.CommandLineTools.linux-x64.2022.3.1.tar.gz
73+
//tar xzf dotcover.tar.gz
74+
}
75+
}
76+
postToTeams(true)
77+
} catch (e) {
78+
currentBuild.result = "FAILED"
79+
postToTeams(false)
80+
throw e
81+
}
82+
}
83+
84+
def postToTeams(boolean success) {
85+
def webhookUrl = "${env.TEAMS_PNC_JENKINS_WEBHOOK_URL}"
86+
def color = success ? "#00FF00" : "#FF0000"
87+
def status = success ? "SUCCESSFUL" : "FAILED"
88+
def message = "*" + status + ":* '${env.JOB_NAME}' - [${env.BUILD_NUMBER}] - ${env.BUILD_URL}"
89+
office365ConnectorSend(webhookUrl: webhookUrl, color: color, message: message, status: status)
90+
}

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ node ("docker-light") {
1111
echo "${env.ALT_URL}"
1212
def useUrl = ("${env.ALT_URL}" == "null") ? "${env.BINDING_TEST_URL}" : "${env.ALT_URL}"
1313
withEnv(["API_KEY=${env.ROSETTE_API_KEY}", "ALT_URL=${useUrl}"]) {
14-
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source rosetteapi/docker-csharp"
14+
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source rosette/docker-csharp"
1515
}
1616
}
1717
slack(true)

Jenkinsfile.examples

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,18 @@ node {
2020
withEnv(["API_KEY=${env.ROSETTE_API_KEY}", "ALT_URL=${useUrl}"]) { sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source ${TEST_CONTAINER}"
2121
}
2222
}
23-
slack(true)
23+
postToTeams(true)
2424
} catch (e) {
2525
currentBuild.result = "FAILED"
26-
slack(false)
26+
postToTeams(false)
2727
throw e
2828
}
2929
}
3030

31-
def slack(boolean success) {
31+
def postToTeams(boolean success) {
32+
def webhookUrl = "${env.TEAMS_PNC_JENKINS_WEBHOOK_URL}"
3233
def color = success ? "#00FF00" : "#FF0000"
3334
def status = success ? "SUCCESSFUL" : "FAILED"
34-
def message = status + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})"
35-
slackSend(color: color, channel: "#rapid", message: message)
36-
}
35+
def message = "*" + status + ":* '${env.JOB_NAME}' - [${env.BUILD_NUMBER}] - ${env.BUILD_URL}"
36+
office365ConnectorSend(webhookUrl: webhookUrl, color: color, message: message, status: status)
37+
}

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
<a href="https://www.rosette.com"><img src="https://s3.amazonaws.com/styleguide.basistech.com/logos/rosette-logo.png" width="181" height="47" /></a>
1+
<a href="https://www.babelstreet.com/rosette"><img src="https://s3.amazonaws.com/styleguide.basistech.com/logos/rosette-logo.png" width="181" height="47" /></a>
22

33
---
44

5-
[![Build Status](https://travis-ci.org/rosette-api/csharp.svg?branch=master)](https://travis-ci.org/rosette-api/csharp)
65
[![NuGet version](https://badge.fury.io/nu/rosette_api.svg)](https://badge.fury.io/nu/rosette_api)
76

87
## Rosette API
@@ -13,7 +12,6 @@ comparing the similarity of names, categorizing and adding linguistic tags to te
1312

1413
## Rosette API Access
1514
- Rosette Cloud [Sign Up](https://developer.rosette.com/signup)
16-
- Rosette Enterprise [Evaluation](https://www.rosette.com/product-eval/)
1715

1816
## Quick Start
1917

0 commit comments

Comments
 (0)