Skip to content

Commit

Permalink
[releng] Add Jenkins build support and signing
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahgraham committed Apr 18, 2020
1 parent 25d001d commit d2fde99
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -2,7 +2,7 @@
[![Github Releases](https://img.shields.io/github/downloads/eclipse-embed-cdt/eclipse-plugins/latest/total.svg)](https://github.com/eclipse-embed-cdt/eclipse-plugins/releases/latest)
[![Github Releases](https://img.shields.io/github/downloads/eclipse-embed-cdt/eclipse-plugins/total.svg)](https://github.com/eclipse-embed-cdt/eclipse-plugins/releases/latest)
[![SourceForge](https://img.shields.io/sourceforge/dt/gnuarmeclipse.svg?label=SF%20downloads)](https://sourceforge.net/projects/gnuarmeclipse/files/)
[![Build Status](https://travis-ci.org/eclipse-embed-cdt/eclipse-plugins.svg?branch=develop)](https://travis-ci.org/eclipse-embed-cdt/eclipse-plugins)
[![Build Status](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.eclipse.org%2Fembed-cdt%2Fjob%2Fnightly%2Fjob%2Fdevelop%2F)](https://ci.eclipse.org/embed-cdt/job/nightly/job/develop/)

# The Eclipse Embedded CDT plug-ins

Expand All @@ -26,7 +26,7 @@ Eclipse Marketplace; search for **GNU MCU Eclipse**.
* Stable: http://gnu-mcu-eclipse.netlify.com/v4-neon-updates
This is the official release; it is also referred by the Eclipse
Marketplace and the same content is packed as **Eclipse IDE for C/C++ Developers**.
* Pre-release versions: http://gnu-mcu-eclipse.netlify.com/v4-neon-updates-test
* Pre-release versions: https://download.eclipse.org/embed-cdt/nightly/develop/
Usually this site should be safe to use, but use it with caution.
* Experimental versions: http://gnu-mcu-eclipse.netlify.com/v4-neon-updates-experimental
Sometimes you can use this site to test some features that are not
Expand Down
39 changes: 39 additions & 0 deletions nightly.Jenkinsfile
@@ -0,0 +1,39 @@
pipeline {
agent {
kubernetes {
label 'migration'
}
}
tools {
maven 'apache-maven-latest'
jdk 'adoptopenjdk-hotspot-jdk8-latest'
}
stages {
stage('Build') {
steps {

sh "mvn \
--batch-mode --show-version \
clean verify \
-P production \
-Dmaven.repo.local=/home/jenkins/.m2/repository \
--settings /home/jenkins/.m2/settings.xml \
"
}
}
stage('Upload') {
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh './scripts/nightly-upload.sh'
}
}
}
}
post {
success {
// if/when tests are added, the results can be collected by uncommenting the next line
// junit '*/*/target/surefire-reports/*.xml'
archiveArtifacts 'repositories/ilg.gnumcueclipse.repository/target/ilg.gnumcueclipse.repository-*.zip'
}
}
}
33 changes: 33 additions & 0 deletions parent/pom.xml
Expand Up @@ -40,6 +40,9 @@

<!-- The usual Eclipse timestamp, down to minutes. -->
<maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>

<!-- Eclipse provided plug-ins for signing JARs with Eclipse infra -->
<cbi-plugins.version>1.1.7</cbi-plugins.version>
</properties>

<licenses>
Expand All @@ -65,6 +68,13 @@
<url>https://download.eclipse.org/releases/neon/201705151400</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<!-- Eclipse provided plug-ins for signing JARs with Eclipse infra -->
<id>cbi</id>
<url>https://repo.eclipse.org/content/repositories/cbi-releases/</url>
</pluginRepository>
</pluginRepositories>

<build>
<plugins>
Expand Down Expand Up @@ -165,6 +175,29 @@
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>production</id>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.cbi.maven.plugins</groupId>
<artifactId>eclipse-jarsigner-plugin</artifactId>
<version>${cbi-plugins.version}</version>
<executions>
<execution>
<id>sign</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<name>Eclipse Embedded CDT parent</name>
<url>https://www.eclipse.org/embed-cdt</url>
Expand Down
23 changes: 23 additions & 0 deletions scripts/nightly-upload.sh
@@ -0,0 +1,23 @@
#!/bin/bash

set -u # run with unset flag error so that missing parameters cause build failure
set -e # error out on any failed commands
set -x # echo all commands used for debugging purposes

SSHUSER="genie.embed-cdt@projects-storage.eclipse.org"
SSH="ssh ${SSHUSER}"
SCP="scp"

P2ZIP=repositories/ilg.gnumcueclipse.repository/target/ilg.gnumcueclipse.repository-*.zip
# The download location is chosen to be a non-mirrored URL according to
# https://wiki.eclipse.org/IT_Infrastructure_Doc#Use_mirror_sites.2Fsee_which_mirrors_are_mirroring_my_files.3F
DOWNLOAD=/home/data/httpd/download.eclipse.org/embed-cdt/nightly/${BRANCH_NAME}

${SSH} rm -rf ${DOWNLOAD}-temp
${SSH} rm -rf ${DOWNLOAD}-last
${SSH} mkdir -p ${DOWNLOAD}-temp
${SCP} ${P2ZIP} ${SSHUSER}:${DOWNLOAD}-temp/ilg.gnumcueclipse.repository.zip
${SSH} "cd ${DOWNLOAD}-temp && unzip ilg.gnumcueclipse.repository.zip"
${SSH} mv ${DOWNLOAD} ${DOWNLOAD}-last
${SSH} mv ${DOWNLOAD}-temp ${DOWNLOAD}
${SSH} rm -rf ${DOWNLOAD}-last

0 comments on commit d2fde99

Please sign in to comment.