forked from eclipse/amlen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenkins.updatedownloadwww
72 lines (67 loc) · 2.4 KB
/
jenkins.updatedownloadwww
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
//The download page (https://download.eclipse.org/amlen) is different to the main Amlen website
//(https://www.eclipse.org/amlen). The main website has it's own git repo. The downloads page
//can only be updated (as far as I can tell) from the Jenkins for the main product source repo.
//Thus this jenkins script which copes the simple download page files from the product source
//to the Eclipse download server
pipeline {
parameters{
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'main', name: 'branchName', type: 'PT_BRANCH',description: 'Branch to get the websites/download HTML Download page(s) from'
}
agent {
kubernetes {
label "amlen-downloadwww-update-pod"
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: jnlp
resources:
limits:
memory: "300Mi"
cpu: "200m"
requests:
memory: "300Mi"
cpu: "200m"
volumeMounts:
- name: volume-known-hosts
mountPath: /home/jenkins/.ssh
volumes:
- name: volume-known-hosts
configMap:
name: known-hosts
"""
}
}
stages {
stage('DeployDownloadWWW') {
steps {
container('jnlp') {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh '''
pwd
echo ${GIT_BRANCH}
NOORIGIN_BRANCH=${GIT_BRANCH#origin/} # turns origin/main into main
scp -o BatchMode=yes -r websites/download/* genie.amlen@projects-storage.eclipse.org:/home/data/httpd/download.eclipse.org/amlen/
'''
}
}
}
}
}
post {
// send a mail on unsuccessful and fixed builds
unsuccessful { // means unstable || failure || aborted
emailext subject: 'Build $BUILD_STATUS $PROJECT_NAME #$BUILD_NUMBER!',
body: '''Check console output at $BUILD_URL to view the results.''',
recipientProviders: [culprits(), requestor()],
to: 'levell@uk.ibm.com'
}
fixed { // back to normal
emailext subject: 'Build $BUILD_STATUS $PROJECT_NAME #$BUILD_NUMBER!',
body: '''Check console output at $BUILD_URL to view the results.''',
recipientProviders: [culprits(), requestor()],
to: 'levell@uk.ibm.com'
}
}
}