Skip to content

Commit

Permalink
Migrate deploy from classic job
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Berezovskyi <andriib@kth.se>
  • Loading branch information
berezovskyi committed Feb 15, 2022
1 parent 81711cb commit fa56005
Showing 1 changed file with 61 additions and 8 deletions.
69 changes: 61 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ pipeline {
jdk 'temurin-jdk11-latest'
}
stages {
// stage('Build') {
// steps {
// sh '''
// java -version
// mvn -v
// '''
// }
// }
stage('Sonar') {
steps {
withCredentials([string(credentialsId: 'sonarcloud-token', variable: 'SONARCLOUD_TOKEN')]) {
Expand All @@ -26,6 +18,67 @@ pipeline {
}
}
}
stage('Deploy') {
when {
anyOf {
branch 'master'
branch 'maint-*'
}
}
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'
}
sh '''
mvn -B -fae clean install -DskipTests javadoc:aggregate \
-P dev,gpg-sign,!eclipse-deploy,ossrh-deploy
mvn -B deploy -DskipTests -Dmaven.install.skip=true \
-P dev,gpg-sign,!eclipse-deploy,ossrh-deploy
mvn -B deploy -DskipTests -Dmaven.install.skip=true \
-P dev,gpg-sign,eclipse-deploy
'''
// sh 'gpg --verify my-app/target/my-app-1.0-SNAPSHOT.jar.asc'
sshagent(['git.eclipse.org-bot-ssh']) {
sh '''
DOCS_HOME=/home/data/httpd/download.eclipse.org/lyo/docs/all
VERSION=$(mvn -q \
-Dexec.executable="echo" \
-Dexec.args='${project.version}' \
--non-recursive \
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec | tail -n 1 | xargs)
# see https://github.com/eclipse/lyo.core/issues/135 for the tail/xargs temp fix
ssh genie.lyo@projects-storage.eclipse.org rm -rf $DOCS_HOME/$VERSION
ssh genie.lyo@projects-storage.eclipse.org mkdir -p $DOCS_HOME/$VERSION
scp -rp target/site/apidocs/ genie.lyo@projects-storage.eclipse.org:$DOCS_HOME/$VERSION
'''
}

}
}
stage('Publish Javadocs') {
when {
branch "master"
}
steps {
sshagent(['git.eclipse.org-bot-ssh']) {
sh '''
DOCS_HOME=/home/data/httpd/download.eclipse.org/lyo/docs/all
VERSION=$(mvn -q \
-Dexec.executable="echo" \
-Dexec.args='${project.version}' \
--non-recursive \
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec | tail -n 1 | xargs)
# see https://github.com/eclipse/lyo.core/issues/135 for the tail/xargs temp fix
ssh genie.lyo@projects-storage.eclipse.org rm -rf $DOCS_HOME/latest
ssh genie.lyo@projects-storage.eclipse.org mkdir -p $DOCS_HOME/latest
scp -rp target/site/apidocs/ genie.lyo@projects-storage.eclipse.org:$DOCS_HOME/latest
'''
}
}
}
}
post {
// send a mail on unsuccessful and fixed builds
Expand Down

0 comments on commit fa56005

Please sign in to comment.