-
Notifications
You must be signed in to change notification settings - Fork 33
/
Jenkinsfile
87 lines (87 loc) · 2.42 KB
/
Jenkinsfile
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
pipeline {
agent {
kubernetes {
label 'acute-buildtest'
defaultContainer 'environment'
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: environment
image: akurtakov/eclipse-acute-build-test-env:test
imagePullPolicy: "Always"
tty: true
command: [ "cat" ]
resources:
requests:
memory: "2.6Gi"
cpu: "1.3"
limits:
memory: "2.6Gi"
cpu: "1.3"
- name: jnlp
image: 'eclipsecbi/jenkins-jnlp-agent'
volumeMounts:
- mountPath: /home/jenkins/.ssh
name: volume-known-hosts
volumes:
- configMap:
name: known-hosts
name: volume-known-hosts
"""
}
}
options {
timeout(time: 60, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr:'10'))
disableConcurrentBuilds(abortPrevious: true)
}
environment {
DOTNET_SKIP_FIRST_TIME_EXPERIENCE="true"
MAVEN_OPTS="-Xms256m -Xmx2048m"
M2_REPO="$WORKSPACE/m2-repo"
}
stages {
stage('Test and initiate .NET Core') {
steps {
sh 'mkdir dotnet-init && \
cd dotnet-init && \
dotnet --version && \
dotnet new console && \
dotnet restore && \
dotnet run'
}
}
stage('Build') {
steps {
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING'), string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE')]) {
wrap([$class: 'Xvnc', useXauthority: true]) {
sh 'mvn clean verify -B -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -Psign -Dtycho.pgp.signer.bc.secretKeys="${KEYRING}" -Dgpg.passphrase="${KEYRING_PASSPHRASE}"'
}
}
}
post {
always {
archiveArtifacts artifacts: '*/target/work/configuration/*.log,*/target/work/data/.metadata/.log, repository/target/repository/**', fingerprint: false
junit '*/target/surefire-reports/TEST-*.xml'
}
}
}
stage('Deploy') {
when {
branch 'master'
// TODO deploy all branch from Eclipse.org Git repo
}
steps {
container('jnlp') {
sshagent (['projects-storage.eclipse.org-bot-ssh']) {
sh 'ssh [email protected] rm -rf /home/data/httpd/download.eclipse.org/acute/snapshots'
sh 'ssh [email protected] mkdir -p /home/data/httpd/download.eclipse.org/acute/snapshots'
sh 'scp -r repository/target/repository/* [email protected]:/home/data/httpd/download.eclipse.org/acute/snapshots'
}
}
}
}
}
}