Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #19 from xtext/lb_issue_11_nightly_deployment
Browse files Browse the repository at this point in the history
Lb issue 11 nightly deployment
  • Loading branch information
LorenzoBettini authored Mar 25, 2023
2 parents 8d0d989 + 164b0e3 commit 3460d06
Show file tree
Hide file tree
Showing 109 changed files with 1,151 additions and 174 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ jobs:
mvn -version
- name: Build and test (headless with xvfb in Linux)
run: xvfb-run mvn clean verify -PuseJenkinsSnapshots -PbuildP2Repository
run: xvfb-run mvn clean verify -PuseJenkinsSnapshots
if: matrix.os == 'ubuntu-latest'
working-directory: org.eclipse.xtext.p2.releng
working-directory: org.eclipse.xtext.full.releng

- name: Build and test (in other OSes)
run: mvn clean verify -PuseJenkinsSnapshots
if: matrix.os != 'ubuntu-latest'
working-directory: org.eclipse.xtext.p2.releng
working-directory: org.eclipse.xtext.full.releng

build-maven-artifacts:
runs-on: ubuntu-latest
Expand Down
30 changes: 9 additions & 21 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,15 @@ pipeline {
}
}

stage('Maven Build & Test') {
stages { // TODO use of parallel { here kills Tycho process with OOM
stage('Maven Build and Test') {
steps {
sh '''
export MAVEN_OPTS="-Xmx1500m"
./maven-build.sh
'''
} // END steps
} // END stage
stage('Maven Tycho Build and Test') {
steps {
wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) {
sh """
export MAVEN_OPTS=-Xmx1500m
./tycho-test.sh -s /home/jenkins/.m2/settings.xml --tp=${selectedTargetPlatform()} --local-repository=/home/jenkins/.m2/repository
"""
}
}// END steps
} // END stage
} // END parallel
stage('Maven/Tycho Build & Test') {
steps {
wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) {
sh """
export MAVEN_OPTS=-Xmx1500m
./full-build.sh --tp=${selectedTargetPlatform()}
"""
}
}// END steps
} // END stage
} // END stages

Expand Down
68 changes: 68 additions & 0 deletions full-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env bash
if [ -z "$JENKINS_URL" ]; then
# if not set in environment use default
JENKINS_URL=https://ci.eclipse.org/xtext/
fi
if [ -z "$WORKSPACE" ]; then
# if not set in environment use default
WORKSPACE=$(pwd)
fi


MVN_ARGS=(\
--update-snapshots \
-DJENKINS_URL=$JENKINS_URL \
-DWORKSPACE=$WORKSPACE \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
-Dit-archetype-tests-skip=true \
)

# args parsing inspired by https://gist.github.com/jehiah/855086
while [ "$1" != "" ]; do
PARAM=`echo $1 | awk -F= '{print $1}'`
VALUE=`echo $1 | awk -F= '{print $2}'`
case $PARAM in
-h | --help)
echo "Perform Maven build for xtext-xtend"
echo ""
echo "./1-maven-build.sh"
echo -e "\t-h --help"
echo -e "\t--no-tests Skip test execution"
echo -e "\t--local-repository=<PATH> Use local Maven repository"
echo -e "\t--tp=$TARGET_PLATFORM (valid values: r202203,r202206,...,latest)"
echo ""
exit
;;
--no-tests)
MVN_ARGS+=(-DskipTests=true)
;;
--local-repository)
MVN_ARGS+=" -Dmaven.repo.local=$VALUE"
;;
--tp)
TARGET_PLATFORM=($VALUE)
;;
*)
# append any additionally passed arg
if [ -z "$VALUE" ]; then
MVN_ARGS+=($PARAM)
else
MVN_ARGS+=($PARAM=$VALUE)
fi
;;
esac
shift
done

MVN_ARGS+=(-PuseJenkinsSnapshots)
MVN_ARGS+=(-P$TARGET_PLATFORM)

echo mvn -B -f org.eclipse.xtext.full.releng ${MVN_ARGS[@]} $@

echo "Using target platform '$TARGET_PLATFORM'"
mvn -B \
-f org.eclipse.xtext.full.releng \
clean deploy \
-DaltDeploymentRepository=local::default::file:./build/maven-repository \
${MVN_ARGS[@]} \
$@
65 changes: 65 additions & 0 deletions full-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/env bash
if [ -z "$JENKINS_URL" ]; then
# if not set in environment use default
JENKINS_URL=https://ci.eclipse.org/xtext/
fi
if [ -z "$WORKSPACE" ]; then
# if not set in environment use default
WORKSPACE=$(pwd)
fi


