-
Notifications
You must be signed in to change notification settings - Fork 9
/
jenkins.promotebuild
57 lines (54 loc) · 1.91 KB
/
jenkins.promotebuild
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
pipeline {
agent {
kubernetes {
label 'amlen-buildalltier1-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
"""
}
}
parameters{
string(name: 'snapshotpath', defaultValue: '', description: 'Path to existing snapshot e.g. snapshots/main/20211109-2203_eclipse')
string(name: 'releasepath', defaultValue: '', description: 'Path to releases e.g. 0.1rc1')
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'main', name: 'branchName', type: 'PT_BRANCH', description: 'Branch to get the server_build/buildcontainer/jenkins.promotebuild script from'
}
stages {
stage('PromoteSnapshot') {
steps {
container('jnlp') {
script {
srcdirpath='/home/data/httpd/download.eclipse.org/amlen/'
env.releasedirpath=srcdirpath+'releases/'
env.snapshotfilepath=srcdirpath+snapshotpath
env.releasefilepath=releasedirpath+releasepath
}
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh """
echo "Promoting ${snapshotfilepath} to ${releasefilepath}"
ssh -o BatchMode=yes genie.amlen@projects-storage.eclipse.org mkdir -p ${releasedirpath}
ssh -o BatchMode=yes genie.amlen@projects-storage.eclipse.org cp -r ${snapshotfilepath} ${releasefilepath}
"""
}
}
}
}
}
}