-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile
50 lines (49 loc) · 1.93 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
pipeline {
agent { label 'migration' }
tools {
maven 'apache-maven-latest'
jdk 'openjdk-jdk17-latest'
}
parameters {
choice(name: 'PLATFORM', choices: ['capella', 'oxygen'], description: 'Platform to use')
}
environment {
FROM_PR = "${BRANCH_NAME}".contains("PR-");
BUILD_KEY = "${BRANCH_NAME}-${BUILD_ID}".replaceFirst(/^v/, "").replaceAll('/','-');
SSH_ACCOUNT = "genie.amalgam@projects-storage.eclipse.org"
TARGET_DIR = "/home/data/httpd/download.eclipse.org/modeling/amalgam/updates/nightly/${BUILD_KEY}/${params.PLATFORM}"
NIGHTLY_KEY = "${BRANCH_NAME}".replaceFirst(/^v/, "").replaceAll('/','-');
NIGHTLY_DIR = "/home/data/httpd/download.eclipse.org/modeling/amalgam/updates/nightly/${NIGHTLY_KEY}/${params.PLATFORM}"
}
stages {
stage('Package Amalgam') {
steps {
sh "env"
sh "mvn clean package -Psign -DPLATFORM=${params.PLATFORM} -Dmaven.test.failure.ignore=true --fail-at-end -f releng/org.eclipse.amalgam.releng/pom.xml"
}
}
stage('Publish artifacts') {
steps {
script {
currentBuild.description = "${BUILD_KEY} - <a href=\"https://download.eclipse.org/modeling/amalgam/updates/nightly/${BUILD_KEY}\">site</a>"
}
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh "ssh $SSH_ACCOUNT mkdir -p $TARGET_DIR"
sh "scp -rp $WORKSPACE/features/org.eclipse.amalgam.update/target/repository/* $SSH_ACCOUNT:$TARGET_DIR"
}
}
}
stage('Publish nightly') {
when {
expression { return "${env.FROM_PR}".contains("false") }
}
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh "ssh $SSH_ACCOUNT rm -rf $NIGHTLY_DIR"
sh "ssh $SSH_ACCOUNT mkdir -p $NIGHTLY_DIR"
sh "scp -rp $WORKSPACE/features/org.eclipse.amalgam.update/target/repository/* $SSH_ACCOUNT:$NIGHTLY_DIR"
}
}
}
}
}