Skip to content

Commit 877b05f

Browse files
authored
ci(jenkins): deploy to AppVeyor when master branch (#53)
1 parent 3525fae commit 877b05f

File tree

4 files changed

+54
-36
lines changed

4 files changed

+54
-36
lines changed

.ci/Jenkinsfile

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ pipeline {
99
BASE_DIR = "src/go.elastic.co/apm/${env.REPO}"
1010
NOTIFY_TO = credentials('notify-to')
1111
JOB_GCS_BUCKET = credentials('gcs-bucket')
12+
DOTNET_CLI_TELEMETRY_OPTOUT = 'true'
13+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 'true'
1214
}
1315
options {
1416
timeout(time: 1, unit: 'HOURS')
@@ -60,7 +62,7 @@ pipeline {
6062
unstash 'source'
6163
dir("${BASE_DIR}"){
6264
dotnet(){
63-
sh './build.sh'
65+
sh script: './build.sh', label: 'build'
6466
}
6567
}
6668
}
@@ -82,21 +84,38 @@ pipeline {
8284
DOTNET_ROOT = "C:\\Program Files\\dotnet"
8385
PATH = "${env.DOTNET_ROOT};${env.DOTNET_ROOT}\\tools;${env.PATH};${env.HOME}\\bin"
8486
MSBUILDDEBUGPATH = "${env.WORKSPACE}"
85-
DOTNET_CLI_TELEMETRY_OPTOUT = 'true'
86-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 'true'
8787
}
88-
steps {
89-
withGithubNotify(context: 'Windows') {
90-
unstash 'source'
91-
dir("${BASE_DIR}"){
92-
bat script: 'choco install dotnetcore-sdk -m -y --no-progress -r --version 3.0.100', label: 'Tools'
93-
bat script: 'build.bat canary', label: 'build'
88+
stages {
89+
stage('Build') {
90+
steps {
91+
withGithubNotify(context: 'Windows') {
92+
unstash 'source'
93+
dir("${BASE_DIR}"){
94+
bat script: 'choco install dotnetcore-sdk -m -y --no-progress -r --version 3.0.100', label: 'Tools'
95+
bat script: 'build.bat canary', label: 'build'
96+
}
97+
}
98+
}
99+
post {
100+
unsuccessful {
101+
archiveArtifacts(allowEmptyArchive: true, artifacts: "${MSBUILDDEBUGPATH}/**/MSBuild_*.failure.txt")
102+
}
94103
}
95104
}
96-
}
97-
post {
98-
unsuccessful {
99-
archiveArtifacts(allowEmptyArchive: true, artifacts: "${MSBUILDDEBUGPATH}/**/MSBuild_*.failure.txt")
105+
stage('Deploy') {
106+
when {
107+
branch 'master'
108+
}
109+
steps {
110+
dir("${BASE_DIR}"){
111+
release('secret/apm-team/ci/elastic-observability-appveyor')
112+
}
113+
}
114+
post {
115+
always {
116+
archiveArtifacts(allowEmptyArchive: true, artifacts: "${BASE_DIR}/**/build/output/**/*.nupkg")
117+
}
118+
}
100119
}
101120
}
102121
}
@@ -117,3 +136,10 @@ def dotnet(Closure body){
117136
body()
118137
}
119138
}
139+
140+
def release(secret){
141+
def repo = getVaultSecret(secret: secret)
142+
withEnvMask(vars: [[var: 'REPO_API_KEY', password: repo.data.apiKey], [var: 'REPO_API_URL', password: repo.data.url]]){
143+
bat(label: 'Deploy', script: ".ci/deploy.bat ${REPO_API_KEY} ${REPO_API_URL}")
144+
}
145+
}

.ci/deploy.bat

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
echo off
2+
set key=%1
3+
set url=%2
4+
5+
@echo on
6+
FOR /R ".\" %%a in (*.nupkg) DO (
7+
dotnet nuget push "%%a" -k "%key%" -s "%url%" && (
8+
echo nuget push was successful
9+
) || (
10+
echo nuget push failed
11+
exit 1
12+
)
13+
)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# Elastic Common Schema .NET
44

5+
[![Build Status](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-dotnet%2Fecs-dotnet-mbp%2Fmaster)](https://apm-ci.elastic.co/job/apm-agent-dotnet/job/ecs-dotnet-mbp/job/master/)
6+
57
This repository contains .NET integrations that use the Elastic Common Schema (ECS), including popular .NET logging frameworks. Read the [announcement post](https://www.elastic.co/blog/elastic-common-schema-dotnet-library-and-integrations-released-for-elasticsearch).
68

79
The Elastic Common Schema defines a common set of fields for ingesting data into Elasticsearch. A common schema helps you correlate data from sources like logs and metrics or IT operations analytics and security analytics. Further information on ECS can be found in the official [Elastic documentation](https://www.elastic.co/guide/en/ecs/current/index.html) or [github repository](https://github.com/elastic/ecs).

appveyor.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)