-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support update site promotion via a declarative Jenkins pipeline
Improve the bundle names as they appear in the update sites. Upgrade to latest Tycho release. Upgrade to the latest jarsigner. Provide a functional Oomph setup, including a setup configuration and use it in the CONTRIBUTING.md. Ensure that the nightly target works. Reduce workspace warnings. #328 #330
- Loading branch information
Showing
58 changed files
with
961 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ src-gen/ | |
xtend-gen/ | ||
xtext-gen/ | ||
target/ | ||
/xpect/updates | ||
xpect-local-maven-repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
Contributions are welcome. | ||
# Contributing to Eclipse Xpect | ||
|
||
## Eclipse Contributor Agreement | ||
Before your contribution can be accepted by the project team contributors must | ||
electronically sign the Eclipse Contributor Agreement (ECA). | ||
Thanks for your interest in this project. | ||
|
||
* http://www.eclipse.org/legal/ECA.php | ||
## Creating an Eclipse Development Environment | ||
|
||
Commits that are provided by non-committers must have a Signed-off-by field in | ||
the footer indicating that the author is aware of the terms by which the | ||
contribution has been provided to the project. The non-committer must | ||
additionally have an Eclipse Foundation account and must have a signed Eclipse | ||
Contributor Agreement (ECA) on file. | ||
For more information, please see the Eclipse Committer Handbook: | ||
https://www.eclipse.org/projects/handbook/#resources-commit | ||
You can set up a pre-configured IDE for the development of Xpect using the following link: | ||
|
||
[![Create Eclipse Development Environment for Xpect](https://download.eclipse.org/oomph/www/setups/svg/Xpect.svg)](https://www.eclipse.org/setups/installer/?url=https://raw.githubusercontent.com/eclipse/Xpect/master/org.eclipse.xpect.releng/XpectConfiguration.setup&show=true "Click to open Eclipse-Installer Auto Launch or drag onto your running installer's title area") | ||
|
||
|
||
|
||
## General Processes and Workflows | ||
|
||
The [eclipse-platform](https://github.com/eclipse-platform/.github/blob/main/CONTRIBUTING.md) provides detailed contribution information that is generally applicable also for Xpect. | ||
|
||
|
||
## Contact | ||
|
||
Contact the project developers via issues (preferred) or via "xpect-dev" mailing list. | ||
|
||
* https://github.com/eclipse/Xpect/issues | ||
* https://dev.eclipse.org/mailman/listinfo/xpect-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,117 +1,187 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2012-2017 TypeFox GmbH and itemis AG. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Moritz Eysholdt - Initial contribution and API | ||
*******************************************************************************/ | ||
|
||
timestamps() { | ||
properties([ | ||
pipelineTriggers([cron('H 2 * * *')]) | ||
]) | ||
node('centos-8') { | ||
def javaHome = tool 'temurin-jdk11-latest' | ||
def java17Home = tool 'temurin-jdk17-latest' | ||
env.JAVA_HOME = "${javaHome}" | ||
def mvnHome = tool 'apache-maven-3.8.6' | ||
def mvnParams = '--batch-mode --update-snapshots -fae -Dmaven.repo.local=xpect-local-maven-repository -DtestOnly=false' | ||
try { | ||
timeout(time: 1, unit: 'HOURS') { | ||
stage('prepare workspace') { | ||
step([$class: 'WsCleanup']) | ||
// we need to live with detached head, or we need to adjust settings: | ||
// https://issues.jenkins-ci.org/browse/JENKINS-42860 | ||
checkout scm | ||
} | ||
stage('log configuration') { | ||
echo("===== checking tools versions =====") | ||
sh """\ | ||
git config --get remote.origin.url | ||
git reset --hard | ||
pwd | ||
ls -la | ||
${mvnHome}/bin/mvn -v | ||
${javaHome}/bin/java -version | ||
""" | ||
echo("===================================") | ||
} | ||
wrap([$class: 'Xvnc', useXauthority: true]) { | ||
stage('compile with Eclipse 2023-03 and Xtext 2.31.0') { | ||
sh "${mvnHome}/bin/mvn -P!tests -Declipsesign=true -Dtarget-platform=eclipse_2023_03-xtext_2_31_0 ${mvnParams} clean install" | ||
archiveArtifacts artifacts: 'org.eclipse.xpect.releng/p2-repository/target/repository/**/*.*,org.eclipse.xpect.releng/p2-repository/target/org.eclipse.xpect.repository-*.zip' | ||
} | ||
} | ||
pipeline { | ||
agent { | ||
label 'centos-latest' | ||
} | ||
|
||
wrap([$class: 'Xvnc', useXauthority: true]) { | ||
stage('test with Eclipse 2023-09 and Xtext nighly') { | ||
try{ | ||
sh "JAVA_HOME=${java17Home} ${mvnHome}/bin/mvn -P!xtext-examples -Dtycho-version=2.7.5 -Dtarget-platform=eclipse_2023_09-xtext_nightly ${mvnParams} clean integration-test" | ||
}finally { | ||
junit '**/TEST-*.xml' | ||
} | ||
} | ||
} | ||
triggers { | ||
cron('H 23 * * *') | ||
} | ||
|
||
if(env.BRANCH_NAME?.toLowerCase() == 'master' || | ||
env.BRANCH_NAME?.toLowerCase()?.startsWith('release_')) { | ||
stage('deploy') { | ||
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING')]) { | ||
sh ''' | ||
rm -r xpect-local-maven-repository | ||
gpg --batch --import "${KEYRING}" | ||
for fpr in $(gpg --list-keys --with-colons | awk -F: '/fpr:/ {print $10}' | sort -u); | ||
do | ||
echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key $fpr trust; | ||
done | ||
''' | ||
sh "${mvnHome}/bin/mvn -P!tests -P!xtext-examples -P maven-publish -Dtarget-platform=eclipse_2023_03-xtext_2_31_0 ${mvnParams} clean deploy" | ||
} | ||
} | ||
} | ||
options { | ||
buildDiscarder(logRotator(numToKeepStr: '10')) | ||
disableConcurrentBuilds() | ||
skipDefaultCheckout false | ||
} | ||
|
||
tools { | ||
maven 'apache-maven-latest' | ||
jdk 'temurin-jdk17-latest' | ||
} | ||
|
||
environment { | ||
PUBLISH_LOCATION = 'updates' | ||
BUILD_TIMESTAMP = sh(returnStdout: true, script: 'date +%Y%m%d%H%M').trim() | ||
} | ||
|
||
parameters { | ||
choice( | ||
name: 'BUILD_TYPE', | ||
choices: ['nightly', 'milestone', 'release'], | ||
description: ''' | ||
Choose the type of build. | ||
Note that a release build will not promote the build, but rather will promote the most recent milestone build. | ||
''' | ||
) | ||
|
||
choice( | ||
name: 'TARGET_PLATFORM', | ||
choices: [ 'eclipse_2023_03-xtext_2_31_0', 'eclipse_2023_09-xtext_nightly' ], | ||
description: ''' | ||
Choose the named target platform against which to compile and test. | ||
This is relevant only for nightly and milestone builds. | ||
''' | ||
) | ||
|
||
booleanParam( | ||
name: 'ECLIPSE_SIGN', | ||
defaultValue: true, | ||
description: ''' | ||
Choose whether or not the bundles will be signed. | ||
This is relevant only for nightly and milestone builds. | ||
''' | ||
) | ||
|
||
booleanParam( | ||
name: 'PROMOTE', | ||
defaultValue: true, | ||
description: 'Whether to promote the build to the download server.' | ||
) | ||
} | ||
|
||
stages { | ||
stage('Display Parameters') { | ||
steps { | ||
script { | ||
env.BUILD_TYPE = params.BUILD_TYPE | ||
env.TARGET_PLATFORM = params.TARGET_PLATFORM | ||
|
||
if (env.BRANCH_NAME == 'master') { | ||
// Only sign the master branch. | ||
env.ECLIPSE_SIGN = params.ECLIPSE_SIGN | ||
} else { | ||
env.ECLIPSE_SIGN = false | ||
} | ||
|
||
// Only promote signed builds. | ||
env.PROMOTE = params.PROMOTE && (env.ECLIPSE_SIGN == 'true') | ||
} | ||
} catch(e) { | ||
currentBuild.result = 'FAILED' | ||
throw e | ||
} finally { | ||
postAlways() | ||
echo """ | ||
BUILD_TIMESTAMP=${env.BUILD_TIMESTAMP} | ||
BUILD_TYPE=${env.BUILD_TYPE} | ||
TARGET_PLATFORM=${env.TARGET_PLATFORM} | ||
ECLIPSE_SIGN=${env.ECLIPSE_SIGN} | ||
PROMOTE=${env.PROMOTE} | ||
BRANCH_NAME=${env.BRANCH_NAME} | ||
""" | ||
} | ||
} | ||
|
||
stage('Build') { | ||
steps { | ||
sshagent(['projects-storage.eclipse.org-bot-ssh']) { | ||
wrap([$class: 'Xvnc', useXauthority: true]) { | ||
dir('.') { | ||
sh ''' | ||
if [[ $PROMOTE != true ]]; then | ||
promotion_argument='-P!promote' | ||
fi | ||
mvn \ | ||
--fail-at-end \ | ||
--no-transfer-progress \ | ||
--update-snapshots \ | ||
$promotion_argument \ | ||
-Dmaven.repo.local=xpect-local-maven-repository \ | ||
-Dmaven.artifact.threads=16 \ | ||
-Dbuild.id=${BUILD_TIMESTAMP} \ | ||
-Dgit.commit=$GIT_COMMIT \ | ||
-Declipsesign=${ECLIPSE_SIGN} \ | ||
-Dbuild.type=$BUILD_TYPE \ | ||
-Dtycho-version=4.0.3 \ | ||
-Dtarget-platform=${TARGET_PLATFORM} \ | ||
-Dorg.eclipse.justj.p2.manager.build.url=$JOB_URL \ | ||
-Dorg.eclipse.justj.p2.manager.relative=$PUBLISH_LOCATION \ | ||
clean \ | ||
verify | ||
''' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
post { | ||
failure { | ||
mail to: '[email protected]', | ||
subject: "[EMF CI] 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" | ||
archiveArtifacts allowEmptyArchive: true, artifacts: '**' | ||
} | ||
|
||
def postAlways() { | ||
def curResult = currentBuild.currentResult | ||
def lastResult = 'NEW' | ||
if (currentBuild.previousBuild != null) { | ||
lastResult = currentBuild.previousBuild.result | ||
fixed { | ||
mail to: '[email protected]', | ||
subject: "[EMF CI] 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" | ||
} | ||
|
||
if (curResult != 'SUCCESS' || lastResult != 'SUCCESS') { | ||
def color = '' | ||
switch (curResult) { | ||
case 'SUCCESS': | ||
color = '#00FF00' | ||
break | ||
case 'UNSTABLE': | ||
color = '#FFFF00' | ||
break | ||
case 'FAILURE': | ||
color = '#FF0000' | ||
break | ||
default: // e.g. ABORTED | ||
color = '#666666' | ||
} | ||
success { | ||
archiveArtifacts artifacts: 'org.eclipse.xpect.releng/p2-repository/target/repository/**/*.*,org.eclipse.xpect.releng/p2-repository/target/org.eclipse.xpect.repository-*.zip' | ||
} | ||
|
||
matrixSendMessage https: true, | ||
hostname: 'matrix.eclipse.org', | ||
accessTokenCredentialsId: "matrix-token", | ||
roomId: '!aFWRHMCLJDZBzuNIRD:matrix.eclipse.org', | ||
body: "${lastResult} => ${curResult} ${env.BUILD_URL} | ${env.JOB_NAME}#${env.BUILD_NUMBER}", | ||
formattedBody: "<div><font color='${color}'>${lastResult} => ${curResult}</font> | <a href='${env.BUILD_URL}' target='_blank'>${env.JOB_NAME}#${env.BUILD_NUMBER}</a></div>" | ||
always { | ||
junit allowEmptyResults: true, testResults: '**/TEST-*.xml' | ||
} | ||
|
||
cleanup { | ||
deleteDir() | ||
postAlways() | ||
} | ||
} | ||
} | ||
|
||
def postAlways() { | ||
def curResult = currentBuild.currentResult | ||
def lastResult = 'NEW' | ||
if (currentBuild.previousBuild != null) { | ||
lastResult = currentBuild.previousBuild.result | ||
} | ||
|
||
echo "matrix result check: curResult=${curResult} lastResult=${lastResult}" | ||
|
||
if (curResult != 'SUCCESS' || lastResult != 'SUCCESS') { | ||
def color = '' | ||
switch (curResult) { | ||
case 'SUCCESS': | ||
color = '#00FF00' | ||
break | ||
case 'UNSTABLE': | ||
color = '#FFFF00' | ||
break | ||
case 'FAILURE': | ||
color = '#FF0000' | ||
break | ||
default: // e.g. ABORTED | ||
color = '#666666' | ||
} | ||
|
||
echo "matrix send message" | ||
matrixSendMessage https: true, | ||
hostname: 'matrix.eclipse.org', | ||
accessTokenCredentialsId: "matrix-token", | ||
roomId: '!aFWRHMCLJDZBzuNIRD:matrix.eclipse.org', | ||
body: "${lastResult} => ${curResult} ${env.BUILD_URL} | ${env.JOB_NAME}#${env.BUILD_NUMBER}", | ||
formattedBody: "<div><font color='${color}'>${lastResult} => ${curResult}</font> | <a href='${env.BUILD_URL}' target='_blank'>${env.JOB_NAME}#${env.BUILD_NUMBER}</a></div>" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.