MVN_ARGS=(\
--update-snapshots \
-DJENKINS_URL=$JENKINS_URL \
-DWORKSPACE=$WORKSPACE \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
-Dit-archetype-tests-skip=true \
)

# args parsing inspired by https://gist.github.com/jehiah/855086
while [ "$1" != "" ]; do
PARAM=`echo $1 | awk -F= '{print $1}'`
VALUE=`echo $1 | awk -F= '{print $2}'`
case $PARAM in
-h | --help)
echo "Perform Maven build for xtext-xtend"
echo ""
echo "./1-maven-build.sh"
echo -e "\t-h --help"
echo -e "\t--no-tests Skip test execution"
echo -e "\t--local-repository=<PATH> Use local Maven repository"
echo -e "\t--tp=$TARGET_PLATFORM (valid values: r202203,r202206,...,latest)"
echo ""
exit
;;
--no-tests)
MVN_ARGS+=(-DskipTests=true)
;;
--local-repository)
MVN_ARGS+=" -Dmaven.repo.local=$VALUE"
;;
--tp)
TARGET_PLATFORM=($VALUE)
;;
*)
# append any additionally passed arg
if [ -z "$VALUE" ]; then
MVN_ARGS+=($PARAM)
else
MVN_ARGS+=($PARAM=$VALUE)
fi
;;
esac
shift
done

MVN_ARGS+=(-PuseJenkinsSnapshots)

echo mvn -B -f org.eclipse.xtext.full.releng ${MVN_ARGS[@]} $@

mvn -B \
-f org.eclipse.xtext.full.releng \
clean deploy \
${MVN_ARGS[@]} \
$@
43 changes: 43 additions & 0 deletions jenkins/Jenkinsfile-full-deploy-nightly
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
pipeline {
agent any

environment {
DOWNLOAD_AREA = '/home/data/httpd/download.eclipse.org/modeling/tmf/xtext/monorepo'
REPOSITORY_PATH="${DOWNLOAD_AREA}/updates/nightly"
}

tools {
maven "apache-maven-3.8.6"
jdk "temurin-jdk17-latest"
}

stages {
stage('Prepare download area') {
steps {
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
sh '''
echo ${REPOSITORY_PATH}
ssh [email protected] "mkdir -p $REPOSITORY_PATH"
'''
}
}
}
stage('Maven Tycho Build, Sign, Deploy') {
steps {
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING')]) {
sh 'gpg --batch --import "${KEYRING}"'
sh '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'
}
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
sh './full-deploy.sh -Peclipse-sign,sonatype-oss-release,release-snapshot'
}
}
}
}

post {
success {
archiveArtifacts artifacts: 'build/**'
}
}
}
39 changes: 39 additions & 0 deletions jenkins/Jenkinsfile-p2-deploy-nightly
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
pipeline {
agent any

environment {
DOWNLOAD_AREA = '/home/data/httpd/download.eclipse.org/modeling/tmf/xtext/monorepo'
REPOSITORY_PATH="${DOWNLOAD_AREA}/updates/nightly"
}

tools {
maven "apache-maven-3.8.6"
jdk "temurin-jdk17-latest"
}

stages {
stage('Maven Tycho Build and Sign') {
steps {
sh './tycho-sign.sh'
}
}
stage('Copy to download area') {
steps {
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
sh '''
echo ${REPOSITORY_PATH}
ssh [email protected] "rm -rf $REPOSITORY_PATH"
ssh [email protected] "mkdir -p $REPOSITORY_PATH"
scp -o BatchMode=yes -r build/p2-repository/* [email protected]:$REPOSITORY_PATH/
'''
}
}
}
}

