-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
131 lines (129 loc) · 5.45 KB
/
Copy pathJenkinsfile
File metadata and controls
131 lines (129 loc) · 5.45 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
pipeline {
agent {
kubernetes {
defaultContainer 'docker-agent'
label 'docker-agent'
yaml '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: docker-agent
image: eclipsecbi/docker-kubectl:0.0.2
command:
- cat
tty: true
resources:
limits:
cpu: 1
memory: 1Gi
volumeMounts:
- mountPath: /home/jenkins/agent/.docker
name: dot-docker
readOnly: false
- mountPath: /home/jenkins/agent/.ssh
name: dot-ssh
readOnly: false
- mountPath: "/home/jenkins/agent/.ssh/known_hosts"
name: "ssh-known-hosts"
subPath: "known_hosts"
readOnly: false
- mountPath: /home/default/.kube
name: dot-kube
readOnly: false
env:
- name: "HOME"
value: "/home/jenkins/agent"
- name: jnlp
resources:
limits:
cpu: 1
memory: 1Gi
volumes:
- name: dot-docker
emptyDir: {}
- name: dot-kube
emptyDir: {}
- name: dot-ssh
emptyDir: {}
- name: "ssh-known-hosts"
configMap:
name: "known-hosts"
'''
}
}
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
timeout(time: 15, unit: 'MINUTES')
disableConcurrentBuilds()
}
tools {
jdk 'oracle-jdk8-latest'
}
parameters {
string(name: 'release_name', defaultValue: '', description: 'e.g. 2020-06')
booleanParam(name: 'use_latest_platform', defaultValue: true, description: '')
string(name: 'path_to_platform_archive', defaultValue: '', description: 'Only relevant if $use_latest_platform is disabled! <br/> Path to eclipse platform archive that is used for the info center (base path: /home/data/httpd/download.eclipse.org/eclipse/downloads/drops4) e.g. R-4.16-202006040540/')
string(name: 'p2_repo_dir', defaultValue: 'releases/2025-06/202506111000', description: 'Path to P2 repository that is used for the info center (base path: /home/data/httpd/download.eclipse.org)<br/> Dir can be found here: <a href="https://download.eclipse.org/releases/">https://download.eclipse.org/releases/</a> <release>')
booleanParam(name: 'past_release', defaultValue: false, description: 'Change banner to say "Past release" instead of "Current release". Enable this for all releases but the latest!')
}
environment {
SSH_REMOTE = "genie.simrel@projects-storage.eclipse.org"
}
stages {
stage('Create docker image') {
steps {
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
container('docker-agent') {
sh '''
set +x
echo "use_latest_platform: ${use_latest_platform}"
if ${use_latest_platform}; then
base_dir="/home/data/httpd/download.eclipse.org/eclipse/downloads/drops4"
ssh "${SSH_REMOTE}" ls -a1d ${base_dir}/R-*
latest_r_build_dir=$(ssh "${SSH_REMOTE}" ls -1d ${base_dir}/R-* | tail -n 1)
path_to_platform_archive=$(ssh "${SSH_REMOTE}" ls -1 ${latest_r_build_dir}/eclipse-platform-*linux-gtk-x86_64.tar.gz)
#cut of base dir
path_to_platform_archive=${path_to_platform_archive#${base_dir}/}
fi
platform_archive_subdir=${path_to_platform_archive%/eclipse-*}
echo "platform_archive_subdir: ${platform_archive_subdir}"
cd app
chmod +x *.sh
./createInfoCenter.sh ${release_name} ${platform_archive_subdir} ${p2_repo_dir} ${past_release}
ls -al ${release_name}/eclipse/dropins/plugins >> doc_plugin_list.txt
'''
archiveArtifacts artifacts: '**/doc_plugin_list.txt', followSymlinks: false
}
}
}
}
stage('Build and push docker image') {
steps {
container('docker-agent') {
withDockerRegistry([credentialsId: 'dockerhub-bot', url: 'https://index.docker.io/v1/']) {
sh '''
mv app/info-center*.tar.gz docker/
cd docker/
./build_infocenter_docker_img.sh ${release_name}
'''
}
}
}
}
}
post {
failure {
mail to: 'frederic.gurr@eclipse-foundation.org',
subject: "Build Failure ${currentBuild.fullDisplayName}",
mimeType: 'text/html',
body: "Project: ${env.JOB_NAME}<br/>Build Number: ${env.BUILD_NUMBER}<br/>Build URL: ${env.BUILD_URL}<br/>Console: ${env.BUILD_URL}/console"
}
fixed {
mail to: 'frederic.gurr@eclipse-foundation.org',
subject: "Back to normal ${currentBuild.fullDisplayName}",
mimeType: 'text/html',
body: "Project: ${env.JOB_NAME}<br/>Build Number: ${env.BUILD_NUMBER}<br/>Build URL: ${env.BUILD_URL}<br/>Console: ${env.BUILD_URL}/console"
}
}
}