-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile.publish-s3
51 lines (48 loc) · 1.81 KB
/
Jenkinsfile.publish-s3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
pipeline {
agent { label 'msvc' }
options {
timestamps ()
skipDefaultCheckout true
}
parameters {
text(name: 'S3_ENDPOINT', defaultValue: 'http://s3.cern.ch', description: '')
text(name: 'S3_CRED_ID', defaultValue: 'UPDATE_ID_HERE', description: '')
text(name: 'S3_BUCKET', defaultValue: 'kicad-nightly', description: '')
}
stages {
stage ('Checkout') {
steps {
script {
if (params.CLEAN_WS == true) {
cleanWs()
}
}
checkout([$class: 'GitSCM', branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false,
extensions: [],
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: '',
url: 'https://gitlab.com/mroszko/kicad-win-builder.git']]])
}
}
stage ('Upload') {
steps {
powershell "Remove-Item -Path './.upload' -Force -Recurse -ErrorAction SilentlyContinue"
copyArtifacts(projectName: 'build-windows-kicad-msvc-master', target: '.upload', selector: lastSuccessful(), filter: '*.exe,*-pdbs.zip');
withCredentials([[
$class: 'AmazonWebServicesCredentialsBinding',
credentialsId: params.S3_CRED_ID,
accessKeyVariable: 'AWS_ACCESS_KEY_ID',
secretKeyVariable: 'AWS_SECRET_ACCESS_KEY'
]]) {
powershell '''
\$env:S3_ENDPOINT_URL='${params.S3_ENDPOINT}'
./build.ps1 -Init
s5cmd cp ./.upload/*.exe s3://${params.S3_BUCKET}/windows/nightly/
s5cmd cp ./.upload/*.zip s3://${params.S3_BUCKET}/windows/nightly/
'''
}
}
}
}
}