post {
success {
archiveArtifacts artifacts: 'build/**'
}
}
}
3 changes: 2 additions & 1 deletion org.eclipse.emf.mwe2.language.sdk.dummy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.xtext</groupId>
<artifactId>xtext-parent</artifactId>
<artifactId>org.eclipse.xtext.nodeploy.parent</artifactId>
<version>2.31.0-SNAPSHOT</version>
<relativePath>../org.eclipse.xtext.nodeploy.parent</relativePath>
</parent>
<packaging>eclipse-feature</packaging>
<groupId>org.eclipse.emf</groupId>
Expand Down
3 changes: 2 additions & 1 deletion org.eclipse.xtend.core.tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.xtext</groupId>
<artifactId>xtext-parent</artifactId>
<artifactId>org.eclipse.xtext.nodeploy.parent</artifactId>
<version>2.31.0-SNAPSHOT</version>
<relativePath>../org.eclipse.xtext.nodeploy.parent</relativePath>
</parent>
<groupId>org.eclipse.xtend</groupId>
<artifactId>org.eclipse.xtend.core.tests</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion org.eclipse.xtend.doc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.xtext</groupId>
<artifactId>xtext-parent</artifactId>
<artifactId>org.eclipse.xtext.nodeploy.parent</artifactId>
<version>2.31.0-SNAPSHOT</version>
<relativePath>../org.eclipse.xtext.nodeploy.parent</relativePath>
</parent>
<groupId>org.eclipse.xtend</groupId>
<artifactId>org.eclipse.xtend.doc</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion org.eclipse.xtend.examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.xtext</groupId>
<artifactId>xtext-parent</artifactId>
<artifactId>org.eclipse.xtext.nodeploy.parent</artifactId>
<version>2.31.0-SNAPSHOT</version>
<relativePath>../org.eclipse.xtext.nodeploy.parent</relativePath>
</parent>
<groupId>org.eclipse.xtend</groupId>
<artifactId>org.eclipse.xtend.examples</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion org.eclipse.xtend.ide.tests.data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.xtext</groupId>
<artifactId>xtext-parent</artifactId>
<artifactId>org.eclipse.xtext.nodeploy.parent</artifactId>
<version>2.31.0-SNAPSHOT</version>
<relativePath>../org.eclipse.xtext.nodeploy.parent</relativePath>
</parent>
<groupId>org.eclipse.xtend</groupId>
<artifactId>org.eclipse.xtend.ide.tests.data</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion org.eclipse.xtend.ide/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.xtext</groupId>
<artifactId>xtext-parent</artifactId>
<artifactId>org.eclipse.xtext.nodeploy.parent</artifactId>
<version>2.31.0-SNAPSHOT</version>
<relativePath>../org.eclipse.xtext.nodeploy.parent</relativePath>
</parent>
<groupId>org.eclipse.xtend</groupId>
<artifactId>org.eclipse.xtend.ide</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion org.eclipse.xtend.lib.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.xtext</groupId>
<artifactId>xtext-parent</artifactId>
<artifactId>org.eclipse.xtext.nodeploy.parent</artifactId>
<version>2.31.0-SNAPSHOT</version>
<relativePath>../org.eclipse.xtext.nodeploy.parent</relativePath>
</parent>
<groupId>org.eclipse.xtend.feature</groupId>
<artifactId>org.eclipse.xtend.lib</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion org.eclipse.xtend.lib.gwt.test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.xtext</groupId>
<artifactId>xtext-parent</artifactId>
<artifactId>org.eclipse.xtext.nodeploy.parent</artifactId>
<version>2.31.0-SNAPSHOT</version>
<relativePath>../org.eclipse.xtext.nodeploy.parent</relativePath>
</parent>
<groupId>org.eclipse.xtend</groupId>
<artifactId>org.eclipse.xtend.lib.gwt.test</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion org.eclipse.xtend.lib.tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.xtext</groupId>
<artifactId>xtext-parent</artifactId>
<artifactId>org.eclipse.xtext.nodeploy.parent</artifactId>
<version>2.31.0-SNAPSHOT</version>
<relativePath>../org.eclipse.xtext.nodeploy.parent</relativePath>
</parent>
<groupId>org.eclipse.xtend</groupId>
<artifactId>org.eclipse.xtend.lib.tests</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion org.eclipse.xtend.m2e/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.xtext</groupId>
<artifactId>xtext-parent</artifactId>
<artifactId>org.eclipse.xtext.nodeploy.parent</artifactId>
<version>2.31.0-SNAPSHOT</version>
<relativePath>../org.eclipse.xtext.nodeploy.parent</relativePath>
</parent>
<groupId>org.eclipse.xtend</groupId>
<artifactId>org.eclipse.xtend.m2e</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion org.eclipse.xtend.sdk.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.xtext</groupId>
<artifactId>xtext-parent</artifactId>
<artifactId>org.eclipse.xtext.nodeploy.parent</artifactId>
<version>2.31.0-SNAPSHOT</version>
<relativePath>../org.eclipse.xtext.nodeploy.parent</relativePath>
</parent>
<packaging>eclipse-feature</packaging>
<artifactId>org.eclipse.xtend.sdk</artifactId>
Expand Down
Loading

0 comments on commit 3460d06

Please sign in to comment.