forked from eclipse-acute/aCute
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
83 lines (83 loc) · 2.1 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
pipeline {
agent {
kubernetes {
label 'acute-buildtest'
defaultContainer 'environment'
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: environment
image: mickaelistria/eclipse-acute-build-test-env:test
tty: true
command: [ "uid_entrypoint", "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'))
}
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 {
wrap([$class: 'Xvnc', useXauthority: true]) {
sh 'mvn clean verify -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -Dcbi.jarsigner.skip=false'
}
}
post {
always {
archiveArtifacts artifacts: '*/target/work/configuration/*.log,*/target/work/data/.metadata/.log', 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 genie.acute@projects-storage.eclipse.org rm -rf /home/data/httpd/download.eclipse.org/acute/snapshots'
sh 'ssh genie.acute@projects-storage.eclipse.org mkdir -p /home/data/httpd/download.eclipse.org/acute/snapshots'
sh 'scp -r repository/target/repository/* genie.acute@projects-storage.eclipse.org:/home/data/httpd/download.eclipse.org/acute/snapshots'
}
}
}
}
}
}